FilesV2

Initiate a single-PUT file upload

Changed on

Initiate a single-PUT upload for files up to 5 GB. The response includes a pre-signed upload_url that the client should PUT the full file body to. After the PUT succeeds, call Complete upload at POST /v2/files/{file_id}/upload/complete.

The pre-signed upload_url is signed for server-side encryption with AWS KMS, so the PUT request must include the header x-amz-server-side-encryption: aws:kms. Omitting it (or sending a different value) fails the request with a signature mismatch (HTTP 403).

curl -X PUT "<upload_url>" \
-H "x-amz-server-side-encryption: aws:kms" \
-H "Content-Type: <type>" \
--data-binary @/path/to/file

Files larger than 5 GB must use the large-upload endpoint (POST /v2/files/large-upload) instead.

Once finalized, inspect the file with GET /v1/files/{file_id} and download it with GET /v1/files/{file_id}/download — no v2 read surface exists yet.

Returns 201 with the upload session details. Orphaned uploads that are not completed are eventually cleaned up.

Required scope: data:file_import or doc:file_import

post/v2/files/upload

Request

  • Base URL
    https://dovetail.com/api
  • URL
    https://dovetail.com/api/v2/files/upload
  • Auth
    HTTP bearer

Request body

namestring required

The file's original name, including extension. 1-1024 characters.

typestring required

The file's MIME type (e.g. image/png, video/mp4). Up to 255 characters.

sizeinteger required

Total size of the file in bytes. Must be between 1 and 5000000000 (5 GB). For files larger than 5 GB use the large-upload endpoint instead.

Response

201

Changes