Skip to main content
POST

Overview

Adds the file at a public https URL to your team’s media library, so you can use it in any create endpoint. The call answers 202 right away with the new mediaId; the file is downloaded after the response. Poll Get Media until status is COMPLETED, then pass the id as media. Or pass a webhook (with optional metadata) to be told once the import is COMPLETED or FAILED: see media webhooks.
JPEG, PNG, WEBP, GIF, MP4, MOV or WEBM, up to 100 MB. The type is read from the file itself, not from the URL or the host’s Content-Type. The file counts against your plan’s storage. Importing is free.
The URL must be public: local, private-network and plain http addresses are refused with 400 before anything is created, and every redirect is checked the same way. A URL that cannot be downloaded, a file of another type, one over 100 MB or one that does not fit your storage leaves the media FAILED, with the reason in its error.

Errors

Problems with the file itself (unreachable, wrong type, too large, no storage left) do not answer an error here: the media becomes FAILED in Get Media, and its error says which.
The file is on your own machine? Use Upload Media instead.

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Makes the request safe to retry. 1-255 printable ASCII characters, one per operation (your job id, or a UUID you store), reused on every retry. Within 24 hours the same key with the same body answers with the first response and the header Idempotent-Replayed: true, without running or charging again. Keys are scoped to your team and the endpoint. 5xx answers and refusals before anything ran (401, 402, 403, 409, 429) are not kept. See Idempotency.

Required string length: 1 - 255
Pattern: ^[\x20-\x7E]+$

Body

application/json
url
string<uri>
required

Public https URL of the file. Private, local and plain http addresses are refused.

name
string

Name in your library. Defaults to the file name in the URL.

webhook
string

Public https URL told once when the media is COMPLETED or FAILED (events media.completed / media.failed, signed like every Hooked webhook). See Webhooks.

Maximum string length: 500
metadata
object

Any JSON object of your own (max 5 KB). Sent back in the webhook payload.

Response

Import started

success
boolean
message
string
data
object