Skip to main content
POST
Run a declared import over an uploaded file. dry_run validates every row and writes nothing.

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
object_model:facts: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]+$

Path Parameters

import_id
string
required

Body

application/json
candidate
string

A tracker import: a whole import <import_id> for … { tracker { … } } declaration to use in place of the declared one, such as a layout not saved yet. Checked against the live model and never stored.

choices
object[]

A tracker import's save: your answers to the flags its dry run raised on rows (tracker.rows[].flags). A flag you do not answer takes its default_choice.

decide_existing
boolean

A tracker import: raise each value a matched record already holds that the file would change as an existing flag, and keep the record's value unless your answer in choices takes the file's.

dry_run
boolean

Check every row and write nothing. The answer counts the rows and lists each one's issues (issue_rows).

fallback_date_utc
string

A tracker import: the date (YYYY-MM-DD, UTC) a record it creates takes where the file gives none. Choose it once, and send the same date on the dry run, the save and any retry.

file
object

The file to import, sent in the body: raw_bytes (base64) and metadata.name. Send CSV, XLS or XLSX: an XLS or XLSX workbook is recognized by its content, and a name ending in .csv or any other content is read as CSV. OpenDocument (.ods) and binary Excel (.xlsb) workbooks are refused. The whole body is at most 8 MiB, base64 included, which leaves about 6 MiB for the file. A stored file's id is not read.

idempotency_key
string

Taken from the Idempotency-Key header: leave it out.

import_id
string

The import, as an import declaration in the model's text (GET /model) names it. Named by the path: leave it out, or send the same id.

inspect
boolean

A tracker import: describe what the file holds (inspection) instead of previewing it, to map its columns onto fields. Nothing is matched or written.

sheet
string

A tracker import: the worksheet to read, by name, instead of the one chosen for you.

subject_id
string

The record every row acts on, of the import's subject type. Leave it out for a tracker import.

template
boolean

Set by GET /imports/{import_id}/template: the blank template, answered as report. That file is kept for the VectorShift app to download, and this API gives no way to download it yet. Leave it out on a run.

tracker_overwrite
boolean

A tracker import whose layout fills only blank fields: write the file's values over what matched records hold.

world_id
string

The scenario the rows' facts land in. Leave it out to record them outside any scenario.

Response

Answered.

error
string

The file could not be read: the wrong format, a missing required heading, or too many rows.

inspection
object

With inspect: what the file holds, to map its columns.

invalidated_definitions
string[]

Figures whose values the import changes, by id.

issue_rows
object[]

The first rows with issues, in file order.

report
object

The blank template (with template), or a copy of the file marking each row's issues, for the app to download. This API can't download it yet: read issue_rows instead.

rows_with_issues
integer

How many rows have an issue or did not save. issue_rows lists the first of them.

saved
integer

Rows written (or replayed on a retry). An import with columns saves nothing unless every row passes; a tracker import saves each row on its own.

total_rows
integer

Data rows read from the file.

tracker
object

A tracker import's answer, in place of the issue rows: each row's match and changes, and the flags to answer in choices.