Skip to main content
POST
Start a bulk record write: its type, mode and first items. sealed submits it in one call.

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

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

A job writes many records of one type: submit it, upload its items in parts (POST /record-write-jobs/{job_id}/parts), seal it, then follow GET /record-write-jobs/{job_id} and read each item's outcome from .../results. Items are written in chunks, in order, each chunk whole or not at all; the first chunk that fails stops the job, and the items after it are skipped. At most 5000 items per part and 100000 per job; chunks of 1 to 1000 items (default 200). Not every organization can run jobs yet, and a job needs the key's person to be allowed to edit the model, not only its records. Each record goes through the same checks as a single write.

chunk_size
integer

Items written together, 1 to 1,000. Default 200. A chunk is written whole or not at all.

idempotency_key
string

Taken from the Idempotency-Key header: leave it out. Kept 7 days: re-sent, it answers the same job.

items
object[]

The first items. Upload more in parts until the job is sealed.

mode
enum<string>

create (each item makes a new record; an item whose record exists fails), update (each item changes an existing record, and must change something) or upsert (either).

Available options:
create,
update,
upsert
namespace
string

Where the items' external_ids live, such as crm. Required when any item has one.

sealed
boolean

Seal the job in this call: no parts follow, and writing starts.

type_id
string

The record type every item writes.

Response

Answered.

accepted

Items uploaded.

committed

Items written.

failed

Items not written, once the job failed or was cancelled.

job_id
string

The job's id.

next_cursor

Send it as cursor for the next page of outcomes. 0 on the last page.

outcomes
object[]

Each item's outcome: only on GET /record-write-jobs/{job_id}/results.

state
string

staging (taking parts), queued, running, finalizing, completed, failed or cancelled.