Skip to main content
POST
Change the model. dry_run checks it; If-Match names the version it was read at, and a version that is no longer current is refused with 412 and the current version.

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

If-Match
string

The version the change was written against. If it is no longer current, the change is refused (412) and nothing is applied. Send it as the If-Match header (If-Match: 42, quotes allowed) or as expected_version in the body; the header wins when both are sent.

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]+$

Body

application/json
confirm_plan_hash
string

When a change to claim types needs confirming, its answer sets plan_confirmation_required and writes nothing, with the plan in migration_plan_json. Send the plan's plan_hash here to apply it; a hash for a plan that has since changed applies nothing.

dry_run
boolean

Check the change and every gate, and write nothing. The answer says whether it would apply, with any warnings.

edits
object[]

Changes to single declarations, applied in order and published as one version: what the app's settings forms send. Send this or source, never both.

expected_version

The version the change was written against. If it is no longer current, the change is refused (412) and nothing is applied. Send it as the If-Match header (If-Match: 42, quotes allowed) or as expected_version in the body; the header wins when both are sent.

migration_spec_json
string

Only for a change to claim types (what Institutional Knowledge extracts): renames and splits the text cannot express, as MigrationSpec JSON. Leave it out otherwise.

note
string

Why the model changed, stored with the version it makes.

source
string

The whole model's text, replacing the current text: for a tool that edits the model as one document. GET /model answers the current text. Send this or edits, never both.

version_must_match
boolean

Always set by this API: a version named by If-Match that is no longer current is refused (412). Leave it out.

Response

Answered.

applied
boolean

Whether the change was made. false on a dry run, and when it waits for a person (pending_decision_id) or a confirmation (plan_confirmation_required).

migration_plan_json
string

When the change moves claim types: the plan for the claims already held, as JSON, with the plan_hash to confirm it by.

pending_decision_id
string

The change waits for a person's approval (answered 202): follow it with GET /decisions/{decision_id}.

plan_confirmation_required
boolean

Nothing was written: send the change again with confirm_plan_hash set to the plan's plan_hash.

version

The ontology's version after the change: send it as If-Match on the next one.

warnings
string[]

Data the change leaves outside the ontology without refusing it, such as a newly required field some records lack.