remagicaDocs home
API referenceUploads

Get file URLs

POST
/files/urls

Needs a key withuploads:write

Returns short-lived download URLs for files of your workspace by storage key (an upload, a generation output, a workflow's file) and for thumbnail reference library files and built-in reference previews. Other keys are left out.

Requires scope uploads:write.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Request Body

application/json
  1. body
cors?boolean

URLs for reading in the browser with CORS (a <video crossorigin>, fetch): they differ from the plain ones and aren't cached, so a copy the browser cached without CORS headers can't answer them.

keys*array<>

Storage keys of your workspace's files (uploads, generation outputs, workflow files).

Items1 <= items <= 100

Response Body

The download URLs, by key.

application/json
  1. response
files*

A short-lived download URL for each key, by key. Keys that aren't your workspace's files are left out.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/files/urls' \  -H 'Content-Type: application/json' \  -d '{  "keys": [    "uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"  ]}'
Example Response
{  "files": {}}