Skip to content

Set Field Values Batch

PATCH
/fields/values/batch

Write custom column values to one OR many rows in a single call.

The batch counterpart of PATCH /fields/{column_id}/values. Each row carries its own record_id and a list of {column_id, value} pairs; every row shares the top-level entity. A single-row update is just a rows list of length one.

Partial success: each row is applied inside its own SAVEPOINT, so a bad row (missing record, unknown column) is reported ok: false in results[] while the remaining rows still commit. Pass value=null (or omit it) on a pair to clear that column for the row.

Limits: 1-500 rows per call; a record_id may appear only once per call (fold that record’s writes into one row) - duplicates 400.

Efficiency: all referenced column_ids are resolved in one query and all record_ids are existence-checked in one query, then each row is written with a single multi-column upsert (N+2 statements, not N*M).

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

Write custom column values to one OR many contact/company rows at once.

object
entity

Target entity, SHARED across every row: ‘contacts’ or ‘companies’.

string
default: contacts
rows
required

Rows to update (1-500). Each carries its own record_id + fields[].

Array<object>

One row (contact or company) plus the columns to set on it.

object
fields

Column/value pairs to write on this row. Empty = no-op (counts as ok with 0 writes).

Array<object>
<= 500 items

One (column, value) pair to write on a row.

object
column_id
required

Column ID from g8_list_fields or g8_create_field.

integer
value
Any of:
string
record_id
required

Contact ID (entity=‘contacts’) or company ID (entity=‘companies’).

integer
strict

Opt-in status-code semantics. Default false keeps the historical behaviour: always HTTP 200, per-row outcomes in results[]. When true, a batch where EVERY row failed returns 422 and a partially-failed batch returns 207 Multi-Status, so a client that only checks the status code cannot mistake a total failure for success. The response body is identical either way.

boolean

Responses

200

Successful Response

object
data
required
object
all_failed

True when rows were requested and NONE were written.

boolean
entity
required
string
results
required
Array<object>

Per-row outcome inside a batch value-write response.

object
error
Any of:
string
ok
boolean
default: true
record_id
required
integer
updated_columns
Array<integer>
total_rows_failed

Rows that could not be written (see results[].error).

integer
total_rows_requested
required
integer
total_rows_updated
required
integer
total_values_written
required
integer
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string