Skip to content
Get started

Labric Write Api

post/api/v1/tools/write

Write records to a table.

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.

Body ParametersExpand Collapse
data: array of map[unknown]

List of record dicts to write.

mode: string

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

target_name: string

The name of the table to write to.

target_type: "table" or "core-table"

The type of target. Currently 'table' or 'core-table'.

Accepts one of the following:
"table"
"core-table"
batch_insert_ok: optional boolean

If True, allow batch insert of multiple records.

collect_output: optional boolean

If True, return the written records in the response.

defaults: optional map[string]

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

dry_run: optional boolean

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

job_execution_id: optional string

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

formatuuid
job_name: optional string

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

params_to_match_for_update: optional array of string

Column names to match on when updating existing records.

Labric Write Api
curl https://platform.labric.co//api/v1/tools/write \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LABRIC_API_KEY" \
    -d '{
          "data": [
            {
              "foo": "bar"
            }
          ],
          "mode": "mode",
          "target_name": "target_name",
          "target_type": "table"
        }'
[
  {
    "foo": "bar"
  }
]
Returns Examples
[
  {
    "foo": "bar"
  }
]