Media APIAPI

Upload once, publish anywhere

Send a file to the media library and get back an id. Attach that id to any number of posts and FoPost converts and delivers it in the shape each network wants. Storage is private and scoped to the workspace.

POST /v1/media
curl -X POST https://api.fopost.com/v1/media \
  -H "X-API-Key: $API_KEY" \
  -F "workspaceId=9b2f6c1e-..." \
  -F "[email protected]"

{
  "id": "med_01j8...",
  "type": "image",
  "mimeType": "image/png",
  "width": 1600,
  "height": 900,
  "size": 412883
}

Multipart upload

Images and video up to 50 MB, validated by content, not just extension.

Reuse by id

One upload, any number of posts. The file is never sent twice.

Private by default

Files live in private storage and are served only to workspace members.

Upload

One way in, checked on arrival

Every file goes through the same path: MIME allowlist, a check of the actual bytes, a size ceiling, and your account’s free storage allowance. What comes back is a library row with dimensions and type, ready to attach.

Read the media reference
Attach to a post
curl -X POST https://api.fopost.com/v1/posts \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "9b2f6c1e-...",
    "status": "published",
    "content": [{ "text": "Launch day.", "position": 0, "media": ["med_01j8..."] }],
    "accounts": [{ "id": "4a71d80b-..." }]
  }'

Images

PNG, JPEG, GIF, and WebP, with dimensions read on upload.

Video

MP4 and MOV, with duration and size checked against each network at publish time.

Validated

The file’s real content must match its type, or the upload is rejected.

Deliver

The right format for each network, done for you

Networks disagree about aspect ratios, sizes, and codecs. At publish time each adapter takes the stored original and uploads what that platform accepts, so a single library asset works on a carousel, a thread, and a short video feed alike.

See how delivery works
Brand images organised in the shared media library

Per-network rules

Size and format limits are applied by the adapter, not by you.

Ordered media

The order in the content block is the order of the carousel.

Clear failures

A file a network cannot take fails that delivery with the reason, not the whole post.

Manage

Browse, fetch, and reuse the library

List the library with filters, fetch any asset through a file endpoint that checks workspace membership on every request and never expires, and reference the same id from as many posts as you like. Brand assets, imports, and generated images all land in the same library.

Start building
GET /v1/media
curl "https://api.fopost.com/v1/media?workspaceId=9b2f6c1e-...&type=image" \
  -H "X-API-Key: $API_KEY"

# Fetch the file itself
curl -L "https://api.fopost.com/v1/media/med_01j8.../file" \
  -H "X-API-Key: $API_KEY" -o launch.png

List and filter

By type, origin, or brand role, with pagination.

Stable file URL

/v1/media/:id/file always works for members; no signed links to refresh.

Workspace scoped

A key sees one workspace’s library and nothing else.

Media API questions, answered

What is the size limit?

50 MB per file. Individual networks have their own ceilings, and those are checked when a post is delivered to that network.

Which formats are accepted?

Common image formats (PNG, JPEG, GIF, WebP) and video (MP4, MOV). The upload checks the actual file bytes, so a renamed file is rejected.

Can I attach a media id to more than one post?

Yes. That is the point of the library. Upload once and reference the id from any post in the workspace.

Are uploaded files public?

No. Storage is private. The file endpoint checks workspace membership on every request, and networks receive a short-lived link only at publish time.

Does it count against a quota?

Yes, every account includes a free storage allowance, and storage past it is metered per GB per month with a card on file. Every upload, import, and generated image counts toward it in the same way.

Can I import from a URL or a design tool?

Yes, imports arrive through the same library and carry a source reference, so you can re-pull an updated design in place instead of uploading a new file.

Build on the Media API today

Starting is free and the full API is included. Create a key and make your first call in minutes.

Get your API key