---
title: "Upload a CSV file"
method: POST
path: "/v1/uploads"
tags: ["Uploads"]
---

# Upload a CSV file

`POST /v1/uploads`

<Note>
  To use this endpoint:
  
  - The **Upload data** setting in **Settings > Content permissions** must enabled by an **Organization Admin**
  - The authenticating user must have **Restricted Querier** permissions or higher on the model the file will be uploaded to
</Note>

Upload a CSV file to create a new [data input table](/analyze-explore/data-input-csvs). The file is parsed, converted to Arrow format, uploaded to storage, written to the connection's table upload (scratch) schema, and a view is created in the specified model.

Uploaded files:

- Must be a CSV file with `.csv` extension
- Can have a maximum of 500,000 rows. Files will be truncated if this limit is exceeded.

## Response `201`

CSV file uploaded successfully and view created.

- object
  - `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

## Other responses

- `400` — Bad Request. Possible error messages include: - Missing required fields (`file` or `modelId`) - Invalid file type (not a CSV file) - CSV parsing failed - Invalid UUID format - Both `branchId` and `branchName` provided (mutually exclusive)
- `401` — Missing or invalid authentication.
- `403` — Insufficient permissions. Authenticating user must have **Restricted Querier** permissions or higher on the model.
- `404` — Not Found. Possible error messages include: - Model not found (invalid `modelId`) - Branch not found (invalid `branchId` or `branchName`)
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
