Skip to main content
POST
Run one declared action. dry_run previews it and writes nothing; a decided move answers 202.

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:actions:run

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

action_id
string
required

Body

application/json
action_id
string

The action to run, from the schema's actions. On POST /actions/{action_id}/run the path names it: leave it out, or send the same id.

approving_decision_id
string

Set by the app when a decider carries out a decision they approved. Leave it out.

citations_json
string

What the run rests on, as a JSON string: [{"item": …, "attachment": …, "page": …, "quote": …}] (attachment and page optional), such as an email and the words it quotes. Shown to the deciders on the decision the run raises, and added to one already waiting for the same change. A run that raises no decision ignores it.

confirm_lockout
boolean

Put a record behind a wall you are outside of anyway, losing sight of it, where the wall lets you push records in. Without it, such a run is refused would_lose_access, and its lockout names the wall and counts what you would lose (records, and of those own). To go ahead, send the run again with confirm_lockout: true under a new Idempotency-Key: the refusal is kept under the first one.

dry_run
boolean

Check the run and write nothing: params, the action's requires and access are checked as for a real run. The answer's status is previewed, or says why the run would be refused, with diagnostics. For a run that would put a record behind a wall you are outside of, it depends on the wall. One that lets you push records in passes the dry run, and the live run asks for confirm_lockout. One that refuses writers from outside (from outside: refuse) refuses the dry run too (walled). One that asks the people inside instead passes the dry run, and the live run writes nothing and asks them (or, for a record the run would create, is refused walled).

field_writes
object

Per field the run writes, keyed by field name: what the value rests on and when it may land. Each write is weighed against the evidence the field already holds, and the answer's field_outcomes says what became of it.

instance_id
string

The run's id. On POST /actions/{action_id}/run it is made from the Idempotency-Key header: leave it out, except to resume a run that ended partial (send the instance_id its answer carried, with resume). On a batch item it is required, unique within the batch, and a re-sent item naming it answers that run again.

note
string

Where the values came from, in your words: a file's name, or what a person said. Stored as the note of every fact the run records.

params
object

The action's params by name, each in the JSON its param_type takes: the same words and shapes as a field's storage (see a record create's values). A list param takes an array of objects with the param's fields; ref(quantity) and ref(definition) take an id; a creatable param takes a record id, or {"new": {<field>: <value>, …}} to create the record as the action runs. An optional param you leave out changes nothing: a field the action sets from it keeps its value.

preview_definitions
string[]

With dry_run: figures to compute as if the run had landed, by id from the schema's definitions. Answered in previews, one per figure for the subject and for each record the run would create.

record_edit_baselines
object[]

For an action that only changes fields: what each record's fields held when you read them, one entry per record. Records are saved one at a time, each only while every field the run changes on it still holds its baseline. A changed value found before any record is saved refuses the run (stale_record_value) and nothing is written. One found after a record was saved ends the run partial (422, with what it wrote under result), and the records saved before it keep their changes: read the records again before another run, which would otherwise apply those changes a second time. An action that also creates records is refused with baselines.

resume
boolean

Continue the run instance_id names, which ended partial, from the step that failed. Send it under a new Idempotency-Key, with the same action, subject and params. Without it, a request naming a partial run answers its partial result again and writes nothing.

subject_id
string

The record the action runs on, of the action's subject_type_id. Leave it out for an action that creates its own subject.

world_id
string

The scenario the run's facts land in, from GET /worlds. Leave it out to record them outside any scenario.

Response

Answered.

created
object[]

Records the run created.

decision_id
string

With proposed: the decision the change waits for. Follow it with GET /decisions/{decision_id}.

diagnostics
object[]

What a dry run or a refusal found.

fact_ids
string[]

Facts the run recorded.

field_outcomes
object[]

What became of each field the request sent field_writes for.

instance_id
string

The run's id. To continue a partial run, send it as instance_id with resume, under a new Idempotency-Key.

invalidated_definitions
string[]

Figures the run's writes change, by id: read them again for their new values.

lockout
object

With a would_lose_access refusal: the wall, and what you would lose behind it. Send the run again with confirm_lockout to go ahead.

previews
object[]

With dry_run and preview_definitions: the figures as if the run had landed. A record the run would create is named draft:<binding>:<i> in their subject_id.

record_edit_baselines_checked

How many fields' edit baselines were checked.

refusal
string

Why the run was refused, or who decides a proposed one, in words for a person.

status
string

What happened: applied; replayed (a re-sent run answered again, nothing new written); resumed (a partial run finished); previewed (a dry run); proposed (answered 202: nothing is written until the decision decision_id names is approved); refused (nothing written; refusal and diagnostics say why); or partial (a step failed after earlier ones landed; created and fact_ids say what did). refused and partial are answered 422, with this answer under result; the 422's code is partial, or the refusal's code, such as would_lose_access, walled or stale_record_value.