FoPost Media API

Upload and manage media files

GitHub OpenAPI

Operations 6

GET /v1/media List media library items #
POST /v1/media/upload Upload media files #
GET /v1/media/limits Upload limits #
POST /v1/media/presign Sign a direct upload #
POST /v1/media/presign/{uploadId}/complete Complete a direct upload #
DELETE /v1/media/{id} Delete a media item #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/fopost-com:fopost-com-media-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

fopost-com-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: FoPost Media API
  version: 1.0.0
  description: 'REST API for FoPost — schedule, publish, and analyze social media content across every connected platform.


    ## Authentication


    Programmatic access uses an API key sent in the `X-API-Key` header. Keys are created in the FoPost dashboard under **Developers → API Keys** and are limited to the scopes granted at creation. Requests from the FoPost dashboard use a JWT bearer token instead (`Authorization: Bearer `), which implicitly carries all scopes. Either method works on every endpoint in this document unless noted otherwise.


    ## Scopes


    Each operation lists its required scope (also machine-readable as `x-fopost-scope`): `posts` (includes publishing, deliveries, and media), `workspaces`, `accounts`, `labels`, `webhooks`, `analytics`, `automations`.


    ## Responses


    Every key in a response body and every query parameter is snake_case; request bodies keep the field names documented on each operation. The ads endpoints (`/v1/ads/*`) are the one exception and keep camelCase keys. A single resource is returned as the object itself (`201` on create); a collection is `{ "data": [...], "meta": {...} }`. A success with nothing to return is `204` with an empty body.


    ## Errors


    Errors return `{ "error": "", "message": "" }` with a matching HTTP status, including an unknown route (`404 not_found`) and a server fault (`500 internal_error`). `error` is a stable snake_case code; `message` is for humans and may change. Some errors include additional context fields. A feature that is not set up on this deployment answers `503 not_configured`; a malformed answer from an upstream provider answers `502 upstream_error`.


    ## Request ids


    Every response carries an `X-Request-Id` header. Quote it when contacting support about a specific request.


    ## Rate limiting


    Requests are rate limited per API key, per minute, with a ceiling set by the plan behind the key. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`; exceeding the limit returns `429` with error code `too_many_requests`, a `retry_after` field and a `Retry-After` header. Mutating endpoints additionally require an active subscription and return `403` with error code `subscription_required` without one.


    ## Pagination


    Offset-paged lists accept `page` and `per_page` (1 to 100) and return `meta: { page, per_page, total, total_pages }`. Cursor-paged lists return `meta: { next_cursor, has_more }`; pass `next_cursor` back in the cursor parameter the operation documents until `has_more` is false. Lists that do not paginate return `{ "data": [...] }` with no `meta`.'
  contact:
    name: FoPost Support
    url: https://fopost.com/contact
  license:
    name: Proprietary
    url: https://fopost.com/terms
servers:
- url: https://api.fopost.com
  description: Production
security:
- ApiKeyAuth: []
- BearerAuth: []
- OAuth2: []
tags:
- name: Media
  description: Upload and manage media files
paths:
  /v1/media:
    get:
      operationId: listMedia
      summary: List media library items
      tags:
      - Media
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/MediaLibraryItem'
                  meta:
                    $ref: '#/components/schemas/PageMeta'
                required:
                - data
                - meta
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      description: 'Newest first. Without `workspace_id` the list spans every workspace the caller belongs to.


        Requires the `posts` scope when using an API key.'
      x-fopost-scope: posts
      parameters:
      - name: workspace_id
        in: query
        required: false
        schema:
          type: string
          format: uuid
        description: Workspace to list media for
      - name: folder_id
        in: query
        required: false
        schema:
          type: string
        description: Folder to list; `root` for unfiled assets
      - name: search
        in: query
        required: false
        schema:
          type: string
        description: Match the filename or a tag
      - name: tag
        in: query
        required: false
        schema:
          type: string
      - name: type
        in: query
        required: false
        schema:
          type: string
          enum:
          - image
          - video
          - gif
          - document
      - name: url
        in: query
        required: false
        schema:
          type: string
        description: Exact stored URL
      - name: brand_role
        in: query
        required: false
        schema:
          type: string
          enum:
          - logo
          - product
          - person
          - background
      - name: brand_voice_id
        in: query
        required: false
        schema:
          type: string
          format: uuid
      - name: generation_run_id
        in: query
        required: false
        schema:
          type: string
      - name: origin
        in: query
        required: false
        schema:
          type: string
      - name: shared
        in: query
        required: false
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
        description: '`true` lists only shared assets and adds each one''s `share` link'
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          default: 1
      - name: per_page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 200
          default: 60
  /v1/media/upload:
    post:
      operationId: uploadMedia
      summary: Upload media files
      tags:
      - Media
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UploadedMedia'
                required:
                - data
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '413':
          description: A file is over the account ceiling or the 100 MB multipart ceiling (`file_too_large`, with `max_file_bytes`), or over the storage allowance (`storage_limit_reached`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '429':
          $ref: '#/components/responses/RateLimited'
      description: 'Accepts up to 5 files as multipart/form-data under the `files` field, each within the account ceiling (`GET /v1/media/limits`) and the 100 MB this route carries; a larger file goes through direct upload. Allowed types: jpeg, png, gif, webp, mp4, mov, webm, pdf, txt, csv. File content is verified against the declared type. When `workspaceId` is provided the files are also saved to the media library.


        Requires the `posts` scope when using an API key.


        Requires an active subscription; without one the request fails with 403 `subscription_required`.'
      x-fopost-scope: posts
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                workspaceId:
                  type: string
                  format: uuid
              required:
              - files
  /v1/media/limits:
    get:
      operationId: getUploadLimits
      summary: Upload limits
      tags:
      - Media
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadLimits'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      description: 'The largest file this account may upload and what set that ceiling, plus the per-file ceiling of a multipart request. Read it before uploading to pick the route and to tell the user the real limit.


        Requires the `posts` scope when using an API key.'
      x-fopost-scope: posts
      parameters:
      - name: workspace_id
        in: query
        required: false
        schema:
          type: string
          format: uuid
        description: Resolve the ceiling for this workspace’s billing account
  /v1/media/presign:
    post:
      operationId: presignMediaUpload
      summary: Sign a direct upload
      tags:
      - Media
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PresignedUpload'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          description: The file is over the account ceiling (`file_too_large`, with `max_file_bytes`) or would exceed the storage allowance (`storage_limit_reached`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: Direct upload is not set up on this deployment (`not_configured`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
      description: 'Returns a signed URL for one file up to the account ceiling (`GET /v1/media/limits`, at most 5 GB), same allowed types as upload. PUT the raw bytes to `upload_url` with exactly the returned headers and a `Content-Length` equal to `size`, then call the complete step. Nothing appears in the library until completion validates the object. An upload that is never completed is discarded after 24 hours.


        Requires the `posts` scope when using an API key.


        Requires an active subscription; without one the request fails with 403 `subscription_required`.'
      x-fopost-scope: posts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspaceId:
                  type: string
                  format: uuid
                filename:
                  type: string
                  maxLength: 255
                mimeType:
                  type: string
                  description: 'One of: jpeg, png, gif, webp, mp4, mov, webm, pdf, txt, csv'
                size:
                  type: integer
                  minimum: 1
                  maximum: 5368709120
                  description: Bytes
                folderId:
                  type: string
                  format: uuid
                  description: Library folder to file the item under
                origin:
                  type: string
                  enum:
                  - chat
                  description: Keep the file out of the library (chat attachment)
                brandRole:
                  type: string
                  enum:
                  - logo
                  - product
                  - person
                  - background
                brandVoiceId:
                  type: string
                  format: uuid
                personConsent:
                  type: object
                  description: Required with brandRole=person
                  properties:
                    subject:
                      type: string
                    statement:
                      type: string
              required:
              - workspaceId
              - filename
              - mimeType
              - size
  /v1/media/presign/{uploadId}/complete:
    post:
      operationId: completeMediaUpload
      summary: Complete a direct upload
      tags:
      - Media
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedMedia'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          description: Nothing was uploaded (`upload_missing`) or the content does not match the declared type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Already completed (`upload_already_completed`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '410':
          description: The upload expired (`upload_expired`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '413':
          description: The object is over the account ceiling (`file_too_large`) or would exceed the storage allowance (`storage_limit_reached`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '429':
          $ref: '#/components/responses/RateLimited'
      description: 'Validates the object that was PUT to the signed URL (type, content, size, storage allowance) exactly like an upload and moves it into the media library. A refused object is deleted. Answers `409` if already completed and `410` once expired.


        Requires the `posts` scope when using an API key.


        Requires an active subscription; without one the request fails with 403 `subscription_required`.'
      x-fopost-scope: posts
      parameters:
      - name: uploadId
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Upload id from the presign step
  /v1/media/{id}:
    delete:
      operationId: deleteMedia
      summary: Delete a media item
      tags:
      - Media
      responses:
        '204':
          description: Deleted
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      description: 'Removes the stored file and the media library record.


        Requires the `posts` scope when using an API key.'
      x-fopost-scope: posts
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Media library id
components:
  schemas:
    PresignedUpload:
      type: object
      properties:
        upload_id:
          type: string
          format: uuid
          description: Pass to the complete step
        upload_url:
          type: string
          format: uri
          description: PUT the raw bytes here
        method:
          type: string
          enum:
          - PUT
        headers:
          type: object
          additionalProperties:
            type: string
          description: Headers the PUT must carry exactly (Content-Type)
        expires_at:
          type: string
          format: date-time
          description: When the signed URL stops accepting the PUT
        max_file_bytes:
          type: integer
          description: The account ceiling the file was checked against
      required:
      - upload_id
      - upload_url
      - method
      - headers
      - expires_at
      - max_file_bytes
    MediaLibraryItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workspace_id:
          type: string
          format: uuid
        name:
          type: string
        url:
          type: string
          format: uri
          description: The asset's identity; store this on a post
        visibility:
          type: string
          enum:
          - private
          - public
        type:
          type: string
          enum:
          - image
          - video
          - gif
          - document
        mime_type:
          type: string
        size:
          type: integer
          description: File size in bytes
        alt_text:
          type:
          - string
          - 'null'
        alt_text_source:
          type:
          - string
          - 'null'
        tags:
          type: array
          items:
            type: string
        folder_id:
          type:
          - string
          - 'null'
          format: uuid
        origin:
          type:
          - string
          - 'null'
        source_url:
          type:
          - string
          - 'null'
        synced_at:
          type:
          - string
          - 'null'
          format: date-time
        brand_role:
          type:
          - string
          - 'null'
          enum:
          - logo
          - product
          - person
          - background
          - null
        brand_voice_id:
          type:
          - string
          - 'null'
          format: uuid
        generation_run_id:
          type:
          - string
          - 'null'
        has_person_consent:
          type: boolean
        created_at:
          type: string
          format: date-time
        preview_url:
          type: string
          description: Permanent, membership-checked read URL
        share:
          type:
          - object
          - 'null'
          description: The live share link; present only with `shared=true`
          properties:
            url:
              type: string
            created_at:
              type: string
              format: date-time
            created_by_name:
              type:
              - string
              - 'null'
            source:
              type: string
      required:
      - id
      - workspace_id
      - name
      - url
      - type
      - size
      - created_at
      - preview_url
    Error:
      type: object
      properties:
        error:
          type: string
          description: Stable snake_case error code
        message:
          type: string
          description: Human-readable explanation; may change
      required:
      - error
      - message
      additionalProperties: true
      description: The one error envelope, on every endpoint including an unknown route (`not_found`) and a server fault (`internal_error`). Some errors carry additional context fields (for example `retry_after`, `upgrade_url`, `issues`). Every response also carries an `X-Request-Id` header to quote to support.
    PageMeta:
      type: object
      properties:
        page:
          type: integer
        per_page:
          type: integer
        total:
          type: integer
        total_pages:
          type: integer
          description: At least 1, so an empty list is one empty page
      required:
      - page
      - per_page
      - total
      - total_pages
    UploadLimits:
      type: object
      properties:
        max_file_bytes:
          type: integer
          description: The largest file this account may upload, by any route. Grows with the connected-account count (100 MB up to 2 accounts, 400 MB up to 7, 2 GB up to 15, 5 GB beyond) and is 5 GB with the Large Uploads add-on.
        source:
          type: string
          enum:
          - accounts
          - add_on
          - bypass
          description: What set the ceiling
        connected_accounts:
          type: integer
        large_uploads_enabled:
          type: boolean
        next_tier:
          type:
          - object
          - 'null'
          properties:
            up_to_accounts:
              type:
              - integer
              - 'null'
            max_file_bytes:
              type: integer
          description: The next ceiling up and the account count that unlocks it; null at the top
        multipart_max_file_bytes:
          type: integer
          description: What a multipart request (`/v1/media/upload`, or a post with files) can carry per file. Larger files go through direct upload.
        max_files_per_upload:
          type: integer
        direct_upload_available:
          type: boolean
        allowed_types:
          type: array
          items:
            type: string
      required:
      - max_file_bytes
      - source
      - connected_accounts
      - large_uploads_enabled
      - multipart_max_file_bytes
      - max_files_per_upload
      - direct_upload_available
      - allowed_types
    UploadedMedia:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Media library id (present when `workspaceId` was provided)
        type:
          type: string
          enum:
          - image
          - video
          - gif
          - document
        name:
          type: string
        url:
          type: string
          format: uri
        preview_url:
          type: string
          format: uri
          description: Permanent, membership-checked read URL
        size:
          type: integer
      required:
      - type
      - name
      - url
      - size
  responses:
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    ValidationError:
      description: Request body or parameters failed validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    NotFound:
      description: Resource not found or not accessible to the authenticated user
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    RateLimited:
      description: Too many requests for this API key in the current minute. The body carries `retry_after` (seconds) and the response carries `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
    Forbidden:
      description: The API key lacks the required scope, or a mutating route was called without an active subscription (`subscription_required`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
  headers:
    XRequestId:
      description: Unique id of this request; quote it to support
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key created in the FoPost dashboard. A key may be bound to a single workspace, in which case every request is confined to it: naming any other workspace returns 403, and listings return only that workspace. Keys created without a workspace keep access to every workspace on the account.'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Session token used by the FoPost dashboard
    OAuth2:
      type: oauth2
      description: For third-party apps acting on behalf of a FoPost user. Authorization code with PKCE (S256) is required. The token is confined to the workspace the user approved and to the scopes they granted.
      flows:
        authorizationCode:
          authorizationUrl: https://api.fopost.com/oauth/authorize
          tokenUrl: https://api.fopost.com/oauth/token
          refreshUrl: https://api.fopost.com/oauth/token
          scopes:
            posts: Read and write posts, media and content
            publish: Publish, retry and cancel a post
            accounts: Connected social accounts
            workspaces: List and manage workspaces
            labels: Labels used to organise posts
            webhooks: Webhook endpoints
            analytics: Metrics and insights
            automations: Automation rules and runs
            inbox: Comments, mentions and messages
            ads: Ads, audiences and lead forms across ad networks
            ai: AI features (spends credits)
            extension: Reserved for the browser extension