---
title: "Ingest media from a public URL"
method: POST
path: "/media/from-url"
tags: ["Media"]
---

# Ingest media from a public URL

`POST /media/from-url`

## Request

- Base URL: `https://socialrobot.io/api/v1`
- URL: `https://socialrobot.io/api/v1/media/from-url`
- Auth: API key in header `x-api-key`

Fallback when the caller cannot PUT to a presigned URL. SocialRobot fetches a public https image/video URL, or a ChatGPT client-injected file.download_url, and stores it. Do not send file://, workspace paths, or placeholder hosts such as example.com. Prefer POST /media/upload-url plus PUT when the client can upload itself. Max 50MB.

## Request body

- object
  - `sourceUrl` string: Public https URL that already serves this image or video. Do not invent a URL, and do not use example.com. Do not pass file:// or workspace paths. Use only when you cannot PUT to the presigned URL from get_media_upload_url.
  - `file` union: Leave unset. The ChatGPT client fills this when the user attaches a file. Do not build download_url from a local path. If you have the bytes, call get_media_upload_url and PUT them.
    - object
      - `download_url` string, required: https URL injected by the ChatGPT client. Do not set this yourself. Never pass file://, blob:, /workspace, or any path on your machine.
      - `file_id` string, required: Stable ChatGPT file id
      - `mime_type` string: MIME type when ChatGPT provides one
      - `file_name` string: Original filename when ChatGPT provides one
    - object[]
      - `download_url` string, required: https URL injected by the ChatGPT client. Do not set this yourself. Never pass file://, blob:, /workspace, or any path on your machine.
      - `file_id` string, required: Stable ChatGPT file id
      - `mime_type` string: MIME type when ChatGPT provides one
      - `file_name` string: Original filename when ChatGPT provides one
  - `filename` string: Original filename including extension, if the source URL has none
  - `contentType` string: MIME type hint when the source does not send one

## Response `200`

Media stored successfully

- object
  - `key` string, required: The storage key for the uploaded media
  - `url` string, required: The public URL to pass into create_post
  - `contentType` string, required: The stored MIME type

## Other responses

- `400`: Invalid request data
- `401`: Unauthorized - Invalid or missing API key
- `500`: Internal server error

---

[API](https://skmtc.dev/socialrobot/apis/socialrobot-io-scheduler-api.md) · [All operations](https://skmtc.dev/socialrobot/apis/socialrobot-io-scheduler-api/llms.txt) · [OpenAPI document](https://skmtc.dev/socialrobot/apis/socialrobot-io-scheduler-api/revisions/c2e9cdf5e75e?raw)
