---
title: "Import from a URL"
method: POST
path: "/media/import"
tags: ["Media"]
---

# Import from a URL

`POST /media/import`

## Request

- Base URL: `https://api.vidmoat.com/v1`
- URL: `https://api.vidmoat.com/v1/media/import`
- Auth: HTTP bearer

Fetch a public http(s) URL server-side, up to your plan's upload cap or 512 MB, whichever is smaller. Destinations pass through the SSRF guard, so private ranges and metadata endpoints are refused.

## Request body

- object
  - `url` string, required: A public `http` or `https` URL to a video, image or audio file. Redirects are followed; the fetch times out after 120 seconds.

## Response `201`

Import from a URL

- object
  - `media` object: The stored file.
    - `url` string: Use as a clip `src`.
    - `filename` string: Stored name.
    - `mediaType` 'video' | 'audio' | 'image': What it is.
    - `contentType` string: MIME type.
    - `bytes` integer: Size.
    - `durationSec` number, nullable: Length, for video and audio.
  - `hint` string: What to do with it.

## Other responses

- `400`: `invalid_request`: No `url`, a private or unresolvable host, or a file that is not video, image or audio.
- `413`: `payload_too_large`: The file is larger than the import limit.
- `502`: `provider_error`: The URL could not be fetched (an upstream 404 or a timeout, for example).

---

[API](https://skmtc.dev/vidmoat/apis/vidmoat-api.md) · [All operations](https://skmtc.dev/vidmoat/apis/vidmoat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vidmoat/apis/vidmoat-api/revisions/23e24e25c756?raw)
