Skip to main content
POST
← Files Upload one file in one multipart request. From here on it follows the same path as an upload through the app: the duplicate check, classification and the links to its folder’s projects. The answer is 202 Accepted with the file and Location: /v2/files/{id}, where its state says how it goes. Over 25 MB, use the presigned flow, which takes files of up to 100 MB without sending the bytes through the API. The file’s type comes from its extension and its bytes, never from what the request declares. The Content-Type of the file part is ignored, and bytes that are not what the extension says are refused.
Beta. Part of the Import API, in beta. The contract may still change before general availability.

Request

Headers

string
required
Your API key.
string
required
The organization the file goes in.
string
required
A unique value per file, 1 to 255 characters. Retrying with the same key and file answers the same file with Idempotent-Replayed: true and writes nothing. The same key with another file, name or context, or on another route, is 422 IDEMPOTENCY_KEY_REUSED. After 24 hours the key is free and a request with it is a new one. See The Idempotency-Key.

Body (multipart/form-data)

file
required
The file, up to 25 MB. Its name keeps only the base name, up to 240 characters without the extension, and may not have control characters: otherwise the answer is 422 REQUEST_VALIDATION_FAILED.
string
A facility of the organization in x-organization-id, not of a subsidiary. An import opened from the file takes it.
string
upstream or downstream, for shipments. An import opened from the file takes it.
string
A project your organization contributes to. The file is linked to it and an import opened from the file goes in it.
string
A folder of the organization in x-organization-id. In an evidence folder the file is stored and never processed.
boolean
default:"false"
Store it and nothing else: no classification and no reading. Its status is completed.
Any other field is rejected.

Response

The file’s state, as in Get a File (v2). The request also records an ingest job with entity_type files, born completed: it keeps the Idempotency-Key, sends no webhook and says nothing about how the file goes.

Errors

Errors are problem details. 413 FILE_TOO_LARGE, 408 UPLOAD_TIMEOUT, 503 UPLOADS_BUSY (retry after Retry-After), 400 FILE_EMPTY, 422 FILE_CONTENT_NOT_ALLOWED, 422 REFERENCE_NOT_FOUND (a facility_id, project_id or folder_id that does not exist or is outside your organization’s perimeter, with error_params.field), 403 FILE_LIMIT_REACHED, 403 API_KEY_SCOPE_DENIED (a read-only key), 400 BAD_REQUEST (a body that is not valid multipart, or with more than one file), 422 REQUEST_VALIDATION_FAILED (a missing Idempotency-Key, an unknown field, a file name or extension that is not accepted), 422 IDEMPOTENCY_KEY_REUSED, 409 IDEMPOTENCY_KEY_IN_PROGRESS, 404 NOT_FOUND (a retry of a file deleted or in the trash since), and 429 beyond the rate limits.

Limits

Get a File (v2)

The file’s state: classification, template and automatic import

Open an Import Session

Import a spreadsheet you uploaded

Upload Files

Presigned URLs, for files of up to 100 MB