remagicaDocs home
API referenceUploads

Upload from a link

POST
/uploads/from-url

Needs a key withuploads:write

Copies an image, video or audio file from a public link into the workspace's storage (up to 200 MB) and returns its key, as an upload would. Links to private addresses are refused.

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
url*string

Public link to an image, video or audio file (a web image someone copied, for example).

Formaturi
Lengthlength <= 2048

Response Body

The copied file.

application/json
  1. response

The file, copied into the workspace's storage.

contentType*string
key*string

Storage key of the copy: uploads/<organizationId>/<uuid>/<filename>.

kind*string
Value in"image""video""audio"
name*string

A file name from the link.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/uploads/from-url' \  -H 'Content-Type: application/json' \  -d '{  "url": "https://example.com/owl.png"}'
Example Response
{  "contentType": "image/png",  "key": "uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4",  "kind": "image",  "name": "owl.png"}