Media

Upload files, list the media library, and attach media to a post.

Media endpoints use the posts scope, because media only exists to end up on a post.

Upload

POST /v1/media/upload

Send multipart/form-data with the files under the files field:

curl -X POST https://api.fopost.com/v1/media/upload \
  -H "X-API-Key: $FOPOST_API_KEY" \
  -F "[email protected]" \
  -F "workspaceId=7d2b8c11-4e5a-4a8f-b0d9-3c5e6f7a8b90"
LimitValue
Files per request5
Size per file50 MB
Typesjpeg, png, gif, webp, mp4, mov, webm, pdf, txt, csv

The declared type is verified against the actual file contents, so renaming an executable to .png does not get it through.

Pass workspaceId to also save the files to that workspace's media library, where they are reusable and count against the plan's storage allowance. Leave it out for a one-off attachment.

List the library

GET /v1/media

Returns the workspace's library items with their type, name, size, and URL.

Delete

DELETE /v1/media/{id}

Removes the item from the library. Posts that already published with it are unaffected, since the network holds its own copy.

Attaching to a post

Take what upload returns and put it in a content block:

{
  "content": [
    {
      "text": "Doors open Monday.",
      "media": [
        {
          "type": "image",
          "name": "launch.png",
          "url": "https://...",
          "alt": "A storefront with the lights coming on"
        }
      ]
    }
  ]
}

type is image, video, or gif. alt is optional and worth sending: it is what screen readers announce, and several networks surface it.

Each network sets its own limits on count, dimensions, aspect ratio, and duration. FoPost resizes and re-encodes for the target where it can, and preflight tells you when it cannot.

Storage

The library counts against the storage allowance on your plan. A stored URL is an identity, not public access: the bucket is private, and the dashboard renders media through a per-request check rather than a link anyone can pass around.

Next

Related documentation
  • API Overview

    Base URL, envelopes, pagination, and errors for the FoPost REST API.

  • Authentication

    API keys, scopes, and workspace binding.

  • Publishing

    Create a post, target accounts, publish it, and read the per-account result.

  • Scheduling

    Schedule a post, repeat it, and import a batch from a spreadsheet.

  • Accounts

    List connected social accounts, check their health, and refresh credentials.

  • Workspaces

    Workspaces, labels, and how isolation works across them.

  • Analytics

    Overview totals, time series, top posts, demographics, and label roll-ups.

  • Automations

    Trigger and pipeline workflows that publish without a human in the loop.

Was this helpful?

On this page