Skip to navigation

Write

Deprecated
View as Markdown

Write records to a table.

Deprecated: use write_data (client.data.write), which writes several tables and raw series in one transaction.

Inserts or updates records in the specified target table. Supports batch inserts, upserts with match columns, default value functions (DATETIME_NOW, UUID4), and optional dry-run validation. A job execution is created automatically if one is not provided.

Core tables are writable only if they appear in the write allowlist. Tables that describe the organization itself, such as organizationmember, are read-only and can only be reached through the read tool.

Requires an API key with the write scope.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
target_namestringRequired
The name of the table to write to.
target_typeenumRequired

The type of target. Currently ‘table’ or ‘core-table’. Only some core tables are writable. Tables describing the organization, such as organizationmember, are read-only.

Allowed values:
datalist of maps from strings to anyRequired
List of record dicts to write.
modestringRequired

Write mode (e.g. ‘create’, ‘create-or-update’).

batch_insert_okbooleanOptionalDefaults to false
If True, allow batch insert of multiple records.
params_to_match_for_updatelist of strings or nullOptional
Column names to match on when updating existing records.
on_matchenumOptionalDefaults to fill_missing

How a matched record takes the provided columns in create-or-update mode. ‘fill_missing’ only sets columns that are currently null. ‘overwrite’ replaces them, and a provided null clears the column. Columns absent from the record and default functions never overwrite an existing value.

Allowed values:
defaultsmap from strings to strings or nullOptional

Map of field names to default function names (e.g. ‘DATETIME_NOW’, ‘UUID4’).

job_execution_idstring or nullOptionalformat: "uuid"
Existing job execution ID to associate with this write. If omitted, a new one is created.
job_namestring or nullOptional

Name for the auto-created job. Defaults to ‘Off-Platform Manual Job’.

collect_outputbooleanOptionalDefaults to false
If True, return the written records in the response.
dry_runbooleanOptionalDefaults to false
If True, resolve references, check table and column validity, and return the execution plan without committing changes.

Response

OK

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error