Tracira
API referenceMedia

Get a signed download URL for a stored file

Exchanges a stored-file reference for a short-lived signed storage URL, valid for 5 minutes. This is the route automations should use to download a file.

Fetch the returned url with no Authorization header. The signature travels in the query string, and storage rejects a presigned request that also carries an auth header. Most HTTP clients reuse headers across calls, so send your token to this endpoint only.

The typical use is a redo. When a reviewer sends an output back with a comment, the automation that produced it has already finished and no longer holds the source file. It can get it back:

  1. Read the output's attachments array, from the webhook payload or GET /api/logs/{id}. Use the key from there, not the key returned by POST /api/uploads - an upload key is consumed once an output references it, and answers 404 afterwards.
  2. Exchange that attachment's key or url here for a signed link, then download it.
  3. Rerun the AI with the reviewer's comment.
  4. Resubmit with revisionOf set and attachments: [{ source: "stored", key }], so the same document carries onto the new version without being uploaded again.
gethttps://www.tracira.com/api/media-url
GET
/api/media-url

Authorization

AuthorizationBearer <token>

Workspace webhook token from Settings -> Integrations.

In: header

Query Parameters

source*string

The file to sign. Accepts the bare key from an attachment, the relative /api/media/{key} path, or the absolute url from an attachment - all three name the same object.

filename?string

Optional. Renames the file in the signed URL's content disposition. Defaults to the name it was stored under.

download?"1"

Use 1 for attachment disposition instead of inline preview.

Value in

  • "1"

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/media-url?source=1f4a8c60-92d7-4b3e-8a51-c27e6d90f3b2%2Flog-42%2F0-ab12cd34-invoice-april.pdf"
{  "url": "http://example.com",  "expiresAt": "2019-08-24T14:15:22Z",  "key": "string",  "filename": "string",  "contentType": "string",  "sizeBytes": 0}