Tools

Write

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.

post/api/v1/tools/write

Request

  • Base URL: https://platform.labric.co
  • URL: https://platform.labric.co/api/v1/tools/write
  • Auth: HTTP bearer

Request body

target_namestring required

The name of the table to write to.

target_type'table' | 'core-table' required

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.

dataobject[] required

List of record dicts to write.

batch_insert_okboolean

If True, allow batch insert of multiple records.

params_to_match_for_updatestring[] nullable

Column names to match on when updating existing records.

on_match'overwrite' | '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.

defaultsobject nullable

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

modestring required

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

job_execution_idstring uuid nullable

Existing job execution ID to associate with this write. If omitted, a new one is created.

job_namestring nullable

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

collect_outputboolean

If True, return the written records in the response.

dry_runboolean

If True, resolve references, check table and column validity, and return the execution plan without committing changes.

Response

OK

object[] required

Changes

No recorded changes to this operation across all 1 revision of this API.