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

# Add media to posts

> Put pictures, videos and documents on posts: links, uploads and media library ids, with their limits, video covers and LinkedIn documents.

A post's `content[].media` takes links, media library ids, or both in one list. Every file ends up in the workspace's media library, so a post never depends on a link staying up.

## Three ways in

| You have | Do this | Key needs |
| - | - | - |
| A public link to the file | Put the link in `content[].media`. It's copied into the library when the post is saved. | `posts:create` |
| A link you want to reuse | [Import it](https://docs.postsyncer.com/api-reference/media/upload-url.md) first, then use the `id` it returns. | `media:create` |
| A file on disk | [Upload it](https://docs.postsyncer.com/api-reference/media/upload-file.md), then use the `id`. | `media:create` |

To find files already in the library, [list media](https://docs.postsyncer.com/api-reference/media/list.md) for the workspace. Its ids work in any post of that workspace.

## Put a link on a post

```json theme={null}
{
  "workspace_id": 4815,
  "schedule_type": "draft",
  "content": [
    {
      "text": "Latte art Fridays are back at Halden Coffee.",
      "media": ["https://cdn.postsyncer.com/examples/latte-art.jpg", 5120]
    }
  ],
  "accounts": [{ "id": 16235 }]
}
```

Here `5120` is a library id and the other entry is a link. The post's answer lists each file as a media object, with its library `id`.

* The link must be public and lead to the file itself. Signed or expiring links are fine, since the file is copied at once.
* Dropbox and Google Drive share links work when anyone with the link can view the file.
* A link to a social post is not a file. Import it first (below) to bring in its pictures and videos.
* If a link can't be used, the save answers `422` naming the link and why, and no post is made.

## Import links into the library

[Import media from links](https://docs.postsyncer.com/api-reference/media/upload-url.md) stores the files now and answers with their ids. Use it to check a link before you build a post on it, or to reuse a file in many posts. Besides links to files, it takes links to public social posts (it stores the post's pictures and videos) and Unsplash photos.

```bash theme={null}
curl -X POST "https://postsyncer.com/api/v1/media/upload/url" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 4815,
    "urls": ["https://cdn.postsyncer.com/examples/latte-art.jpg"]
  }'
```

```json theme={null}
{
  "media": [
    {
      "id": 5121,
      "workspace_id": 4815,
      "folder_id": null,
      "name": "latte-art.jpg",
      "url": "https://cdn.postsyncer.com/examples/latte-art.jpg",
      "mime_type": "image/jpeg",
      "type": "image",
      "is_processing": false
    }
  ],
  "count_stored": 1
}
```

It's all or nothing: if one link can't be used, nothing is stored. One link can return several files, such as a social post with three pictures, so read `count_stored` and every `id`.

To get a social post's files without storing them, [get download links](https://docs.postsyncer.com/api-reference/media/download-url.md) (`POST /media/download/url`). It answers short-lived links grouped as images, videos and audio, and stores nothing. Pass a link you want to keep to the import above.

## Upload a file

Uploads go to their own host, `https://upload.postsyncer.com/api/v1`, as one multipart request.

```bash theme={null}
curl -X POST "https://upload.postsyncer.com/api/v1/media/upload/file" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "workspace_id=4815" \
  -F "file=@latte-art.jpg"
```

It answers `201` with `{ "media": { ... } }`. Add `folder_id` to file it in a [folder](https://docs.postsyncer.com/api-reference/folders/list.md). The type is read from the file's bytes, not its name.

## Types and limits

| Kind | Types the API takes |
| - | - |
| Picture | JPEG, PNG, GIF, WebP |
| Video | MP4, MOV, WebM |
| Document | PDF, DOC, DOCX, PPT, PPTX |

MKV, AVI and other types are refused when they're uploaded or linked. Each network takes only some of these:

* Pictures go to every network except YouTube. Google Business Profile takes JPEG and PNG only.

* MP4 videos go to every network. On Google Business Profile, only a gallery item takes a video. LinkedIn takes MP4 only. Pinterest, Threads, Telegram and a Google Business Profile gallery take MP4 and MOV. X, Instagram, Facebook, TikTok, YouTube, Bluesky and Mastodon take all three, and some convert a video to MP4 before they send it.

* Documents go to LinkedIn only.

* An uploaded file can be up to 500 MB.

* A linked file can be up to 500 MB. All the links in one request must download within 75 seconds together.

* Instagram, TikTok and Pinterest need a picture or a video, and YouTube a video, before a post can be scheduled or published. A Google Business Profile gallery item needs its one photo or video too. A Facebook Story without one is saved, but fails when it's sent.

* Each network has its own rules for how many files, which sizes and how long a video can be. [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md) has the table. Each network's page has the details: [X](https://docs.postsyncer.com/platforms/x.md), [Instagram](https://docs.postsyncer.com/platforms/instagram.md), [Facebook](https://docs.postsyncer.com/platforms/facebook.md), [LinkedIn](https://docs.postsyncer.com/platforms/linkedin.md), [TikTok](https://docs.postsyncer.com/platforms/tiktok.md), [YouTube](https://docs.postsyncer.com/platforms/youtube.md), [Pinterest](https://docs.postsyncer.com/platforms/pinterest.md), [Threads](https://docs.postsyncer.com/platforms/threads.md), [Bluesky](https://docs.postsyncer.com/platforms/bluesky.md), [Mastodon](https://docs.postsyncer.com/platforms/mastodon.md), [Telegram](https://docs.postsyncer.com/platforms/telegram.md) and [Google Business Profile](https://docs.postsyncer.com/platforms/google-business-profile.md).

A refused upload or import answers `422` naming the file or link and why, and nothing is stored. [Error handling](https://docs.postsyncer.com/essentials/error-handling.md#uploads) lists each answer and when to try again.

## LinkedIn documents

A document becomes a LinkedIn document post, the swipeable carousel.

* LinkedIn takes one document a post. Only the first is sent.
* The document must be the first entry in `media`. LinkedIn can't mix it with pictures or videos.
* Other networks in the same post leave the document out and post the text, with any picture or video they take.

## Video covers

Set a video's cover on the first content item with `cover_image`:

| Network | What it takes |
| - | - |
| YouTube, Facebook | `thumbnail`: a picture, as a library id or a link |
| Instagram | `thumbnail` (Reels only), or `video_cover_timestamp_ms`: the moment in the video to use, in milliseconds |
| TikTok | `video_cover_timestamp_ms` only |

```json theme={null}
{
  "text": "How we pour a rosetta.",
  "media": ["https://cdn.postsyncer.com/examples/rosetta-pour.mp4"],
  "cover_image": { "thumbnail": "https://cdn.postsyncer.com/examples/rosetta-cover.jpg" }
}
```

An update that leaves `cover_image` out keeps the cover the item has. `"cover_image": null` removes it.

## Keep the library tidy

* [Delete media](https://docs.postsyncer.com/api-reference/media/delete.md) (`media:delete`) refuses a file while an upcoming post still needs it: a scheduled, queued, repeating or pending-approval post. The answer names the posts. Let them go out, or take the file off them, then delete it.
* [Folders](https://docs.postsyncer.com/api-reference/folders/list.md) group files (`folders:*` permissions). A folder can be deleted only when it's empty.
* The Free plan has no storage cap. Each file has the size limits above.

## Watch a video with AI

[Analyze a video](https://docs.postsyncer.com/api-reference/media/analyze-video.md) watches a public post's video, or a library video, and answers its transcript, on-screen text, scenes and key points, and your `question`. It's on paid plans and uses AI credits by the video's length.

## With MCP

The MCP tools do the same: `list-media`, `get-media`, `upload-media-from-url`, `upload-media-file` (the file as base64), `download-media-from-url`, `delete-media`, `analyze-video` and the folder tools. See the [MCP tools reference](https://docs.postsyncer.com/mcp/tools-reference.md).

## Related

> [card] [Media overview](https://docs.postsyncer.com/api-reference/media/overview.md)
>
> The media endpoints and the media object.

> [card] [Publish a post](https://docs.postsyncer.com/guides/publish-a-post.md)
>
> Drafts, schedules, threads and first comments.


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