# Import media from a URL with the PostEverywhere API **Source:** https://posteverywhere.ai/docs/api/upload-media-from-url --- [🤖Connect ChatGPT, Claude or any AI agent to manage your social media end to endConnect your AI agent to manage your social media](https://posteverywhere.ai/agents)POST/media/upload-from-url # Import media from a URL with the PostEverywhere API Fetches the URL server-side and stores it — no presign/PUT/complete dance. **Images** (JPEG/PNG/GIF/WebP/HEIC/HEIF, max 25 MB) import synchronously: the response `media_id` is ready immediately. **Videos** (MP4 only, max 500 MB) import ASYNCHRONOUSLY: the response returns instantly with `media_status: "uploading"` while the file streams in server-side. Poll `GET /media/{id}` until `media_status` is `ready` (typically seconds), then attach via `media_ids`. If it becomes `failed`, the poll response's `error_message` states exactly why (too large, not actually an MP4, storage quota, source URL died). Oversize videos with a Content-Length return `413` up front; storage quota returns `403 storage_quota_exceeded`. 30 s fetch timeout to first byte, SSRF-guarded including redirects (no localhost/private addresses, `400 invalid_url`). Unreachable or slow URLs return `502`/`504` `fetch_failed`. Consumes the media upload quota. Guide: [Media requirements by platform](https://posteverywhere.ai/docs/media-requirements) Copy MarkdownCopy for LLMThis endpoint accepts a JSON request body. See the [media guide](https://posteverywhere.ai/docs/media-requirements) for a worked example. ## Responses - 200Imported. Images return media_status "ready"; videos return "uploading" — poll `GET /media/{id}` until ready before attaching. - 400 - 401 - 402 - 403 - 413Downloaded file exceeds 25 MB - 415Video URL — use the 3-step upload flow instead - 429 - 500 - 502Source URL unreachable or upstream image service unavailable - 504Source URL timed out (over 30 s) ## More in Media - [List media](https://posteverywhere.ai/docs/api/list-media) - [Upload media](https://posteverywhere.ai/docs/api/init-media-upload) - [Get media](https://posteverywhere.ai/docs/api/get-media) - [Delete media](https://posteverywhere.ai/docs/api/delete-media) - [Finalise upload](https://posteverywhere.ai/docs/api/complete-media-upload) [← Upload media](https://posteverywhere.ai/docs/api/init-media-upload)[Get media →](https://posteverywhere.ai/docs/api/get-media)[← All endpoints](https://posteverywhere.ai/docs/api/reference)