# Ed Controls API ## Docs - [Introduction](/index): Integrate your systems with Ed Controls — projects, drawings, files, tickets and audits — over a REST API. - [Request API access](/getting-started/request-access): Get your client_id and client_secret in My apps. - [Create an app](/getting-started/create-an-app): Get your own client ID and secret in My apps, and manage them yourself. - [Sign in with Ed Controls](/getting-started/sign-in-with-ed-controls): OAuth 2.0 authorization code flow with PKCE for apps created in My apps. - [Quickstart](/getting-started/quickstart): From your app in My apps to your first API call in five minutes. - [Authentication](/authentication): Bearer tokens from your app in My apps, service accounts, and the older password grant. - [Two-factor authentication (MFA)](/authentication-mfa): Verify an SMS code and elevate an access token for 2FA-enabled users. - [MCP server](/mcp/overview): Let an AI assistant work in Ed Controls on your behalf — read and update projects, tickets, audits, maps and contracts. - [Connect your assistant](/mcp/connect): Add the Ed Controls MCP server to Claude, ChatGPT, VS Code, Cursor or any other MCP client. - [Available tools](/mcp/tools): The 27 tools of the Ed Controls MCP server: what each one reads or changes, and the permission it needs. - [Overview](/domain-model/overview): How contracts, projects, maps, files, tickets and audits relate. - [Roles & permissions](/domain-model/roles): What your service account can see and do. - [Upload files & maps](/recipes/upload-files-and-maps): Push documents and drawings into a project via URL-fetch. - [Browse the library](/recipes/browse-library): List a project's files and drawings together in one page, with counts per folder. - [Read tickets](/recipes/read-tickets): List, filter and page through the tickets of a project. - [Create a ticket](/recipes/create-ticket): Push defects from your own system into a project, then assign, update and close them. - [Comment and attach to a ticket](/recipes/comment-and-attach-to-ticket): Add a comment to a ticket, and attach a photo of the defect — both land in the app's ticket timeline. - [Place a ticket on a drawing](/recipes/place-ticket-on-drawing): Work out the x, y and zoom a new ticket's location needs. - [Ticket snapshots](/recipes/ticket-snapshots): What the map snapshot on a ticket is, how to read it, and how to render one yourself. - [Generate a PDF report](/recipes/generate-pdf-report): Request a ticket or audit report and receive the download link on your own callback URL. - [Receive audit reports by email](/recipes/audit-reports-by-email): Optional scenario: every completed audit arrives as a PDF report in the inbox of its informed participants, without a callback endpoint. - [Create an audit template](/recipes/create-audit-template): Build the checklist an audit is generated from — every question type, images, and the traps. - [Create an audit from a template](/recipes/create-audit): Find a template and instantiate it as an audit. - [Search & filtering](/recipes/search-and-filtering): The search envelope, pagination, sorting, filters and aggregations. - [Provision a project](/recipes/project-provisioning): Create a project and set up its groups, ready for use. - [Polling for changes](/recipes/polling-for-changes): Keep an external system in sync without webhooks. - [Changelog](/changelog): Notable changes to the Ed Controls API and this documentation. - [Overview](/api-reference/overview): Conventions that apply to every endpoint. - [Get an access token](/api-reference/authentication/get-an-access-token): Exchange your client credentials plus the credentials of an Ed Controls user (we recommend a dedicated service account) for a Bearer token. Tokens are valid for approximately 24 hours. - [List projects](/api-reference/projects/list-projects): Returns the projects visible to the authenticated user, wrapped in the standard search envelope. Use this call to discover the `database` identifier needed by all other endpoints. - [Create a project](/api-reference/projects/create-a-project): Creates a project under the given contract. The caller must be an **administrator** of the contract; a contract manager gets `403`. The contract must be active, and a demo contract can hold only one project (`403` otherwise). `name` (at most 500 characters), `location.location` and a valid `participants.accountable.email` are required; `referenceName` and `internalPurchaseNumber` take at most 500 characters. Anything else missing or too long is a `400`. On an Expert price plan at most three `customFields` are allowed, with labels of at most 25 characters. The answer is `{ "database": …, "id": … }`: keep `database`, the project's identifier in every other call, and `id`, the project document's id. - [Get a project](/api-reference/projects/get-a-project) - [Update a project](/api-reference/projects/update-a-project): Send the project document with your changes; fetch it first and send it back whole. The server applies your fields onto the **current** stored project and ignores the `_rev` you send, so there is no revision conflict: the last writer wins. Re-read right before you write. - Contract administrators and the project's Accountable may change the project; only a contract administrator may change the Accountable. A Support may change only the project's metadata. - `dates.startDate` is required. A start date that has already passed cannot be changed (send it unchanged); a future one cannot be moved into the past; a project without one needs today or a later date. Each of these is a `400`. - The colour palette holds at most 7 colours; on an Expert price plan at most three `customFields`, with labels of at most 25 characters. The answer is the updated project document. - [List tickets](/api-reference/tickets/list-tickets): Returns the tickets of one project that the authenticated user may see. A user without a role on the project gets `200` with no results, not `403`. Results are index documents (the ticket fields plus `couchDbId`, `database` and resolved `attachments[]` with a fetchable `name`), not the stored document `GET /tickets/{database}/{ticketId}` returns. Without both `sortby` and `sortOrder` no sort is applied and the order is unspecified. **Known issue:** `sortby=DUEDATE` sorts the opposite way of `sortOrder` (`asc` returns the latest due date first). - [Create a ticket](/api-reference/tickets/create-a-ticket): Creates a ticket in a project. Only `content.title` is required; the server fills the defaults (`state.state=created`, author = the token user, visible, and **no** `archived` field — the ticket is born active). When map placement is omitted the ticket is pinned to the project **geo map**, which is created on demand if the project does not have one yet. To pin the ticket to a real drawing, pass `map` plus a `location` — see [Place a ticket on a drawing](/recipes/place-ticket-on-drawing). The created ticket has **no attachments**: `content.attachments` is cleared. A photo can be added afterwards with `PUT /tickets/{database}/{ticketId}/uploadAttachment`, which attaches it as a comment attachment. A map [snapshot](/recipes/ticket-snapshots) cannot be added at all, so a ticket created here has none until someone moves its pin in the app. Authorization is evaluated before the request body. A caller without a qualifying role on the project receives `403` whatever the body contains. The body is validated before anything is written. A well-formed JSON object that violates a field constraint is rejected with `422` and an `application/problem+json` body whose `detail` names the offending field, for example `participants.informed[0] must be an object with an 'email' field, not a string`. A body that is not a JSON object at all is rejected with `400`. Participant addresses are stored as-is and are **not** checked against project membership: a typo creates an assignment that reaches nobody. Requires the service account to be **Accountable or Support** on the project, or a reporter on the drawing the ticket is placed on. - [Get a ticket](/api-reference/tickets/get-a-ticket): Returns the stored ticket document, as it is in the database: attachments are listed by file name only (`content.attachments`, comment `attachments`), not as the resolved `attachments[]` with a fetchable `name` that the list endpoints return. Readable by a superadmin, by everyone who may comment on the ticket (Accountable, Support, Consulted or Informed on the project, the ticket's responsible and assignees, its author), and by anyone Consulted or Informed on this ticket. Anyone else gets `403`. An unknown id is a `404`. - [Archive (soft-delete) a ticket](/api-reference/tickets/archive-soft-delete-a-ticket): Archives a ticket — the platform's soft-delete. It sets the ticket's `archived` timestamp, which removes it from the default (non-archived) ticket list; it can still be retrieved by listing with `archived=true`. Archiving is distinct from completing: `DELETE` removes the ticket from the active list, whereas `PATCH {"state":{"state":"completed"}}` only marks the lifecycle done. Idempotent: archiving an already-archived ticket succeeds with `204` and changes nothing. Honors the optional `If-Match` header for optimistic concurrency, the same as `PATCH` (stale `_rev` → `409`; omitted → last-write-wins). Requires the service account to be **Accountable or Support** on the project (a reporter may archive a ticket they authored while it is still `created`). A stale `If-Match` is checked before the role, so it answers `409` even to a caller who may not archive. - [Update, assign, or close a ticket](/api-reference/tickets/update-assign-or-close-a-ticket): Partially updates a ticket. Only a strict whitelist of writable fields is merged — `content.title`, `content.body`, `plan.dueDate`, `tags`, `progressLabels`, `state.state`, and `participants.responsible`. Anything else in the body (including `_id`, `_rev`, `project`, `type`, `map`, and author) is **ignored**. Assigning and closing are not separate endpoints — they are field changes: - **Close**: `{"state":{"state":"completed"}}` - **Assign**: `{"participants":{"responsible":{"email":"..."}}}` The lifecycle `state.state` is **not** order-enforced: any of `created`, `started`, or `completed` may be set regardless of the current state. A changed property writes an `operation` audit entry tagged `userInterface: "API"`. Optimistic concurrency: pass the current `_rev` in an optional `If-Match` header. On a stale value the request fails with `409` and no write happens; when the header is omitted the latest revision is read and last-write-wins. The whitelisted fields are validated before the merge. A violation is rejected with `422` and an `application/problem+json` body naming the offending field, and nothing is written; a body that is not a JSON object is rejected with `400`. Who may update: Accountable or Support on the project, Consulted or Informed on the project, and the ticket's responsible and assignees. The author of a ticket that is still `created` may change only `content.title`, `content.body`, `plan.dueDate` and `tags`. Only Accountable or Support may change `participants.responsible`. The checks run in this order: unknown ticket `404`, body not an object `400`, field validation `422` (title, body, participants, due date, tags), stale `If-Match` `409`, role `403`, then the `state` and `progressLabels` values `422`. So a caller without the right role can receive a `422` or `409` before the `403`. The response is the database acknowledgement `{ok, id, rev}`, not the ticket; read it again with `GET` when you need the result. - [Add a comment to a ticket](/api-reference/tickets/add-a-comment-to-a-ticket): Appends a comment to a ticket. It shows up in the ticket's timeline in the Ed Controls apps, attributed to the token's user. This is a separate endpoint rather than a field on `PATCH` because it is purely additive — nothing already on the ticket is overwritten. `comments` is **not** on the `PATCH` whitelist, so a comment sent through `PATCH` answers `200` and stores nothing. The request body is a **closed schema**: `{"body": "..."}` and nothing else. The *stored* field is called `note`, which makes `{"note": "..."}` the wrong guess a caller makes most often — it is rejected with `422` naming the field rather than silently ignored. `author`, `time`, `public`, `attachments` and `allowedUsers` are refused for the same reason: the server takes the author from the token, stamps the time, and writes the timeline entry that makes the comment visible. Optimistic concurrency: pass the ticket's current `_rev` in an optional `If-Match` header. On a stale value the request fails with `409` and nothing is written; omit the header and the latest revision is read. Who may comment: anyone who may update the ticket — Accountable or Support on the project, the project's Consulted and Informed, and the ticket's own Responsible or assignees — **plus the ticket's author, in any state**. That is deliberately wider than `PATCH`: a comment cannot overwrite anything, and someone who raised a ticket needs to be able to answer a question about it once work has started. See [Comment and attach to a ticket](/recipes/comment-and-attach-to-ticket). - [Attach a photo to a ticket](/api-reference/tickets/attach-a-photo-to-a-ticket): Attaches a photo to a ticket. `multipart/form-data` with a single part named **`photo`** — the same part name and the same three content types as `PUT /api/v2/data/projects/{database}/{id}/uploadAttachment`. The photo is attached **as a comment attachment**, which is how it reaches the Ed Controls apps: it appears in the ticket's timeline and on the drawing pin's popover. A `.256x192` thumbnail is generated for you and stored beside the original; `thumbnailFileName` in the response names it. **The stored file name is not necessarily the one you sent.** It is sanitised to a single-dot, URL-safe name, given the extension the *bytes* require, and suffixed (`crack-1.jpg`) when that name is already taken on the ticket. A PNG uploaded as `crack.jpg` is stored as `crack.png`, and `photo of crack (1).JPG` becomes `photo-of-crack-1.jpg`. **Read `fileName` back from the response** instead of assuming — it is the only name the file can be fetched under. The content type is decided by decoding the bytes, not from the part's declared `Content-Type` or the file name, which are both caller-supplied claims. `image/jpeg` and `image/png` are accepted; anything else is `422` with a `detail` naming what was actually found. The `detail` lists a third type, `image/jpg`, and no upload is ever detected as one: the server shares its allowed-types list with the project endpoint, and this is the list, not the outcome. A response's `contentType` is only ever `image/jpeg` or `image/png`. Both files are then readable at `/api/v1/securedata/{database}/{ticketId}/{fileName}?access_token=...`. Optimistic concurrency: the optional `If-Match` header behaves as it does on `PATCH` (stale `_rev` → `409`, nothing written). Who may attach: anyone who may update the ticket, plus the ticket's author while the ticket is still `created`. Narrower than adding a comment, because an attachment is a permanent binary on the document and this API cannot remove one. Note the `415`: a request that is not multipart at all is refused by the framework before it reaches this endpoint, so — unlike every other error here — its body is **not** `application/problem+json`. Error handling that reads `detail` has to tolerate that one shape. See [Comment and attach to a ticket](/recipes/comment-and-attach-to-ticket). - [Search tickets](/api-reference/tickets/search-tickets): Query endpoint (despite the POST method): the filters of `GET /tickets` as a JSON body, across one or more projects. Safe to retry. - Name the projects in the body as `projects`, or pass one project as the `database` **query** parameter. A `database` in the body is ignored; with neither the request is a `400`. - `page` and `size` are **query** parameters, not body fields. - **Results contain only ids unless you ask for fields.** List the fields you need in `includeFields` (for example `["content.title", "state.state", "plan.dueDate"]`); without it each result is just `{ "id": … }` plus `_id` and an empty `attachments`. - [List ticket tags](/api-reference/tickets/list-ticket-tags): Returns the tags in use on tickets, and on the drawings they stand on, across the given projects. Projects the caller does not belong to are dropped; when none is left the request is a `400`. - [List audits](/api-reference/audits/list-audits): `database` is required. The same list is also served by `GET /api/v2/data/projects/{database}/audits`, which takes it from the path; one handler answers both and both are supported indefinitely. There is no tag filter on this endpoint: a `tag` parameter is accepted and ignored. Filter on tags with `POST /api/v2/data/audits/search`. - [Get an audit](/api-reference/audits/get-an-audit): Returns the stored audit document. Readable by contract administrators, Accountable and Support on the project, and anyone Responsible, Consulted, Informed or Reporter on this audit. - [Update (fill in) an audit](/api-reference/audits/update-fill-in-an-audit): Replaces the audit document: read it with `GET`, change it, and send the **whole** document back with its current `_rev`. This is how an audit is filled in — answers live in `questions`, and `status` and `dates.completionDate` are yours to set when it is finished. - A field you leave out is removed, with one exception: when the body has no `_attachments` or `attachments` key, the stored photos are kept. Sending `attachments: []` deletes them. - `dates.lastModifiedDate` is set by the server. - A stale `_rev`, or attachment stubs from an older revision, is a `409`: read the audit again and reapply your change. The body is checked before it is written, and a type the audit screen cannot render is a `422` naming the field: `type` must be `IB.EdBundle.Document.Audit`; `name` and `status` strings; `dates`, `author`, `lastmodifier`, `participants` objects; `maps`, `signature`, `comments`, `timeline` arrays; each `maps[i]` an object with `mapID` and `mapname`; `questions` an array of categories, each with a `questions` array whose entries have a `settings` object. These checks apply to fields that are present; `null` is refused. A body that is not a JSON object is a `400`. Allowed for contract administrators, Accountable and Support on the project, and anyone Responsible, Consulted, Informed or Reporter on this audit. - [Generate an audit PDF](/api-reference/audits/generate-an-audit-pdf): Queues a PDF report of the audit. The report is generated asynchronously; when it is ready the print service calls your `callbackUrl`. Without a `callbackUrl` the request is refused with `404`. `502` means the print service did not accept the request. Allowed for contract administrators, Accountable and Support. - [Search audits](/api-reference/audits/search-audits): Query endpoint (despite the POST method): the filters of `GET /audits` as a JSON body, across one or more projects, **plus** a `tag` filter. Name the projects in `projects`, or pass one as the `database` query parameter. `page` and `size` are query parameters. Results carry only the id unless you name fields in `includeFields`. - [List audit tags](/api-reference/audits/list-audit-tags): Returns the tags in use on audits across the given projects you belong to. - [List people holding a role on audits](/api-reference/audits/list-people-holding-a-role-on-audits): Returns the people who are `responsible` or `informed` on audits in the given projects — the values for a `filterRole` + `roleMailAddress` filter. Projects where you have no role are skipped; when none is left the answer is an empty list. - [Create an audit from a template](/api-reference/audits/create-an-audit-from-a-template): Creating an audit requires copying and resetting template-specific fields, so it is exposed as a dedicated operation rather than a plain document POST. The new audit starts in status `In Progress`, and the template's photos are copied onto it. The body is optional and every field in it is optional. A value that does not pass its check is **dropped without an error**, and the audit is created without it: a `name` over 500 characters, a `responsible` that is not an e-mail address, a `dueDate` that is not a future ISO 8601 date-time. Read the audit back if you need to be sure. Any template that is not archived or deleted can be used, published or not. An archived or deleted template is refused with `400`. Allowed for contract administrators, Accountable and Support. - [List audits in a project](/api-reference/audits/list-audits-in-a-project): The audits in one project: the same request as `GET /api/v2/data/audits`, with the `database` filter taken from the path instead of the query string. One handler serves both, so the filters and the search envelope are identical — including the `status` + `filterRole=RESPONSIBLE` interaction documented there. - [List audit templates](/api-reference/audit-templates/list-audit-templates): `database` is required. The same list is also served by `GET /api/v2/data/projects/{database}/audittemplates`, which takes it from the path; one handler answers both and both are supported indefinitely. - [Search audit templates](/api-reference/audit-templates/search-audit-templates): POST variant of the template list for complex filter sets. Read-only. - [List audit template tags](/api-reference/audit-templates/list-audit-template-tags) - [Create an audit template](/api-reference/audit-templates/create-an-audit-template): Creates an audit template in a project. Only `name` and `groupId` are required. The server fills the rest with a shape the Ed Controls editor opens cleanly: `type`, `project`, `author`, `lastmodifier`, `dates`, `participants`, `versionInfo`, an empty `_attachments`, `auditType: area`, and `isPublished: false` unless you say otherwise. `groupId` is **mandatory** and must name an existing, non-deleted [template group](#tag/Template-Groups) in the same project. The Ed Controls editor refuses to save a template that has no group, so a template created without one would be readable through this API and impossible to edit in the app. `group` — the group's display name — is derived from that group and ignored if you send it. The response body is the stored document. Use its `_id` with the by-id read endpoint and with the update and delete endpoints — **not** the composite `{database}|{couchDbId}` that the list endpoints return. Authorization is evaluated before the request body, so a caller without a qualifying role receives `403` whatever the body contains. A well-formed JSON object that violates a field constraint is rejected with `422` and an `application/problem+json` body whose `detail` names the offending path, for example `questions[0].questions[2].settings.duplicate is a category setting and cannot be set on a question`. A body that is not a JSON object is `400`. Requires the service account to be **Accountable or Support** on the project, or a contract admin. **Two URL shapes.** This endpoint also answers on `POST /api/v2/data/projects/{database}/audittemplates`, which is the canonical shape — the database sits where every project-scoped read already puts it, so you do not have to remember that it moves to the other side of the resource name for a write. One handler answers both paths, so they cannot behave differently, and both are supported indefinitely. See [Create an audit template](/recipes/create-audit-template) for the question types and the traps. - [Delete an audit template](/api-reference/audit-templates/delete-an-audit-template): Archives the template — the platform's soft delete. It drops out of the default lists, stays readable by id, and audits already created from it keep working. Idempotent: archiving an already-archived template writes nothing and still answers `204`, so a retry after a dropped connection is safe. Honours `If-Match` like `PATCH`. An id that resolves to a document of another type is reported as `404`, not mutated. **Two URL shapes.** Also answers on `DELETE /api/v2/data/projects/{database}/audittemplates/{auditTemplateId}`, the canonical project-scoped shape. One handler, both paths, both supported indefinitely. - [Update an audit template](/api-reference/audit-templates/update-an-audit-template): Partially updates an audit template. Send only what changes. Merged: `name`, `groupId`, `questions`, `tags`, `isPublished`, `auditType`, `participants`, `answeredStatusEnabled`, `recurrentAuditInfo`, `_attachments`. **Everything else in the body is ignored**, not rejected — including `_id`, `_rev`, `project`, `author` and `group`. A template cannot be moved to another project, have its authorship rewritten, or have its group name set independently of `groupId`. The one exception is `type`: a value other than `IB.EdBundle.Document.AuditTemplate` is a `422`. Leave out a field to keep it. An explicit `null` on `name`, `tags`, `isPublished`, `auditType`, `participants`, `answeredStatusEnabled` or `_attachments` is a `422` ("cannot be null: omit the field"); only `recurrentAuditInfo` may be set to `null`, which ends the recurrence. `participants` must be an object keyed by role. Publishing is not a separate operation: send `isPublished: true`, which also sets `dates.publishedDate`. Sending a `groupId` moves the template to that group and brings the group's name with it. Sending `groupId: null` or a blank string is a `422` — a template must always belong to a group. A patch that changes nothing writes nothing and does not bump `_rev`. `auditTemplateId` is the bare CouchDB id, not the composite id the list endpoints return. **Two URL shapes.** Also answers on `PATCH /api/v2/data/projects/{database}/audittemplates/{auditTemplateId}`, the canonical project-scoped shape. One handler, both paths, both supported indefinitely. - [List audit templates in a project](/api-reference/audit-templates/list-audit-templates-in-a-project): The templates in one project: the same request as `GET /api/v2/data/audittemplates`, with the `database` filter taken from the path instead of the query string. One handler serves both, so the filters, the projection and the search envelope are identical. - [Create an audit template (project-scoped path)](/api-reference/audit-templates/create-an-audit-template-project-scoped-path): The same endpoint as `POST /api/v2/data/audittemplates/{database}`, on the canonical project-scoped path. One handler answers both: the request body, the response, the `Location` header and every error are identical, and both paths are supported indefinitely. Pick this one for new integrations — it puts the database where the read endpoints put it — and see [`POST /api/v2/data/audittemplates/{database}`](#tag/Audit-Templates) for the required fields, the defaults the server fills in and the `groupId` rule. The recipe is [Create an audit template](/recipes/create-audit-template). - [Get an audit template](/api-reference/audit-templates/get-an-audit-template): Returns the stored template document. Readable by contract administrators, Accountable and Support on the project, and anyone Responsible, Consulted, Informed or Reporter on this template. - [Delete an audit template (project-scoped path)](/api-reference/audit-templates/delete-an-audit-template-project-scoped-path): The same endpoint as `DELETE /api/v2/data/audittemplates/{database}/{auditTemplateId}`, on the canonical project-scoped path. One handler answers both, and both are supported indefinitely. Archives the template — the platform's soft delete. Idempotent, and honours `If-Match`. - [Update an audit template (project-scoped path)](/api-reference/audit-templates/update-an-audit-template-project-scoped-path): The same endpoint as `PATCH /api/v2/data/audittemplates/{database}/{auditTemplateId}`, on the canonical project-scoped path. One handler answers both, and both are supported indefinitely. See the other path for what is merged, what is ignored, and how `If-Match` behaves. - [Search template groups](/api-reference/template-groups/search-template-groups): Query endpoint: the filters of `GET /audits/templategroups` as a JSON body, across the projects in `projects` (or one `database` query parameter). `page` and `size` are query parameters. - [List template groups](/api-reference/template-groups/list-template-groups): `database` is required. The same list is also served by `GET /api/v2/data/projects/{database}/audits/templategroups`, which takes it from the path; one handler answers both and both are supported indefinitely. - [Create a template group](/api-reference/template-groups/create-a-template-group): Creates a template group in a project. Every audit template must belong to a group, so this is the first call to make in a project that has none — without it the mandatory `groupId` on [Create an audit template](/recipes/create-audit-template) cannot be satisfied. Only `name` is required. The server sets `type`, `project`, `content` (author and lastmodifier, from the token's user), `dates`, `timeline` and `archived`, and ignores those fields if you send them. `_id` and `couchDbId` in the response hold the same value, so either works as a template's `groupId`. The group is usable **immediately** — it takes a few seconds to appear in `GET /api/v2/data/audits/templategroups`, which reads a search index, but a template can point at it straight away. **A duplicate name is refused with `409`.** The name is compared whole, so "Handover" does not collide with "Handover checks", and after trimming. A name freed by deleting a group can be reused. The check reads the same search index the group list reads, which lags a write by a few seconds — so two creates of the same name fired back-to-back can both succeed. De-duplicate your own input if you are importing groups in bulk. There is **no rename endpoint**. A group's name is copied onto every template in it, so a rename has to update all of them; the Ed Controls app does that, and the API does not offer a half-version of it. Requires the service account to be **Accountable or Support** on the project, or a contract admin. **Two URL shapes.** Also answers on `POST /api/v2/data/projects/{database}/audits/templategroups`, the canonical project-scoped shape. One handler, both paths, both supported indefinitely. - [Delete template groups](/api-reference/template-groups/delete-template-groups): Soft-deletes the given template groups (recoverable by Ed Controls support). Also answers on `PUT /api/v2/data/projects/{database}/audits/templategroups/softDelete`, the canonical project-scoped shape. One handler, both paths, both supported indefinitely. - [List template groups in a project](/api-reference/template-groups/list-template-groups-in-a-project): The template groups in one project: the same request as `GET /api/v2/data/audits/templategroups`, with the `database` filter taken from the path instead of the query string. One handler serves both. - [Create a template group (project-scoped path)](/api-reference/template-groups/create-a-template-group-project-scoped-path): The same endpoint as `POST /api/v2/data/audits/templategroups/{database}`, on the canonical project-scoped path. One handler answers both, and both are supported indefinitely. See the other path for the duplicate-name rule, the index lag, and why there is no rename. - [Delete template groups (project-scoped path)](/api-reference/template-groups/delete-template-groups-project-scoped-path): The same endpoint as `PUT /api/v2/data/audits/templategroups/{database}/softDelete`, on the canonical project-scoped path. One handler answers both, and both are supported indefinitely. Soft-deletes the given template groups (recoverable by Ed Controls support). - [List maps](/api-reference/maps/list-maps): Lists the drawings of one project. `database` is required (`400` without it). - [Search maps](/api-reference/maps/search-maps): Query endpoint: the filters of `GET /maps` as a JSON body, across the projects in `projects` (or one `database` query parameter). `page` and `size` are query parameters. - [Get a map](/api-reference/maps/get-a-map): Allowed for contract administrators, Accountable and Support. - [Upload a map](/api-reference/maps/upload-a-map): Creates a map from a PDF. The server downloads the PDF from `pdfURL` and then tiles it asynchronously; the map appears in `GET /maps` once processed. **Which URLs are fetched**: any public `https` URL that works without signing in. No headers are sent, credentials in the URL are refused, at most 3 redirects are followed, and private network addresses are refused. The name of the downloaded file must end in `.pdf`. **Failures are not reported.** The answer is `200` `"success"` as soon as the request is accepted; a URL that is refused, cannot be fetched or is not a PDF produces no map and no error. Check that the map appears. Allowed for contract administrators, Accountable and Support. - [Set map tags](/api-reference/maps/set-map-tags): Replaces the map's tags with the list you send. Tags longer than 100 characters are dropped silently. Allowed for contract administrators, Accountable and Support. - [Add tags to several maps](/api-reference/maps/add-tags-to-several-maps): Adds the tags to every listed map, in the background: the answer `"scheduled"` comes before the work is done. A map holds at most 15 tags; tags beyond that are not added. - [List the reporters of a map](/api-reference/maps/list-the-reporters-of-a-map): The e-mail addresses that have Reporter access to this drawing. Allowed for contract administrators, Accountable and Support. - [Add a reporter to a map](/api-reference/maps/add-a-reporter-to-a-map): Gives this person Reporter access to the drawing: they can then create tickets on it (see [Roles & permissions](/domain-model/roles)). The address is stored trimmed and in lower case. Adding someone who already reports on the drawing changes nothing and answers `UNCHANGED`, so the call is safe to repeat. An archived drawing is allowed; a deleted one is a `404`. Reporter access is per drawing: a map group has no reporters of its own. To give someone access to a whole map group, call this for each drawing in it (`GET /maps?database=…&groupid=…`). A drawing added to the group later needs its own call. Allowed for contract administrators, Accountable and Support. - [Remove a reporter from a map](/api-reference/maps/remove-a-reporter-from-a-map): Takes this person's Reporter access to the drawing away. Removing someone who is not a reporter of the drawing answers `UNCHANGED`. The tickets they already created stay as they are. Allowed for contract administrators, Accountable and Support. - [Delete maps](/api-reference/maps/delete-maps): Soft-deletes the given maps. - [List map tags](/api-reference/maps/list-map-tags) - [List the maps made from a file](/api-reference/maps/list-the-maps-made-from-a-file): A file in the library can be turned into one map per page. This lists the maps made from one file. Allowed for contract administrators, Accountable and Support. - [List map groups](/api-reference/map-groups/list-map-groups): Lists the map groups of a project. (The path segment `drawingGroups` is a legacy name for map groups.) - [Create a map group](/api-reference/map-groups/create-a-map-group): Only `name` is needed. The server fills in the author, the dates and the project. If a group with this name already exists nothing is created and the answer is `200` with an **empty body**. A name is compared after trimming and removing markup. Allowed for contract administrators, Accountable and Support. - [Rename a map group](/api-reference/map-groups/rename-a-map-group): Renames the group named `oldName` and moves its maps along. The group is found by its current name, not by id. When no group has `oldName` but one already has `newName`, nothing changes and the answer is still `200`: renaming a file group (`PUT /fileGroup/{database}/{id}`) already renames its map group. When neither name is found the answer is `400`. Allowed for contract administrators and the Accountable (not Support). - [List files](/api-reference/files/list-files) - [Create a file](/api-reference/files/create-a-file): Registers a file in the project. The server downloads the binary from `fileUrl`. **Which URLs are fetched**: any public `https` URL that works without signing in, such as a signed link from your document system or cloud storage. No headers are sent, credentials in the URL are refused, at most 3 redirects are followed, and private network addresses are refused. The downloaded content must be an allowed type: PDF, JPEG, PNG, SVG, TIFF, WebP, HEIC/HEIF, Word, Excel, PowerPoint, MP4, MOV, WMV, plain text or STEP/IFC. **Processing is asynchronous and failures are not reported.** The answer `{"code": 200, "message": "OK"}` only means the request was accepted: a refused or unreachable URL, or a content type that is not allowed, produces no file and no error. The answer also carries no id. Find the file afterwards by listing with `searchByName`. `fileName` is required (at most 250 characters, as is `uploadedName`). When the group already holds a file with this `fileName`, the upload becomes a **new version of that file**; while that file is still being processed the request is refused with `400` "Already initiated". Allowed for contract administrators, Accountable and Support. - [Get file metadata](/api-reference/files/get-file-metadata): Returns the file document. An unknown id may answer `500` instead of `404`. - [Update a file](/api-reference/files/update-a-file): Updates the file, and adds a new version when `fileUrl` is supplied. The body is the file document; `fileName` is required in it (at most 250 characters), so send the document back with your changes rather than only the changed fields. Set `versionId` to an id from `versions` to make that version the current one again. **Which URLs are fetched**: any public `https` URL that works without signing in, such as a signed link from your document system or cloud storage. No headers are sent, credentials in the URL are refused, at most 3 redirects are followed, and private network addresses are refused. The downloaded content must be an allowed type: PDF, JPEG, PNG, SVG, TIFF, WebP, HEIC/HEIF, Word, Excel, PowerPoint, MP4, MOV, WMV, plain text or STEP/IFC. **Processing is asynchronous and failures are not reported.** The answer `{"code": 200, "message": "OK"}` only means the request was accepted: a refused or unreachable URL, or a content type that is not allowed, produces no file and no error. The answer also carries no id. Find the file afterwards by listing with `searchByName`. Allowed for contract administrators, Accountable and Support. - [Get a download link](/api-reference/files/get-a-download-link): Returns a short-lived signed URL for downloading a specific file version directly from storage. Allowed for contract administrators, Accountable and Support. - [Download a file](/api-reference/files/download-a-file): Streams one version of the file through the API, as an attachment. Use this when a signed link is not convenient. Allowed for contract administrators, Accountable and Support. - [Search files](/api-reference/files/search-files): Query endpoint: the filters of `GET /file/{database}` as a JSON body. `database` is a **required query parameter**, not a body field; `page` and `size` are query parameters too. - [Delete files](/api-reference/files/delete-files): Soft-deletes the given files. - [Archive or unarchive files](/api-reference/files/archive-or-unarchive-files) - [Add tags to files](/api-reference/files/add-tags-to-files): Adds the tags in the background; the answer `"scheduled"` comes before the work is done. - [List file tags](/api-reference/files/list-file-tags) - [List file groups](/api-reference/file-groups/list-file-groups) - [Create a file group](/api-reference/file-groups/create-a-file-group): Only `name` is needed. The server fills in the author, the dates and the project. Allowed for contract administrators, Accountable and Support. - [Get a file group](/api-reference/file-groups/get-a-file-group) - [Update a file group](/api-reference/file-groups/update-a-file-group): Send the fields you change; `{"name": "…"}` is enough to rename. The name is required, is trimmed, and is at most 50 characters; a missing or blank name is a `400`. Whatever you leave out is kept from the stored group, including its author, creation date and archived state. A deleted group answers `404`. The answer is the group with its new `_rev`. A new name also renames the map group with the old name, and every map in it, so the drawings show under the new group name. One call is enough: you do not need `PUT /mapGroup/{database}/updateName` as well. A file group without a map group of that name is renamed on its own. Allowed for contract administrators and the Accountable. - [Delete file groups](/api-reference/file-groups/delete-file-groups): Soft-deletes the given file groups. - [Rename a file group](/api-reference/file-groups/rename-a-file-group): Renames the group named `oldName`. The group is found by its current name, not by id; when no group has that name the answer is `200` with an empty body. Allowed for contract administrators and the Accountable (not Support). - [Search file groups](/api-reference/file-groups/search-file-groups): Query endpoint: the filters of `GET /fileGroup/{database}` as a JSON body, across the projects in `projects`. `page` and `size` are query parameters. - [Search the library (files and drawings together)](/api-reference/library/search-the-library-files-and-drawings-together): One list of a project's **library**: its files and its drawings (maps) together, as the Library screen of the web app shows them. Use it when you want both kinds in one page, with one sort and one set of counts. For one kind only, `POST /file/search` and `POST /maps/search` work the same way. `database` is a **required query parameter**, not a body field; `page` and `size` are query parameters too. All body fields are optional, so `{}` lists the whole active library, sorted by name. - `type`: `file` or `map` limits the list to one kind; leave it out for both. - A file that was turned into a drawing is listed once, as the drawing. - `groupid` filters on the **file group**. Drawings have no file group, so with `groupid` only files come back. - `aggregate` takes a comma-separated list of fields, such as `fileGroupId` or `tags`, and adds a count per value to `aggregations`. - `includeFields` limits each result to the fields you name, which keeps large libraries fast (for example `["couchDbId", "name"]`). - `sortby` is `name` (the default), `creationDate` or `lastModifiedDate`; send `sortOrder` (`ASC` or `DESC`) with it. Who sees what: a contract administrator, or an Accountable or Support user of the project, gets the whole library. A Responsible user or a Reporter gets only the drawings whose ids they send in `mapIds`; without `mapIds` the answer is `200` with an empty body. Anyone else gets `403`. To download a file from a result, use `GET /file/{database}/{id}/{versionId}/{fileName}/generateSignedLink`.