> ## Documentation index
> Fetch the complete documentation index at: https://dash.robopost.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Media

There are two ways to put media in a post: upload the file first and use its ID, or pass a public URL in
the post and let Robopost download it.

**You need:** an [API key](https://dash.robopost.app/docs/api/authentication.md).

## Upload a file

```bash
curl -X POST https://public-api.robopost.app/v1/medias/upload \
  -H "Authorization: Bearer $ROBOPOST_API_KEY" \
  -F "file=@launch.mp4"
```

```json
{ "id": "…", "name": "launch", "extension": "mp4", "storage_object_id": "b1e3…" }
```

Use `storage_object_id` in a post: `image_object_ids: ["…"]`, `video_object_id: "…"` or
`gif_object_id: "…"`. Videos are converted to MP4 when needed and get thumbnails; images are optimized.
The file also appears in the dashboard's [media library](https://dash.robopost.app/docs/posts/media.md).

| Kind | Extensions |
| --- | --- |
| Images | jpg, jpeg, png, bmp, heic, tiff, webp |
| Videos | mp4, mov, webm, mpeg, avi, flv, wmv, 3gp, m4v |

Other extensions get `415`.

## Or pass a URL

Put `image_urls`, `video_url` or `gif_url` in the [create request](https://dash.robopost.app/docs/api/create-posts.md). The URL must
be public and point straight at the file (no login page, no HTML preview). The post stays in status
`preparing_media` until the download finishes. If it fails, the post becomes `failed` with
`MEDIA_DOWNLOAD_FAILED` and the reason.

## Next

[Channels and collections](https://dash.robopost.app/docs/api/channels-and-collections.md)
