PostNext Media API

Upload and manage media assets

GitHub OpenAPI

Operations 7

POST /api/assets/upload/single Upload a media file #
POST /api/assets/upload/url Upload media from a URL #
POST /api/assets/upload/create-url Request a direct-to-S3 upload URL #
POST /api/assets/upload/complete Complete a direct-to-S3 upload #
GET /api/assets/mine List my assets #
GET /api/assets/{assetId} Get a media asset #
DELETE /api/assets/{assetId} Delete an asset #

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/postnext-io:postnext-io-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

postnext-io-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostNext Public Media API
  version: 1.0.0
  description: 'The PostNext public API lets you connect social channels, create, schedule

    and publish posts, manage media, and read analytics programmatically.


    ## Authentication

    Every request must include your API key in the `x-api-key` header. Each

    account has one key: copy it or regenerate it at

    https://postnext.io/account/api-keys. Regenerating it stops the old key

    working straight away.


    ```bash

    curl -H "x-api-key: YOUR_KEY" https://api-app.postnext.io/api/v1/account

    ```


    ## Response shapes

    Responses are JSON. Most endpoints wrap data in `{ "success": true, "data": ... }`,

    but a few return the payload at the top level for historical reasons; each

    operation below documents its exact shape. Errors are generally

    `{ "success": false, "error": { "message": "..." } }`, with a few endpoints

    adding a machine-readable `code` (noted per operation).


    ## Base URL

    All paths are relative to `https://api-app.postnext.io`. Note the mixed

    prefix: the posts, connections and assets resources are served under `/api`,

    while account and analytics are served under `/api/v1`.'
servers:
- url: https://api-app.postnext.io
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Media
  description: Upload and manage media assets
