How it works
- Your server sends
POST /actionswith its Nexio-issued application credential, anIdempotency-Keyheader, the person the commands are for (actor_principal) and 1 to 20 commands. The organization’s key cannot append commands (see Scope-bounded writes). - When a command addresses a record of the system of record, Nexio resolves that person’s authority as it does for a read (see Authority and scope), and each such command must address a record the person may open. A note on a Catalog entity needs no system-of-record authority.
- Nexio applies the whole batch in one transaction. If any command fails, none is recorded.
- Each command gets a sequence number (
seq) in the organization’s ledger. The 202 response returns the settled operation inline, with each command’sseqandaction_seq, the ledger’s latest sequence number. - You read the current state back from
GET /records/notes,GET /records/tasksorGET /records/workflows, or follow the ledger itself fromGET /actions. A note on a Catalog entity appears only in the ledger read (/actions).
Commands
The command set is fixed in code: 14 commands, and no organization adds its own. Ten of them are the commands you send:
The other four are not yours to send:
source_activity.create and renewal_decision.set are refused with 403 CAPABILITY_DENIED, reason OVERLAY_READ_ONLY (What is refused), and book_edit_intent.transition and book_edit_intent.cancel are internal, so a batch that names one answers 400 INVALID_ARGUMENT, reason ACTION_SCHEMA_UNKNOWN.
Every command carries command, schema_rev (always 1 today), exactly one target and a payload. A target is an account_id ({instance}:customer:{id}) or a policy_id ({instance}:policy_term:{id}), the instance keys the rows of Records collections carry, or, for notes only, a Catalog entity (catalog_entity_type plus catalog_id).
Payloads are validated strictly: an unknown field is refused. A command’s optional id must be a UUID. When you omit it, Nexio generates one, and for note.create and task.create that id becomes the note or task id.
status.set writes one registered workflow field on one record. The fields, the record kind each applies to, and their allowed values are fixed in code. An unknown field, or a value the field does not allow, answers 400 INVALID_ARGUMENT, reason ACTION_PAYLOAD_INVALID.
Idempotency and safe retries
- Every request needs an
Idempotency-Keyheader, at most 200 characters. Without it the request answers 400INVALID_ARGUMENT, reasonIDEMPOTENCY_KEY_REQUIRED. - Each command may also carry its own
idempotency_key, a UUID unique across your organization’s ledger. When you omit it, Nexio derives one from the request’sIdempotency-Key, the actor and the command’s position in the batch, so a retry of the same request derives the same keys. - Resending the same request with the same key and body records nothing new. The response returns each command’s original
command_idandseqwith"idempotent_replay": true, and the status is still 202. - Reusing an
Idempotency-Keywith a different body answers 422IDEMPOTENCY_KEY_PAYLOAD_MISMATCH. Reusing a command’sidempotency_keyfor a different command answers 400INVALID_ARGUMENT, reasonACTION_PAYLOAD_INVALID. - So a timed-out request is safe to resend unchanged. Generate new keys only for new intent.
basis names the ledger position the person was looking at (seq, from a previous action_seq). A stale basis does not cause a refusal. When another command changed the same note, task or status after that position, the projection marks the row applied_over_concurrent: true so your application can tell the person.
Scope-bounded writes
actor_principalis the person the commands are for.actor_typeisproducer(a person) oragent(an AI agent acting for that person).- The credential must prove the person in
actor_principal. The organization’s key proves no person, so a ledger append on it answers 403CAPABILITY_DENIED, reasonKEY_IDENTITY_REFUSED, whateveractor_principalnames and whether or not you sendNexio-Act-As. A scoped key proves no person either and answers 403CAPABILITY_DENIED. Use your Nexio-issued application credential. - If you send
Nexio-Act-As, it must name the same person asactor_principal, or the request answers 400INVALID_ARGUMENT. If you omit it, Nexio resolves authority foractor_principal. This applies only to a credential that proves that person, never to the organization’s key. - A command addressing a record outside that person’s read scope answers 404
NOT_VISIBLE_OR_ABSENT, and the whole batch is refused. A record the person cannot read and a record that does not exist get the same answer.
Example: record a note and a task
NEXIO_API_KEY in these examples is your Nexio-issued application credential, not the organization’s key.
202 Accepted
status is always succeeded; a refusal is a problem instead. The operation is not kept: it carries no id and the response no Location. Sending the same request again returns the same command_id and seq values, each with "idempotent_replay": true.
Read it back
Deleted notes and tasks are hidden from the projections. A person whose scope is
Self sees only ledger rows they authored on /actions; an All or Platform scope sees the whole ledger.
data, page, source, unreachable, warnings, request_id); each row carries source, id, title, status, priority, origin and data, plus the due date, assignee and account when known. The full row schema is on List tasks.
Records actions
A Records action is a named command on one of your families that Nexio runs as one unit: for example, completing a task and recording why, in one step. Where a ledger command changes one thing, an action can change several fields, records and statuses together, and either all of it is kept or none of it is.Records actions are available only to organizations where Nexio has turned them on. Until then, a body that names an action is answered exactly as a ledger request with an unknown field.
Which actions you can run
Your organization’s configuration names the actions each family offers.GET /records lists them on each family the person may use, with the JSON Schema of each action’s input. An action the person may not run is not listed, and an action your organization does not offer answers 404 NOT_VISIBLE_OR_ABSENT, reason ACTION_UNKNOWN.
Run an action
SendPOST /actions with an Idempotency-Key header and a body that names the action and its input:
key, the record it addressed (subject) and the action’s output.
- Who it runs as. The action runs as the person the request acts for (
Nexio-Act-As), with that person’s access to the family, to the action and to each record it changes. A record the person cannot reach and one that does not exist get the same answer: 404NOT_VISIBLE_OR_ABSENT, reasonRECORD_NOT_FOUND. - All or nothing. Every change an action makes is kept together, or none is.
- Safe retries. The
Idempotency-Keyis required (400INVALID_ARGUMENT, reasonREQUEST_ID_REQUIRED). Resending the same request returns the first result with"replayed": trueand changes nothing. The same key with a different action or input answers 409IDEMPOTENCY_KEY_PAYLOAD_MISMATCH, reasonACTION_KEY_CONFLICT. A key is remembered for 90 days. - Concurrent edits. Most fields are last writer wins. A few fields an action declares as guarded need
expected_updated_at, theupdated_atyou read: if the record changed since, the answer is 409ETAG_MISMATCH, reasonRECORD_CHANGED, with the current record, so the person can review it and retry. - One or the other. A body names an action or ledger commands, not both (400
INVALID_ARGUMENT, reasonACTION_BODY_MIXED).
Try it first
Add"dry_run": true to run every check and the action itself, then discard the result. The answer is what the real run would return against the records as they stand, marked "dry_run": true, and nothing is changed or remembered. A later real run with the same key runs normally.
What is refused
A batch containingsource_activity.create or renewal_decision.set would change the system of record, so it always answers 403 CAPABILITY_DENIED, reason OVERLAY_READ_ONLY. The body, actor_principal and actor_type checks run first; then the whole batch is refused before any command is validated or recorded.
Limits
Errors
Every refusal is an RFC 9457 problem (application/problem+json) with an UPPER_SNAKE code, and a finer cause in reason when there is one.
Authority refusals are listed on Authority and scope. Read-time failures are on Completeness and errors.
Next
Append commands
Endpoint reference.
Authority and scope
How the person’s authority is resolved.