Skip to content

Make changes to documents

PATCH
/v1/documents/{slug}/versions/{version}/editor
curl --request PATCH \
--url https://api.adversarial.com/api/v1/documents/cybergov/versions/2026.9.1/editor \
--header 'Content-Type: application/json' \
--data '[ { "node_type": "selected_option", "value": "example", "node_id": "example" } ]'

Accepts selected_option changes for switches and selectors, toggle_state changes for toggles, control_value changes for document-level controls, and table_rows snapshots for editable tables. A switch bound to a control takes no selection of its own: write the control with control_value and every switch and conditional block keyed on it follows. A selected_option change targeting a bound or locked switch is rejected.

Changes target the version named in the path, validated against that version’s template.

slug
required
string

The document slug

Example
cybergov
version
required
string

The document version

Example
2026.9.1
Media typeapplication/json
Array

Defines some form of selection/edit that a user has made for a document item.

object
One of:

Contains the id of the selected option

object
node_type
required
string
Allowed values: selected_option
value
required

Contains the id of the selected option

string
node_id
required

The id of the document item that was changed. this is the PK of the doc_item_reference table.

string

Documents updated

Media typeapplication/json
object
created
required

Who performed an action, and when.

object
by
One of:
null
date
required
string format: date-time
id
required
integer format: int32
proposal
required
integer format: int32
updated_date
string | null format: date-time
Examplegenerated
{
"created": {
"by": "example",
"date": "2026-04-15T12:00:00Z"
},
"id": 1,
"proposal": 1,
"updated_date": "2026-04-15T12:00:00Z"
}

The version is archived or the changes are invalid

The organization cannot see this document version