Create an upload
POST/api/v1/uploads
Creates an upload: temporary file content of the caller, which only the caller can see or use, transferred before a document is created from it with primaryFile.uploadId. See Uploading files.
The request uses one of two forms, which create the same upload:
- an
application/jsonbody with thefilenameand the declaredsize; - the tus 1.0.0 creation form, which a stock tus client sends: an empty body with
Upload-Lengthand the filename in thefilenamekey ofUpload-Metadata, or in itsnamekey whenfilenameis absent. A request carryingUpload-Lengthuses this form.
The media type is derived from the filename's extension; a client-declared media type, such as the filetype metadata key, is ignored. The declared size is limited to 24 MiB by default, and an environment can configure a different limit. The declared sizes of a user's open uploads can total 1 GiB by default, and an environment can configure a different size. An upload expires 24 hours after its creation by default, whether or not its content is complete.
Request
Responses
- 201
- 400
- 401
- 403
- 406
- 409
- 412
- 413
- 415
- 500
- 503
The upload was created with status receiving. Send its content to the Location URL with PATCH.
Response Headers
no-store, so no cache answers with an outdated offset.
The upload's URL, /api/v1/uploads/{id}, which is also its tus upload URL.
The tus protocol version. Every response of an upload operation carries it, Problem responses included, except a 406.
The upload's expiration time as an HTTP-date.
The upload's declared size in bytes.
The filename key with the upload's filename in base64.
The number of bytes the upload has received and stored, at which the next PATCH continues.
The request is invalid (invalid_request): the body or a parameter failed validation, or the multipart body or a request header is malformed. A body that is not valid JSON uses invalid_json.
The authentication credential is invalid or has expired (unauthorized).
The request has no authentication credential, or the user is not allowed to use the API (forbidden).
The request does not accept any representation the operation can produce (not_acceptable).
The declared sizes of the caller's open uploads with this one would exceed their maximum total size (upload_limit_reached). No upload was created. An upload stops being open when it is consumed, deleted, or expires.
The Tus-Resumable request header names a tus protocol version other than 1.0.0 (unsupported_protocol_version). The request had no effect.
Response Headers
The tus protocol version. Every response of an upload operation carries it, Problem responses included, except a 406.
The tus protocol versions the server supports.
The request content exceeds a size limit (payload_too_large).
The request's Content-Type is not supported by this operation (unsupported_media_type).
An unexpected server error occurred (internal_error).
The service is temporarily unavailable, for example while it restarts (service_unavailable). Retry the request later.