postcache Media API

The Media API from postcache — 3 operation(s) for media.

GitHub OpenAPI

Operations 4

PUT /v1/media Upload a file #
POST /v1/media/from-url Upload a file from a public URL #
GET /v1/media/{id} Status of an upload #
DELETE /v1/media/{id} Delete an upload now #

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/postcache-dev:postcache-dev-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

postcache-dev-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: postcache Media API
  version: 1.0.0
  description: Public, short-lived media URLs for AI agents that post to Instagram, Threads and Facebook. Files are checked against the target platform's media rules; with convert, fixable files are converted in the background.
  contact:
    email: hello@postcache.dev
  x-guidance: 'Upload an image or video for Instagram, Threads or a Facebook Page and get a public HTTPS URL that passes the platform''s media checks. PUT /v1/media with the file as the body and the X-Target header (instagram.feed, instagram.carousel, instagram.reels, instagram.story, threads, facebook.page), or POST /v1/media/from-url with {source_url, target}. Without an API key the first answer is 402: pay 0.01 USD in USDC (x402 on Base or MPP on Tempo) and repeat the request. Add dry_run=1 to check a file for free. Delete the file after posting with DELETE /v1/media/{id} and the x-delete-token from the answer.'
servers:
- url: https://postcache.dev
security:
- bearer: []
tags:
- name: Media
paths:
  /v1/media:
    put:
      summary: Upload a file
      operationId: uploadMedia
      parameters:
      - name: x-target
        in: header
        required: true
        description: Platform the file is for
        schema:
          $ref: '#/components/schemas/Target'
      - name: x-filename
        in: header
        required: false
        description: File name for the URL; the extension follows the stored format
        schema:
          type: string
      - name: ttl
        in: query
        required: false
        description: Seconds the URL stays valid
        schema:
          type: integer
          minimum: 3600
          maximum: 604800
          default: 86400
      - name: convert
        in: query
        required: false
        description: Fix what fails the platform rules
        schema:
          type: string
          enum:
          - crop
          - pad
      - name: dry_run
        in: query
        required: false
        description: Check without storing
        schema:
          type: string
          enum:
          - '1'
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: 'dry_run: checks only, nothing stored'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DryRun'
        '201':
          description: Stored; url is ready for the platform API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        '202':
          description: Queued for conversion; poll GET /v1/media/{id} until status is ready or failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Queued'
        '400':
          description: 'Bad target, ttl or convert, or no body (error: bad_target | bad_ttl | bad_convert | empty)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: File over 1 GiB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Fails the platform rules and conversion was not requested or cannot fix it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChecksFailed'
        '503':
          description: Too many uploads in progress
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: 'Plan limit reached (error: quota_exceeded, upgrade_url, buy_url), or no key: pay per use (error: payment_required; challenges in WWW-Authenticate (MPP) and Payment-Required (x402), 0.01 USD)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Key''s daily cap reached (error: budget_exceeded); Retry-After until 00:00 UTC'
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Payment already used (error: payment_reused)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - bearer: []
      - {}
      x-payment-info:
        price:
          mode: fixed
          currency: USD
          amount: '0.01'
        protocols:
        - x402: {}
        - mpp:
            method: tempo
            intent: charge
            currency: '0x20C000000000000000000000b9537d11c60E8b50'
      tags:
      - Media
  /v1/media/from-url:
    post:
      summary: Upload a file from a public URL
      operationId: uploadMediaFromUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - source_url
              - target
              properties:
                source_url:
                  type: string
                  format: uri
                  description: Public http(s) URL; private and internal addresses are refused
                target:
                  $ref: '#/components/schemas/Target'
                filename:
                  type: string
                ttl:
                  type: integer
                  minimum: 3600
                  maximum: 604800
                convert:
                  type: string
                  enum:
                  - crop
                  - pad
                dry_run:
                  type: boolean
      responses:
        '200':
          description: 'dry_run: checks only, nothing stored'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DryRun'
        '201':
          description: Stored; url is ready for the platform API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        '202':
          description: Queued for conversion; poll GET /v1/media/{id} until status is ready or failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Queued'
        '400':
          description: 'Bad target, ttl, convert or source (error: bad_target | bad_ttl | bad_convert | bad_url | blocked | fetch_failed)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: File over 1 GiB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Fails the platform rules and conversion was not requested or cannot fix it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChecksFailed'
        '503':
          description: Too many uploads in progress
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: 'Plan limit reached (error: quota_exceeded, upgrade_url, buy_url), or no key: pay per use (error: payment_required; challenges in WWW-Authenticate (MPP) and Payment-Required (x402), 0.01 USD)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Key''s daily cap reached (error: budget_exceeded); Retry-After until 00:00 UTC'
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Payment already used (error: payment_reused)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - bearer: []
      - {}
      x-payment-info:
        price:
          mode: fixed
          currency: USD
          amount: '0.01'
        protocols:
        - x402: {}
        - mpp:
            method: tempo
            intent: charge
            currency: '0x20C000000000000000000000b9537d11c60E8b50'
      tags:
      - Media
  /v1/media/{id}:
    parameters:
    - name: id
      in: path
      required: true
      description: Media id
      schema:
        type: string
    get:
      summary: Status of an upload
      operationId: getMedia
      responses:
        '200':
          description: Status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaStatus'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found (or not yours)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      parameters:
      - name: x-delete-token
        in: header
        required: false
        description: 'Pay-per-use uploads: the delete_token from the upload answer, instead of a key'
        schema:
          type: string
      security:
      - bearer: []
      - deleteToken: []
      tags:
      - Media
    delete:
      summary: Delete an upload now
      operationId: deleteMedia
      responses:
        '204':
          description: Deleted
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found (or not yours)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      parameters:
      - name: x-delete-token
        in: header
        required: false
        description: 'Pay-per-use uploads: the delete_token from the upload answer, instead of a key'
        schema:
          type: string
      security:
      - bearer: []
      - deleteToken: []
      tags:
      - Media
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        upgrade_url:
          type: string
          description: Where to change the plan (with quota_exceeded)
    Problem:
      type: object
      properties:
        rule:
          type: string
        message:
          type: string
        fix:
          type: string
    Target:
      type: string
      enum:
      - instagram.feed
      - instagram.carousel
      - instagram.reels
      - instagram.story
      - threads
      - facebook.page
    Queued:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - converting
        target:
          $ref: '#/components/schemas/Target'
        original_checks:
          $ref: '#/components/schemas/Checks'
        status_url:
          type: string
    MediaStatus:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - converting
          - ready
          - failed
          - deleted
        url:
          type:
          - string
          - 'null'
          description: Set only when status is ready
        target:
          $ref: '#/components/schemas/Target'
        content_type:
          type: string
        size:
          type: integer
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        deleted:
          type: boolean
        fetch_count:
          type: integer
        checks:
          $ref: '#/components/schemas/Checks'
        converted:
          type: boolean
        original_checks:
          $ref: '#/components/schemas/Checks'
        failure_reason:
          type: string
          description: Why a conversion failed
    DryRun:
      type: object
      properties:
        dry_run:
          type: boolean
        checks:
          $ref: '#/components/schemas/Checks'
        convertible:
          type: boolean
          description: Present when convert was given
    Checks:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/Target'
        pass:
          type: boolean
        kind:
          type: string
          enum:
          - image
          - video
          - unknown
          - unreadable
        problems:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
        notes:
          type: array
          items:
            type: string
    Media:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - ready
        url:
          type: string
          format: uri
        target:
          $ref: '#/components/schemas/Target'
        content_type:
          type: string
        size:
          type: integer
        expires_at:
          type: string
          format: date-time
        checks:
          $ref: '#/components/schemas/Checks'
    ChecksFailed:
      type: object
      properties:
        error:
          type: string
          enum:
          - checks_failed
        checks:
          $ref: '#/components/schemas/Checks'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: pc_live_... early-access key
    deleteToken:
      type: apiKey
      in: header
      name: x-delete-token
      description: One-time token from a pay-per-use upload answer; reads and deletes that one file