> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postbase.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Media

> List and add the images and videos you can attach to posts.

## List media

```bash theme={null}
curl "https://www.postbase.so/api/v1/media?type=video" \
  -H "Authorization: Bearer pb_live_…"
```

`GET /media` returns the newest 50 files in your workspace's media library.
Filter with `?type=image` or `?type=video`, and `?search=` to match part of a
file name. Pass the `id` values as `media_ids` when [creating a post](/api/posts).

```json Response theme={null}
{
  "media": [
    {
      "id": "…",
      "name": "launch.mp4",
      "type": "video/mp4",
      "size_bytes": 18350212,
      "url": "https://…",
      "created_at": "2026-10-08T09:00:00.000Z"
    }
  ]
}
```

## Add media from a URL

```bash theme={null}
curl -X POST https://www.postbase.so/api/v1/media \
  -H "Authorization: Bearer pb_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/launch.png", "name": "Launch banner" }'
```

`POST /media` downloads a file from a public `https://` link into your media
library and returns it (`201 Created`, same shape as above). JPG, PNG, WebP,
GIF, MP4, MOV or WebM, up to 200 MB. `name` is optional and defaults to the
file name in the link. Links to private or internal addresses are refused.

You can skip this step: `media_urls` on [create](/api/posts#create-a-post) and
[edit](/api/posts#edit-a-post) does the same for each link. Files count toward
your plan's storage, and up to 60 files an hour can be added from links per
workspace. Bigger files can be uploaded in the Postbase app (**Media**), up to
1 GB.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.