PATCH
Update an audit template (project-scoped path)

Authorizations

Authorization
string
header
required

Obtain a token via POST /api/v1/oauth/token (password grant) and send it as Authorization: Bearer <token>.

Headers

If-Match
string

The _rev you last read; a mismatch is refused with 409.

Path Parameters

database
string
required

Project identifier (each project has its own database). Obtain it from GET /api/v2/data/projects.

auditTemplateId
string
required

The template's bare CouchDB id.

Body

application/json

Only the merged fields are listed. Anything else in the body is ignored rather than rejected (except a wrong type, which is a 422). Omit a field to keep it: null is refused on every field except recurrentAuditInfo.

name
string
groupId
string

Moves the template to another group, and brings that group's name with it. null or blank is a 422: a template must always belong to a group.

isPublished
boolean

Publishing is a field change, not a separate call. Setting this true also sets dates.publishedDate.

auditType
string
tags
string[]
answeredStatusEnabled
boolean
participants
object

The template's default participants, an object keyed by role (e.g. informed).

recurrentAuditInfo
object | null

Recurrence settings. null makes the template no longer recurrent.

questions
object[]
_attachments
object

Response

The stored audit template document, with the new _rev.

_id
string
_rev
string
name
string
groupId
string

The template group, as the group document's bare CouchDB id. Mandatory on create, and a template can never be left ungrouped.

group
string

The group's display name. Derived from groupId and ignored if you send it, so the two cannot disagree — the app reads this field rather than looking the group up.

project
string

The project database.

isPublished
boolean

Whether the template is released for use. Unpublished templates can still be used to create audits; only archived or deleted ones are refused.

archived
string

Set when the template is archived. Absent means active.

auditType
string
answeredStatusEnabled
boolean
tags
string[]
dates
object
author
object
lastmodifier
object
versionInfo
object

The app's version history for this template.

_attachments
object

CouchDB inline attachments, keyed by file name — where images used by questions live. Always present, even when empty.

questions
object[]

The question tree, exactly two levels deep: categories, each holding questions.