An audit template is the checklist every audit in a project is built from. Until recently a template could only be authored in the Ed Controls editor; you can now create, change and archive one through the API, which is what makes it possible to generate checklists from your own system — a standards library, a BIM model, a client’s specification.

The smallest possible create

Only name and groupId are required:
201 with the stored document and a Location header. Keep the _id — it is what the update, delete and createAudit endpoints take.
The same endpoint also answers on POST /api/v2/data/projects/{database}/audittemplates — the project-scoped shape, which is the one to prefer in new code because it puts the project where the read endpoints put it. One handler serves both URLs, so the request and the response are identical either way, and both are supported indefinitely. Every call in this recipe can be written either way; see Two URL shapes for audits and audit templates.

You need a template group first

groupId is mandatory, and must name an existing template group in the same project. Find one with:
Take couchDbId, not id — id is the composite {database}|{couchDbId} that the list endpoints return, and the write endpoints do not accept it. If the project has no groups yet, create one — only name is required:
_id and couchDbId hold the same value, so either works as a template’s groupId. The group is usable immediately — you do not have to wait for it to appear in the group list above, which reads a search index and lags a few seconds behind the write.
A groupId that names nothing is a 422, and that is deliberate: the Ed Controls editor refuses to save a template with 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 the group you point at and ignored if you send it, so the two can never disagree.
A group name has to be unused. Creating a second group with a name a live group already has is a 409. The name is compared whole — “Handover” does not collide with “Handover checks” — and after trimming. A name freed by deleting a group can be reused.One caveat: the check reads the same search index the group list reads, and that lags a write by a few seconds. Two creates of the same name fired back-to-back can therefore both succeed. If you are importing groups in bulk, de-duplicate your own input rather than relying on the 409.There is no endpoint to rename a group. A group’s name is copied onto every template in it, so a rename has to update all of them — the app does that for you, and the API does not offer a half-version of it. Renaming stays an in-app action for now.

What the server decides for you

The question tree

The tree is exactly two levels deep. questions holds categories, and each category holds questions. There is no nesting beyond that.
A category needs a non-blank categoryName and at least one question. A bare question at the top level — where a category belongs — is rejected rather than quietly absorbed.

The ten question types

settings.answertype takes one of ten values. The editor’s dropdown shows eleven entries because multiplechoice splits in two through settings.choice. An unrecognised answertype is refused with 422. It is not coerced into something else, so a typo fails loudly rather than producing a question of the wrong kind.

Multiple choice

Options live in settings.richOptions, each with an id that settings.answer refers to:
  • choice must be single or multiple, and is required for this type.
  • Option ids must be unique within the question. A repeat silently merges two options into one, so it is rejected.
  • Every option needs text, an image, or both. An option with neither is not selectable and is refused.
  • Older templates store option text directly in settings.answer with no richOptions. That still works and is still accepted — but use richOptions for anything new.

Yes/No/NA labels and colours

yesnona questions can carry per-template wording:
Omit styling entirely and the app uses its defaults. Include it and all three keys must be present with non-blank labels — the app reads all three, and a missing one renders an unlabelled button. The stored answer is always the platform’s own token (YES, NO, N/A), never your label. Custom labels change what the auditor reads, not what you read back.

Images

Two different features, two different fields. Both keep the picture on the document itself, as a CouchDB inline attachment — neither goes through Filestack or the attachment service. Attach the bytes once, base64-encoded, under _attachments:
Then refer to them by file name:
The image appears in the question’s own attachment strip, below the text.
Keep template images small. They are stored inline on the document, so every read of the template carries them, and the app fetches the whole thing to open the editor. Thumbnails, not photographs.

Static text

A statictext block is an instruction to the auditor rather than a question. Its own question field carries the literal string Ignored, and the body goes in answer[0]:
It needs text, an attachment, or both — an empty block is refused.

Publish it

Only a published template can be used to create audits. Either publish at creation time with isPublished: true, or build the template first and publish when it is ready:
Publishing is a field change, not a separate call, and it sets dates.publishedDate for you. Then create audits from it — see Create an audit from a template.

Update

PATCH merges a whitelist: name, groupId, questions, tags, isPublished, auditType, participants, answeredStatusEnabled, recurrentAuditInfo, _attachments.
Fields outside the whitelist are silently ignored, not rejected — including _id, _rev, type, project, author and group. A PATCH carrying them returns 200 with a template that did not change in the way you asked.questions is replaced wholesale, not merged question by question. To change one question, read the template, edit the tree, and send the whole thing back.
A patch that changes nothing writes nothing and does not bump _rev. Changing an existing template affects future audits only. Audits already created from it keep the questions they were built with.

Concurrency

Someone editing the template in the Ed Controls app saves it whole, so a change you make from an older copy can overwrite theirs. Pass the _rev you last read as If-Match to prevent that:
A stale _rev fails with 409 and writes nothing — re-read, re-apply, retry. Omit the header and the last write wins.

Archive

DELETE archives the template — the platform’s soft delete:
204, idempotent, and it honours If-Match. The template drops out of the default lists, stays readable by id, and audits already created from it keep working.

Errors

RFC 9457 application/problem+json, whose detail names the offending path:
Authorization is evaluated before the body, so a 403 says nothing about whether your JSON was valid.

Quirks worth knowing

These all cost someone time at least once.
settings.duplicate — “Is Duplicatable?” in the Excel importer — controls whether an auditor may repeat a category. Setting it on a question is rejected with 422.If you are porting checklists from the audit-template spreadsheet, note it uses one column for both category and question rows — so a value that sat on a question row there has nowhere to go here.
Every question carries answer, and on a template it is normally []. Sending "" or null is rejected.Worth watching if you build the tree by transforming your own data — an empty value that serialises to "" rather than [] is the easy mistake, and the app cannot read a template where it happens.
The list endpoints return id as the composite {database}|{couchDbId}. Every by-id endpoint — read, update, delete, createAudit — takes the bare couchDbId.Feeding an endpoint the id its own list just handed you does not work. Use couchDbId, or split the composite on |.
Stored documents carry "choice": null on free-text questions, along with "weightingfactor": null. Both are accepted. Only a real choice value on a question that is not multiplechoice is refused, because that means the type is wrong.
The list and search endpoints read a search index, which the write reaches a few seconds later. POST returns 201 and the template is readable by id at once, but it will not appear in GET /audittemplates immediately. Poll rather than asserting straight after the write.
area and object are the values the app offers, and area is the default. point also appears in stored data. The API deliberately does not enforce a list, because no two parts of the platform agree on one — send area unless you have a reason not to.

Who may do what

Note that read access is wider than write access: a Consulted, Informed, Responsible or Reporter participant can see templates through the list and by-id endpoints, and cannot change them.