paths:
  /api/assets/upload/single:
    post:
      tags:
      - Media
      summary: Upload a media file
      description: 'Uploads a single image or video via multipart form data. Only `image/*`

        and `video/*` MIME types are accepted, up to 500 MB. The `userId` form

        field is currently required by the server.'
      operationId: uploadAssetSingle
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              - userId
              properties:
                file:
                  type: string
                  format: binary
                  description: The image or video file.
                userId:
                  type: string
                  description: Your account uniqueId (required by the server).
                displayName:
                  type: string
                description:
                  type: string
                width:
                  type: integer
                height:
                  type: integer
                folderId:
                  type: string
                source:
                  type: string
                  enum:
                  - user_upload
                  - unsplash
                  - pixabay
                  - pexels
                  - brand_scraper
                  - ai_generated
                  - other
                  default: user_upload
      responses:
        '201':
          description: Uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: File uploaded successfully
                  asset:
                    $ref: '#/components/schemas/Asset'
        '400':
          description: No file, or missing userId/teamId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/StorageLimit'
  /api/assets/upload/url:
    post:
      tags:
      - Media
      summary: Upload media from a URL
      description: 'Downloads an image from `imageUrl` and stores it as an asset. `userId` is

        currently required by the server.'
      operationId: uploadAssetFromUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - imageUrl
              - userId
              properties:
                imageUrl:
                  type: string
                  format: uri
                  description: Source image URL.
                userId:
                  type: string
                  description: Your account uniqueId (required by the server).
                displayName:
                  type: string
                description:
                  type: string
                folderId:
                  type: string
                source:
                  type: string
                  enum:
                  - user_upload
                  - unsplash
                  - pixabay
                  - pexels
                  - brand_scraper
                  - ai_generated
                  - other
                  default: user_upload
      responses:
        '201':
          description: Downloaded and stored
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Image downloaded and uploaded successfully
                  asset:
                    $ref: '#/components/schemas/Asset'
        '400':
          description: Missing imageUrl or userId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/StorageLimit'
  /api/assets/upload/create-url:
    post:
      tags:
      - Media
      summary: Request a direct-to-S3 upload URL
      description: 'Step 1 of a 3-step direct upload (create-url -> PUT -> complete). Returns a

        pre-signed S3 PUT URL and an uploadId. Validates the type + declared size

        and pre-charges your storage quota (refunded if you never complete or the

        real file is smaller). Then PUT the bytes to uploadUrl with a matching

        Content-Type header, and call complete.'
      operationId: createUploadUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - filename
              - contentType
              - sizeBytes
              properties:
                filename:
                  type: string
                contentType:
                  type: string
                  enum:
                  - image/jpeg
                  - image/png
                  - image/webp
                  - image/gif
                  - video/mp4
                  - video/webm
                sizeBytes:
                  type: integer
                  description: Declared byte size (<= 50MB and within remaining quota).
      responses:
        '201':
          description: Upload URL issued
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      uploadId:
                        type: string
                      uploadUrl:
                        type: string
                        description: Pre-signed S3 PUT URL.
                      key:
                        type: string
                      expiresInSeconds:
                        type: integer
                        example: 600
        '400':
          description: No current team selected, unsupported contentType, or invalid sizeBytes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/StorageLimit'
        '413':
          description: Declared size exceeds the 50MB per-upload cap
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/assets/upload/complete:
    post:
      tags:
      - Media
      summary: Complete a direct-to-S3 upload
      description: 'Step 3 of the direct upload. Verifies the uploaded object, reconciles the

        storage charge to the real size, moves it to a permanent location, and

        creates the asset. Returns the asset (reference its id in a post).'
      operationId: completeUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - uploadId
              properties:
                uploadId:
                  type: string
      responses:
        '201':
          description: Asset created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/Asset'
        '400':
          description: uploadId is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Session not found/expired, or no uploaded object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Uploaded object is larger than the declared sizeBytes; re-issue create-url with the correct size
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: Uploaded bytes do not match the declared type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/assets/mine:
    get:
      tags:
      - Media
      summary: List my assets
      operationId: getMyAssets
      parameters:
      - name: page
        in: query
        schema:
          type: integer
          default: 1
          minimum: 1
      - name: limit
        in: query
        schema:
          type: integer
          default: 50
          minimum: 1
          maximum: 100
      - name: folderId
        in: query
        schema:
          type: string
        description: Omit for all assets; the literal "null" for root-level only; otherwise a folder id.
      responses:
        '200':
          description: Paginated assets
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Asset'
                  pagination:
                    $ref: '#/components/schemas/AssetPagination'
        '400':
          description: Invalid pagination parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/assets/{assetId}:
    get:
      tags:
      - Media
      summary: Get a media asset
      description: Returns a single asset's metadata (JSON), scoped to your team.
      operationId: getAsset
      parameters:
      - name: assetId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Asset metadata
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/Asset'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Asset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      tags:
      - Media
      summary: Delete an asset
      description: 'Deletes an owned asset. Note: a missing asset currently returns 500

        (not 404) because the not-found case surfaces from a generic catch.'
      operationId: deleteAsset
      parameters:
      - name: assetId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Asset deleted successfully
        '400':
          description: Missing assetId/teamId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
        code:
          type: string
          description: Present on some endpoints only.
    Asset:
      type: object
      properties:
        _id:
          type: string
        teamId:
          type: string
        userId:
          type: string
        folderId:
          type:
          - string
          - 'null'
        name:
          type: string
          description: Stored (S3) filename.
        originalName:
          type: string
        type:
          type: string
          description: MIME type (stored under `type`, not `mimeType`).
        url:
          type: string
          format: uri
        size:
          type: integer
          description: Bytes.
        width:
          type: integer
        height:
          type: integer
        displayName:
          type: string
        source:
          type: string
          enum:
          - user_upload
          - unsplash
          - pixabay
          - pexels
          - brand_scraper
          - ai_generated
          - other
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AssetPagination:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
        hasMore:
          type: boolean
  responses:
    StorageLimit:
      description: Storage limit reached or file exceeds remaining storage
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key