Skip to main content
POST
Edit a draft's declarations.

Authorizations

Authorization
string
header
required

An API key issued with object_model scopes: Authorization: Bearer sk_…. The scopes: object_model:records:read, object_model:records:write, object_model:facts:read, object_model:facts:write, object_model:model:read, object_model:model:configure, object_model:actions:run, object_model:changes:read. An operation's security lists the scopes it needs; several entries mean any one of them will do. A person field (ref(user), ref_list(user)) holds a user id: look people up by email or id with GET /v1/users, outside this API, with a key that also has users:read.

Scopes

object_model:model:configure

Headers

Idempotency-Key
string
required

Required on every write: one key per logical write, sent again unchanged on every retry. A finished request replays its answer for 24 hours; the same key on a different request is refused (409 idempotency_key_reused). A dry run (dry_run: true) needs none, and is not recorded under one it carries.

Required string length: 1 - 255
Pattern: ^[\x20-\x7E]+$

Path Parameters

draft_id
string
required

Body

application/json
based_on_version

The live model version the edited text was read at. A declaration the draft does not hold yet starts from its text at that version, so a change published since conflicts at publish instead of being lost. Leave it out to start from the live text.

draft_id
string

Named by the path: leave it out, or send the same id.

edits
object[]

Declaration edits, as on a configure, plus revert and rebase. Each upsert must parse alone. An edit that leaves the draft invalid is still saved, with its problems reported on the draft; publishing refuses until they are fixed.

expected_revision

The draft's revision this edit was made against: if anyone edited it since, this edit is refused rather than written over theirs. Leave it out to write regardless.

Response

Answered.

applied
boolean
conflicts
object[]
draft
object
drafts
object[]
migration_plan_json
string
plan_confirmation_required
boolean
problems
string[]
version
warnings
string[]