Skip to Content
Tracira
API referenceUploads

Upload a file

Returns a short-lived URL to upload one file directly to Tracira storage, bypassing the 4.5 MB request-body cap.

Flow for large files:

  1. POST /api/uploads → { uploadUrl, key, contentType }
  2. PUT the raw file bytes to uploadUrl with header Content-Type: <contentType>
  3. POST /api/logs with attachments: [{ source: "uploaded", key }]

The file stages in your workspace until an output references it, then it is copied into that output. Uploads never linked to an output are deleted automatically within 24 hours.

  • Accepted types: image/*, audio/*, application/pdf
  • Up to 32 MB per file
  • Each in-flight upload reserves space against your workspace storage quota (the declared sizeBytes, or the per-file max if omitted), so unlinked uploads can never push a workspace over its plan limit. The reservation is released when the upload is linked to an output or reaped.

This endpoint does not take a label. A staging upload has no output yet, so there is nothing for a label to describe: name the file when you attach it, on the attachments[].label field of POST /api/logs.

posthttps://www.tracira.com/api/uploads
POST
/api/uploads

Authorization

webhookToken
headerAuthorizationBearer <token>

Workspace API token, from the Integrations page.

Request Body

application/json
  1. body

Create an upload: request a URL to PUT one file directly to Tracira storage.

filename?string

Original filename. Its extension infers the content type when contentType is omitted (e.g. invoice.pdf).

contentType?string

MIME type (e.g. application/pdf, image/png). Required if the filename has no recognizable extension. Accepted: image/, audio/, application/pdf.

sizeBytes?integer

Size in bytes. Reserved against your storage quota while the upload is in flight (released on link or reap). If omitted, the per-file max is reserved, so declaring it lets more uploads be in flight at once.

Range1 <= value

Response Body

Upload URL created.

application/json
  1. response
uploadUrl?string

Short-lived presigned URL. PUT the raw file bytes here with header Content-Type: <contentType>.

Formaturi
key?string

Pass this to POST /api/logs as attachments: [{ source: "uploaded", key }].

contentType?string

Send this exact value as the Content-Type header on your PUT.

method?string
headers?

Headers to include on the upload PUT.

expiresIn?integer

Seconds until the upload URL expires.

maxBytes?integer

Hard per-file size limit.

Example Request
curl -X POST 'https://www.tracira.com/api/uploads' \  -H 'Content-Type: application/json' \  -d '{  "filename": "invoice.pdf",  "contentType": "application/pdf",  "sizeBytes": 248192}'
Example Response
{  "uploadUrl": "http://example.com",  "key": "string",  "contentType": "string",  "method": "PUT",  "headers": {    "property1": "string",    "property2": "string"  },  "expiresIn": 0,  "maxBytes": 0}