Skip to main content
PATCH
Set fields, clear fields, add or remove items of list fields, add links, remove links. If-Match names the revision the change was written against. Answers with written_id and the record, which is absent when the write took it out of the caller's sight.

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:records:write

Headers

If-Match
string

The record's revision the change was written against, as read. If the record is at another revision, nothing is applied (412 revision_mismatch, details.current_revision): read it again and send the change against what is there. Leave it out to apply the change at whatever revision the record is. Send it as the If-Match header (If-Match: 1842, quotes allowed) or as expected_revision 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]+$

Path Parameters

type_id
string
required
record_id
string
required

Body

application/json
expected_revision

The record's revision the change was written against, as read. If the record is at another revision, nothing is applied (412 revision_mismatch, details.current_revision): read it again and send the change against what is there. Leave it out to apply the change at whatever revision the record is. Send it as the If-Match header (If-Match: 1842, quotes allowed) or as expected_revision in the body; the header wins when both are sent.

idempotency_key
string

Taken from the Idempotency-Key header: leave it out.

Links to add, by relation_id, in the same shape as a create's links.

Links to remove, by relation_id, in the same shape as a create's links.

list_add
object

Items to add to list fields (multi_select, string_list, ref_list), by field: added to the list as it is when written, not to a copy you read, so an item someone else added meanwhile stays, and an item the list holds is not added twice. A field takes values, unset or items, not two of them (422 conflicting_changes).

list_remove
object

Items to remove from list fields, by field, applied the same way: every occurrence goes, and an item the list does not hold is no change.

record_id
string

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

type_id
string

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

unset
string[]

Fields to clear, by name. A field takes values, unset, list_add or list_remove, not two of them.

values
object

The fields to change, each keyed by its name in the JSON its storage takes. Fields left out keep their values. To add items to a list field or remove them without replacing it, use list_add and list_remove. null clears a field. Every value is checked against its field before anything is written, and a value of the wrong shape is refused (422 wrong_shape).

Response

Answered.

deleted_id
string

A delete's answer: the id removed, once it is gone.

disposition
string

A create's answer: created, or existing when unique_by matched a record, which is answered unchanged.

next_cursor
string

Send it as cursor for the next page. Empty on the last page.

records
object[]

The records: a page of a listing or query, or the one record a get or write answers.

summary
object

With aggregates or group: {"aggregates": [{"field", "op", "value", "error"}], "groups": [{"value", "count", "aggregates": […]}], "groups_truncated"}. aggregates are in the order asked, over every match, not only this page. A count is 0 when nothing matches; a sum, average, min or max is null when no match has a value. groups has one entry per value of the group field, in ascending order (records with no value form a group whose value is null), at most 200, with groups_truncated set past that. Sent again on every page.

total_count

How many records the query matched in all, as a string. An unsorted listing or query sends it on its first page only; a sorted or summarizing query sends it on every page. Absent on a get or a write.

written_id
string

A create's or update's answer: the record written. Also in records, unless the write itself took the record out of your sight.