Database endpoints
Import a CSV or NDJSON file
Upload a CSV or NDJSON file and load its rows into an existing table.
POST /v1/tenants/{tenant}/ingest/files/{schema}
- Prepare CSV or NDJSONMatch the destination table's fields and types.
- Upload the fileChoose format and chunk settings.
- Check imported rowsCompare rows_ingested with the expected file contents.
Before you start
Use your database bearer token.
Register the destination table and prepare a CSV or NDJSON file. This is a multipart upload, not a JSON body; use curl -F file=@people.csv.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
schema | string | Required |
Query parameters
| Field | Type | Required |
|---|---|---|
format | string | Optional |
csv_has_header | boolean | Optional |
chunk_size | integer | Optional |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
multipart/form-data
Limits and accepted values
- Exactly one part named 'file' (binary CSV or NDJSON);
- other parts are ignored.
- Format is taken from the 'format' query parameter, else the part's content type (text/csv, application/x-ndjson, application/jsonl), else the filename extension (.csv, .ndjson, .jsonl), else NDJSON if the first non-blank byte is '{'.
- CSV cells are coerced to the table's column types;
- an empty cell becomes null.
- The route defines no fixed body-size limit. This is not a claim of unlimited deployment capacity.
| Field | Type | Required |
|---|---|---|
file | string | Required |
Read the result
rows_ingested reports imported rows and chunks reports the work units used. Confirm the row count against your file and inspect the destination before switching an application to the imported data.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 404 | Check the resource ID and API route. |
| 409 | Resolve the conflict before retrying. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 501 | Check deployment support for this operation. |
| 503 | Honor Retry-After when present; check write outcomes. |