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

# Media

> Attach images and videos to your social media posts.

## Supported media types

| Type      | Common formats      | MIME types accepted on upload                        |
| --------- | ------------------- | ---------------------------------------------------- |
| **Image** | JPG, PNG, GIF, WebP | `image/jpeg`, `image/png`, `image/gif`, `image/webp` |
| **Video** | MP4, MOV            | `video/mp4`, `video/quicktime`                       |

Three upload paths share the same MIME set:

* [`POST /posts/{post}/media`](/api-reference/endpoint/upload-media) — direct upload with a Bearer token, attaches straight to a post.
* [`POST /posts/{post}/media/from-url`](/api-reference/endpoint/attach-media-from-url) — server-side fetch of a public URL.
* [`POST /uploads/{token}`](/api-reference/endpoint/request-media-upload) — one-shot **signed URL** issued by the MCP [`request-media-upload-tool`](/ai/tools-reference#posts) flow. Used by AI agents to upload local files without provisioning an API key.

WebM is intentionally excluded — every major social platform rejects it, so accepting it would just produce platform-specific publish failures.

## Upload limits

| Type                  | Default cap               | Override (self-hosted)    |
| --------------------- | ------------------------- | ------------------------- |
| Image                 | 10 MB per file            | `MEDIA_IMAGE_MAX_SIZE_MB` |
| Video                 | 1 GB per file             | `MEDIA_VIDEO_MAX_SIZE_MB` |
| MCP signed-URL upload | 50 MB per file (any type) | `MCP_UPLOAD_MAX_SIZE_MB`  |

Files over 1 MB are sent in chunks (the dashboard streams them via `Content-Range` to the chunked upload endpoint) so big videos transfer reliably even on flaky connections. On self-hosted instances, raising the video cap also requires bumping PHP's `upload_max_filesize` / `post_max_size` and any reverse-proxy body-size cap to match.

The MCP upload path uses a tighter cap on purpose — files route through the app server before being written to the configured storage disk, so a smaller ceiling keeps a single worker from being tied up by huge transfers. Each signed URL is single-use and expires after 15 minutes (configurable via `MCP_UPLOAD_URL_TTL_MINUTES`).

## Platform content types and media requirements

Each platform supports different content formats with specific media requirements. Use [`GET /content-types`](/api-reference/endpoint/list-content-types) for the live, machine-readable version.

### LinkedIn / LinkedIn Page

| Content type                                   | Media    | Max files          | Notes                                  |
| ---------------------------------------------- | -------- | ------------------ | -------------------------------------- |
| `linkedin_post` / `linkedin_page_post`         | Optional | 1 image or 1 video | Standard text post with optional media |
| `linkedin_carousel` / `linkedin_page_carousel` | Required | Up to 20 images    | Multi-image swipeable post             |

### X (Twitter)

| Content type | Media    | Max files           | Notes                                                        |
| ------------ | -------- | ------------------- | ------------------------------------------------------------ |
| `x_post`     | Optional | 4 images or 1 video | X's API doesn't accept images + video mixed in the same post |

### Facebook

| Content type     | Media    | Max files            | Aspect | Notes                     |
| ---------------- | -------- | -------------------- | ------ | ------------------------- |
| `facebook_post`  | Optional | 10 images or 1 video | —      | Standard page post        |
| `facebook_reel`  | Required | 1 video              | 9:16   | Short-form vertical video |
| `facebook_story` | Required | 1 image or 1 video   | 9:16   | Disappears after 24 hours |

### Instagram (and Instagram via Facebook)

| Content type         | Media    | Max files          | Aspect | Notes                                                                  |
| -------------------- | -------- | ------------------ | ------ | ---------------------------------------------------------------------- |
| `instagram_feed`     | Required | 1 image or 1 video | 4:5    | Single-asset feed post — Instagram rejects empty posts at publish time |
| `instagram_carousel` | Required | Up to 10 images    | 4:5    | Swipeable feed carousel (images only)                                  |
| `instagram_reel`     | Required | 1 video            | 9:16   | Short-form vertical video                                              |
| `instagram_story`    | Required | 1 image or 1 video | 9:16   | Disappears after 24 hours                                              |

### TikTok

| Content type   | Media    | Max files       | Aspect | Notes                                  |
| -------------- | -------- | --------------- | ------ | -------------------------------------- |
| `tiktok_video` | Required | 1 video         | 9:16   | Short or long-form video               |
| `tiktok_photo` | Required | Up to 35 images | 1:1    | Photo carousel — images only, no video |

### YouTube

| Content type    | Media    | Max files | Aspect | Notes          |
| --------------- | -------- | --------- | ------ | -------------- |
| `youtube_short` | Required | 1 video   | 9:16   | Vertical short |

### Threads

| Content type   | Media    | Max files                  | Notes                         |
| -------------- | -------- | -------------------------- | ----------------------------- |
| `threads_post` | Optional | Up to 10 images or 1 video | Text post with optional media |

### Pinterest

| Content type          | Media    | Max files      | Aspect | Notes                     |
| --------------------- | -------- | -------------- | ------ | ------------------------- |
| `pinterest_pin`       | Required | 1 image        | 2:3    | Standard image pin        |
| `pinterest_video_pin` | Required | 1 video        | 9:16   | Video pin                 |
| `pinterest_carousel`  | Required | Up to 5 images | 2:3    | Multi-image swipeable pin |

### Bluesky

| Content type   | Media    | Max files                 | Notes                         |
| -------------- | -------- | ------------------------- | ----------------------------- |
| `bluesky_post` | Optional | Up to 4 images or 1 video | Text post with optional media |

### Mastodon

| Content type    | Media    | Max files                 | Notes                         |
| --------------- | -------- | ------------------------- | ----------------------------- |
| `mastodon_post` | Optional | Up to 4 images or 1 video | Text post with optional media |

### Telegram

| Content type    | Media    | Max files              | Notes                                      |
| --------------- | -------- | ---------------------- | ------------------------------------------ |
| `telegram_post` | Optional | Up to 10 images/videos | Text post; multiple media sent as an album |

### Discord

| Content type      | Media    | Max files              | Notes                                              |
| ----------------- | -------- | ---------------------- | -------------------------------------------------- |
| `discord_message` | Optional | Up to 10 images/videos | Channel message; supports mentions and rich embeds |

## Media ordering

Drag attachments in the post editor to reorder them. The order you set is the order they'll appear on the social platform — important for carousels and multi-image posts.

## File storage

Media files are stored on the disk configured by `FILESYSTEM_DISK`. Out of the box, TryPost ships with these drivers:

| Driver   | Use case                                                                                                  |
| -------- | --------------------------------------------------------------------------------------------------------- |
| `public` | Self-hosted setups serving files directly from `${APP_URL}/storage` — requires `php artisan storage:link` |
| `s3`     | AWS S3                                                                                                    |
| `r2`     | Cloudflare R2 (S3-compatible — the default in shipped config)                                             |

Any S3-compatible service (MinIO, DigitalOcean Spaces, Backblaze B2) works under the `s3` driver with the right endpoint.

<Note>
  On **TryPost Cloud**, media storage is handled automatically. Self-hosted users should configure cloud storage for production — see the [Configuration guide](/self-hosting/configuration).
</Note>

## FAQ

<AccordionGroup>
  <Accordion title="What's the maximum file size?">
    10 MB per image and 1 GB per video by default. Files over 1 MB are sent through the chunked upload endpoint via `Content-Range` headers. Self-hosters can raise the caps with `MEDIA_IMAGE_MAX_SIZE_MB` / `MEDIA_VIDEO_MAX_SIZE_MB`.
  </Accordion>

  <Accordion title="Can I use the same media in multiple posts?">
    Each post stores its own media records. To reuse the same image, upload it again or copy from the asset library.
  </Accordion>

  <Accordion title="What happens to media when I delete a post?">
    The media records are removed along with the post.
  </Accordion>

  <Accordion title="Are images compressed or resized?">
    TryPost uploads media to social platforms as-is. Each platform applies its own compression and resizing rules afterwards.
  </Accordion>
</AccordionGroup>
