Skip to main content
POST
Import records from a CSV

Authorizations

Authorization
string
header
required

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

Body

application/json

Turn an already-uploaded CSV into records. The file is named, not carried: upload it to the knowledge object bucket first and send its location, so a file of any size travels once rather than through this request body.

config_id
string
required

Configuration the records are created under.

object_uri
string
required

Location of the uploaded file, as obj:///. Only the microstrate-agent-knowledge bucket may be read.

Example:

"obj://microstrate-agent-knowledge/record-import.customers.aB3xY9.contacts.csv"

bucket
string

The same location spelled out, for a caller that has it apart. object_uri wins if both are given.

key
string

Object key, used with bucket.

column_map
object

CSV heading to record field name. A heading absent from the map is ignored, which is how a column is dropped. An empty map falls back to the sanitised heading.

types
object

Record field name to column type, so values are coerced exactly as the caller's preview showed them. A field missing here is written as text.

space_id
string

Space every created record is filed under.

folder
string

Folder every created record is filed under. Omitted, each record's folder is derived from its identity, exactly as a single create does.

parent_folder
string

Parent folder every created record hangs off.

batch_size
integer
default:25

Records written concurrently. Clamped to the service maximum.

Required range: 1 <= x <= 100
completed
boolean
default:false

Mark each record complete, which fires its record trigger. Off by default: an import is a bulk load, and firing a workflow per row is a deliberate choice.

validate
boolean
default:true

Hold each imported row to the configuration schema, as a typed record is. False lets partial rows through.

Response

Import outcome. A 200 with a non-zero failed is a partial import, not a failure.

status_code
integer

HTTP status code echoed in the response body.

body
object

created + failed always equals total. errors is capped; failed is exact.