POST
/
media
/
import
Import media from an external URL
curl --request POST \
  --url https://api.video.dev/v1/media/import \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "source_media_url": "https://external.media/media.mp4",
  "type": "video",
  "webhook": {
    "url": "https://system.new/webhook/v1",
    "events": [
      "complete"
    ]
  }
}'
{
  "status": "processing",
  "media_id": "<string>",
  "source_media_url": "https://external.media/media.mp4",
  "type": "video",
  "webhook": {
    "url": "https://system.new/webhook/v1",
    "events": [
      "complete"
    ]
  }
}

Webhooks

Webhooks allow video.dev to notify your API when results are ready. This eliminates unnecessary requests made by polling, and can get results back faster. Webhooks can be registered as part of the request and various events can be subscribed to get status of . The following is a full list of all webhook events which can be subscribed.
EventDescription
completeOccurs when a media import completes
errorOccurs when a media import has encountered errors
The webhook will be POST to the URL you provided with a JSON payload. The payload will contain the event type and the details associated with the event.

Authorizations

X-API-Key
string
header
required

Body

application/json
source_media_url
string
required

URL for the external media (audio, video, image)

Example:

"https://external.media/media.mp4"

type
enum<string>
required

Type of media

Available options:
video,
audio,
image
webhook
object

Callback to listen for events

Response

Media import initiated successfully

media_id
string
required
source_media_url
string
required

URL for the external media (audio, video, image)

Example:

"https://external.media/media.mp4"

type
enum<string>
required

Type of media

Available options:
video,
audio,
image
status
enum<string>
required
Available options:
complete,
processing,
error
Example:

"processing"

webhook
object

Callback to listen for events