Skip to main content
POST
/
v1
/
uploads
Upload a CSV file
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/uploads \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form modelId=880e8400-e29b-41d4-a716-446655440003 \
  --form branchId=990e8400-e29b-41d4-a716-446655440004 \
  --form branchName=my-branch \
  --form viewName=custom_view_name
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "fileName": "users.csv",
  "viewName": "users",
  "modelId": "880e8400-e29b-41d4-a716-446655440003",
  "inDbAsTableName": "omni_upload_t550e8400",
  "rowCount": 150,
  "truncated": false,
  "viewCreated": true
}

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Body

multipart/form-data
file
file
required

The CSV file to upload, which must have a .csv extension

modelId
string<uuid>
required

UUID of the model to create the view in

Example:

"880e8400-e29b-41d4-a716-446655440003"

branchId
string<uuid>

UUID of the branch to create the view in. Mutually exclusive with branchName.

Example:

"990e8400-e29b-41d4-a716-446655440004"

branchName
string

Name of the branch to create the view in. Mutually exclusive with branchId.

Example:

"my-branch"

viewName
string

Override the view name. Defaults to sanitized file name.

Example:

"custom_view_name"

Response

CSV file uploaded successfully and view created.

id
string<uuid>

Unique identifier for the upload

fileName
string

Original file name

viewName
string

Name of the view created

modelId
string<uuid>

ID of the model the view was created in

inDbAsTableName
string

Database table name in the scratch schema

rowCount
integer

Number of rows in the uploaded file

truncated
boolean

Whether the file was truncated due to row limit (500,000 rows)

viewCreated
boolean

Whether a view was created in the model