PUT /projects/{database}/audits/{auditId}.
1
Find the template
_id from results. Any template that is not
archived or deleted can be instantiated; filtering on isPublished=true
keeps to the ones your organisation has released.2
Create the audit
In Progress, and the responsible user is
notified in the app. The answer is 200 with
{ "ok": true, "id": "<new audit id>", "rev": "…" }: keep id.Every body field is optional, and a value that fails its check is
dropped silently rather than refused: a responsible that is not an
e-mail address, a dueDate that is not in the future, a name over 500
characters. The audit is then created without it. Read the audit back
(next step) to confirm what was stored.3
Track progress
status and dates.completionDate. A finished audit has status
completed — or Completed, which older audits still carry — so match both
spellings, or test dates.completionDate instead. The full status vocabulary
for audits and tickets is in
Detecting completion.Failed checks inside the audit appear as tickets linked from questions —
you can pick those up via the tickets endpoints
(auditId filter).Fill in an audit through the API
PUT /api/v2/data/projects/{database}/audits/{auditId} replaces the audit
document. Read it, change the answers in questions (and, when done, set
status to completed and dates.completionDate), and send the whole
document back with its _rev:
- Fields you leave out are removed — except the photos: when the body has no
_attachments/attachmentskey the stored ones are kept. - A stale
_revis a409: read the audit again and reapply your change. - A field of the wrong type (for example
mapsthat is not an array, or a question without asettingsobject) is a422whosedetailnames it.
POST …/audits/{auditId}/print with a
callbackUrl; the print service calls it when the report is ready.
