remagicaDocs home
API referenceUploads

Create an upload URL

POST
/uploads

Needs a key withuploads:write

Returns a presigned URL for uploading one media file straight to object storage, so large videos never pass through the API.

Upload the file with PUT uploadUrl, sending the returned headers and the raw bytes as the body, before expiresAt. Then pass key to POST /clip-jobs.

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.

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body

The file you are about to upload.

contentType*string

MIME type of the file: any video/*, audio/* or image/* type, or a PDF or Word (.docx) brand file for POST /brand-kits/from-file. The upload PUT must send exactly this Content-Type.

Match^((video|audio|image)\/[\w.+-]+|application\/pdf|application\/vnd\.openxmlformats-officedocument\.wordprocessingml\.document)$
filename*string

Original file name. It is sanitised and becomes the last segment of the storage key.

Length1 <= length <= 255
size*integer

File size in bytes. At most 5363466240 (5 GiB minus 5 MiB, the single-request upload limit).

Range0 < value <= 5363466240

Response Body

The presigned upload URL and how to use it.

application/json
  1. response

Where and how to upload the file.

expiresAt*string

When uploadUrl stops working (15 minutes after issue).

Formatdate-time
headers*

Send exactly these headers with the PUT.

key*string

Storage key of the upload: uploads/<organizationId>/<uuid>/<filename>. Pass it as sourceKey to POST /clip-jobs once the PUT has finished.

method*unknown

HTTP method for the upload.

uploadUrl*string

Presigned object-storage URL. PUT the raw file bytes here; they go straight to storage, not through this API.

Formaturi
Example Request
curl -X POST 'https://api.remagica.com/api/v1/uploads' \  -H 'Content-Type: application/json' \  -d '{  "contentType": "video/mp4",  "filename": "keynote.mp4",  "size": 734003200}'
Example Response
{  "expiresAt": "2026-09-27T12:15:00.000Z",  "headers": {    "Content-Type": "video/mp4"  },  "key": "uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4",  "method": "PUT",  "uploadUrl": "https://storage.example.com/remagica/uploads/…/keynote.mp4?X-Amz-Signature=…"}