> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plugkit.co/llms.txt
> Use this file to discover all available pages before exploring further.

# List the media library



## OpenAPI

````yaml /api-reference/openapi.json get /v1/media
openapi: 3.0.0
info:
  title: PlugKit API
  description: >-
    One API to publish, schedule and message across Instagram, Facebook,
    Threads, WhatsApp, TikTok, Telegram, YouTube, X, LinkedIn and Bluesky — and
    to run Meta and Google ads.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.plugkit.co
security: []
tags: []
paths:
  /v1/media:
    get:
      tags:
        - media
      summary: List the media library
      operationId: MediaController_listLibrary
      parameters:
        - name: type
          required: true
          in: query
          schema:
            type: string
        - name: search
          required: true
          in: query
          schema:
            type: string
        - name: page
          required: true
          in: query
          schema:
            type: string
        - name: limit
          required: true
          in: query
          schema:
            type: string
        - name: includePending
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  media:
                    type: array
                    items:
                      $ref: '#/components/schemas/MediaAsset'
                  pagination:
                    type: object
                    description: Only page, limit and total here (no `pages`/`hasMore`).
                    properties:
                      page:
                        type: integer
                      limit:
                        type: integer
                      total:
                        type: integer
                    required:
                      - page
                      - limit
                      - total
                required:
                  - media
                  - pagination
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - api-key: []
components:
  schemas:
    MediaAsset:
      type: object
      properties:
        id:
          type: string
          example: cm3media00001
        filename:
          type: string
          example: reel-4.mp4
        type:
          type: string
          enum:
            - image
            - video
            - gif
            - document
        mimeType:
          type: string
          nullable: true
          example: video/mp4
        sizeBytes:
          type: integer
          nullable: true
        url:
          type: string
          format: uri
          example: https://api.plugkit.co/v1/media/file/3f1c.mp4
          description: Pass it in `mediaItems[].url`, or the `id` in `mediaIds`.
        status:
          type: string
          description: Upper-case (unlike other enums). `PENDING` = upload not finished.
          enum:
            - PENDING
            - READY
        createdAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
      required:
        - id
        - filename
        - type
        - mimeType
        - sizeBytes
        - url
        - status
        - createdAt
    Error:
      type: object
      description: >-
        Every error response has this shape. The request id is returned in the
        `x-request-id` header, not in the body.
      properties:
        error:
          type: string
          description: >-
            Human-readable message (English). Informative only: branch on `type`
            and `code`.
          example: scheduledFor must be a future date.
        type:
          type: string
          description: Error class, for programmatic branching.
          example: invalid_request_error
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found
            - rate_limit_error
            - platform_error
            - billing_error
            - api_error
        code:
          type: string
          description: >-
            Stable machine code for the precise case (e.g. `validation_failed`,
            `post_not_found`, `rate_limited`, `subscription_required`).
          example: scheduled_in_past
        param:
          type: string
          description: Request field at fault, when there is one.
          example: scheduledFor
        platform:
          type: string
          description: >-
            Upstream platform (meta, tiktok, x…) when `type` is
            `platform_error`.
          example: meta
        platformError:
          type: object
          additionalProperties: true
          description: Raw error payload from the platform, passed through verbatim.
        details:
          type: object
          additionalProperties: true
          description: >-
            Extra structured context. Validation errors carry `details.fields`
            (one message per invalid field); billing errors carry
            `details.action_url`; rate limits carry `details.retryAfter`.
      required:
        - error
        - type
        - code
  responses:
    BadRequest:
      description: >-
        Invalid request. `code` is `validation_failed` for body/query validation
        (one message per field in `details.fields`), or a specific code
        (`invalid_reference`, `unsupported_for_platform`…).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 2 validation errors on the request.
            type: invalid_request_error
            code: validation_failed
            details:
              fields:
                - content should not be empty
                - accountIds must be an array
    Unauthorized:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key.
            type: authentication_error
            code: unauthorized
    RateLimited:
      description: >-
        Too many requests (PlugKit per-minute quota, or the shared platform
        quota nearly exhausted). Wait `retry-after` seconds.
      headers:
        retry-after:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        x-ratelimit-limit:
          description: Requests allowed per minute in this bucket.
          schema:
            type: integer
        x-ratelimit-remaining:
          schema:
            type: integer
        x-ratelimit-reset:
          description: Unix time (seconds) when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Rate limit exceeded: 60 write requests per minute. Retry in 12s.'
            type: rate_limit_error
            code: rate_limited
            details:
              limit: 60
              bucket: write
              retryAfter: 12
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: sk_...
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.