Skip to main content

Files - request an upload URL

POST 

/api/v1/files/upload

Returns a pre-signed URL for uploading a file via PUT.

Request

Responses

Upload URL and file ID

Reference

POST /api/v1/files/upload

Returns a pre-signed URL for uploading a file via PUT.

Request body

Content type: application/json (required)

FieldTypeRequiredDescription
filenamestringyesOriginal filename including extension (e.g. 'part.step', 'model.obj'). Used for display and format detection.
contentTypestringyesMIME type of the file (e.g. 'application/step', 'model/gltf-binary'). Must match the actual file content.
bytesintegeryesExact file size in bytes. Must match the Content-Length of the subsequent PUT to the upload URL. Maximum: 1 GB.
sha256stringnoSHA-256 hex digest of the file content. When provided, enables server-side deduplication - if an identical file was previously uploaded under this API key, the existing file is reused and no upload is needed.

Responses

StatusDescription
201Upload URL and file ID
400Validation error
500Server error

Example request

curl -X POST "https://api.bitbybit.dev/api/v1/files/upload" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'

Authentication: send your key in the x-api-key header. The full machine-readable specification is at openapi.json.