> ## 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 posts



## OpenAPI

````yaml /api-reference/openapi.json get /v1/posts
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/posts:
    get:
      tags:
        - posts
      summary: List posts
      operationId: PostsController_findAll
      parameters:
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 20
            type: number
        - name: profileId
          required: false
          in: query
          schema:
            type: string
        - name: status
          required: false
          in: query
          schema:
            enum:
              - draft
              - scheduled
              - publishing
              - published
              - partial
              - failed
            type: string
        - name: platform
          required: false
          in: query
          schema:
            type: string
            enum:
              - instagram
              - whatsapp
              - tiktok
              - telegram
              - youtube
              - x
              - facebook
              - meta_ads
              - linkedin
              - threads
              - bluesky
              - google_ads
              - chatgpt_ads
              - tiktok_ads
        - name: search
          required: false
          in: query
          description: Search in the post content
          schema:
            type: string
        - name: scheduledAfter
          required: false
          in: query
          description: Only posts scheduled on or after this date
          schema:
            type: string
        - name: scheduledBefore
          required: false
          in: query
          description: Only posts scheduled on or before this date
          schema:
            type: string
        - name: sort
          required: false
          in: query
          description: >-
            Sort by `createdAt` (newest first) or `scheduledFor` (queue order,
            soonest first)
          schema:
            default: createdAt
            enum:
              - createdAt
              - scheduledFor
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  posts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Post'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - posts
                  - pagination
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - api-key: []
components:
  schemas:
    Post:
      type: object
      description: >-
        A post. Note: posts, accounts, profiles, webhooks, engagement items and
        places use `_id`; every other resource uses `id`.
      properties:
        _id:
          type: string
          example: cm3post000001
        userId:
          type: string
          description: Workspace owner id.
        profileId:
          type: string
          example: cm3prof000001
        title:
          type: string
          nullable: true
          description: YouTube title / internal title.
        content:
          type: string
          example: New drop is live 🚀
        mediaItems:
          type: array
          items:
            $ref: '#/components/schemas/MediaItem'
        platforms:
          type: array
          items:
            $ref: '#/components/schemas/PlatformTarget'
          description: One entry per targeted account, with its own status.
        status:
          type: string
          example: scheduled
          description: >-
            `partial` = some targets published, some failed. Follow per-target
            status in `platforms[]`.
          enum:
            - draft
            - scheduled
            - publishing
            - published
            - partial
            - failed
        scheduledFor:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
          nullable: true
        timezone:
          type: string
          nullable: true
          example: Europe/Paris
        publishedAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
          nullable: true
        asDraft:
          type: boolean
        trialReel:
          type: boolean
          description: Instagram trial reel.
        asStory:
          type: boolean
          description: 'Instagram: published as a story.'
        trialGraduation:
          type: string
          description: 'Instagram trial reels: how the reel graduates to the feed.'
          enum:
            - MANUAL
            - SS_PERFORMANCE
        shareToFeed:
          type: boolean
          description: 'Instagram reels: also shown in the grid.'
        allowComment:
          type: boolean
        allowDuet:
          type: boolean
          description: TikTok.
        allowStitch:
          type: boolean
          description: TikTok.
        tiktokPrivacyLevel:
          type: string
          description: >-
            TikTok visibility picked by the creator (one of the account
            `publish-options`).
        promotionalContent:
          type: boolean
          description: TikTok commercial disclosure.
        paidPartnership:
          type: boolean
        aiGenerated:
          type: boolean
          description: 'TikTok, YouTube: AI-generated content.'
        productTags:
          type: array
          items:
            $ref: '#/components/schemas/ProductTag'
          description: >-
            Instagram shop products to tag. Absent when none were requested
            (never `[]`).
        collaborators:
          type: array
          items:
            type: string
          description: Instagram collaborators, without `@`.
        userTags:
          type: array
          items:
            $ref: '#/components/schemas/UserTag'
          description: Instagram user tags.
        locationId:
          type: string
          description: 'Instagram: Facebook Page id of the place.'
        firstComment:
          type: string
          description: 'Instagram, Facebook, Threads: comment posted right after.'
        coverTimestampMs:
          type: integer
          minimum: 0
        coverIndex:
          type: integer
          minimum: 0
          description: TikTok photo carousel cover.
        autoAddMusic:
          type: boolean
          description: TikTok photo carousel.
        youtubeTags:
          type: array
          items:
            type: string
        youtubeCategoryId:
          type: string
        madeForKids:
          type: boolean
        notifySubscribers:
          type: boolean
          description: YouTube.
        replyControl:
          type: string
          description: 'Threads: who can reply.'
          enum:
            - everyone
            - accounts_you_follow
            - mentioned_only
            - parent_post_author_only
            - followers_only
        topicTag:
          type: string
          description: Threads.
        linkAttachment:
          type: string
          format: uri
          description: 'Threads: link preview of a text post.'
        poll:
          $ref: '#/components/schemas/Poll'
        instagramAudio:
          type: object
          description: 'Instagram reel: sound from the Instagram library.'
          properties:
            audioId:
              type: string
            audioVolume:
              type: integer
              minimum: 1
              maximum: 100
            videoVolume:
              type: integer
              minimum: 1
              maximum: 100
          required:
            - audioId
        linkedinVisibility:
          type: string
          enum:
            - PUBLIC
            - CONNECTIONS
            - LOGGED_IN
        xReplySettings:
          type: string
          enum:
            - following
            - mentionedUsers
            - subscribers
            - verified
        privacy:
          type: string
          example: public
          enum:
            - public
            - unlisted
            - private
        createdAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
      required:
        - _id
        - profileId
        - title
        - content
        - mediaItems
        - platforms
        - status
        - scheduledFor
        - timezone
        - publishedAt
        - asDraft
        - trialReel
        - asStory
        - trialGraduation
        - shareToFeed
        - allowComment
        - allowDuet
        - allowStitch
        - promotionalContent
        - paidPartnership
        - aiGenerated
        - autoAddMusic
        - notifySubscribers
        - privacy
        - createdAt
        - updatedAt
    Pagination:
      type: object
      description: Page-based pagination (`?page=&limit=`).
      properties:
        page:
          type: integer
          minimum: 1
          example: 1
        limit:
          type: integer
          minimum: 1
          maximum: 100
          example: 20
        total:
          type: integer
          minimum: 0
          example: 42
        pages:
          type: integer
          minimum: 0
          example: 3
          description: Number of pages; 0 for an empty list.
        hasMore:
          type: boolean
          example: true
          description: True when at least one page follows this one.
      required:
        - page
        - limit
        - total
        - pages
        - hasMore
    MediaItem:
      type: object
      properties:
        type:
          type: string
          example: image
          enum:
            - image
            - video
            - gif
            - document
        url:
          type: string
          format: uri
          example: https://api.plugkit.co/v1/media/file/3f1c.jpg
        altText:
          type: string
        thumbnail:
          type: string
          format: uri
        filename:
          type: string
          example: launch.jpg
        mimeType:
          type: string
          example: image/jpeg
      required:
        - type
        - url
    PlatformTarget:
      type: object
      properties:
        platform:
          type: string
          example: instagram
          enum:
            - instagram
            - whatsapp
            - tiktok
            - telegram
            - youtube
            - x
            - facebook
            - meta_ads
            - linkedin
            - threads
            - bluesky
            - google_ads
            - chatgpt_ads
            - tiktok_ads
        accountId:
          type: string
          example: cm3acc0000001
        accountUsername:
          type: string
          example: acme
        customContent:
          type: string
          description: Per-target caption override. Absent when not overridden.
        customMedia:
          type: array
          items:
            $ref: '#/components/schemas/MediaItem'
          description: Per-target media override. Absent when not overridden.
        status:
          type: string
          example: published
          enum:
            - pending
            - published
            - failed
            - deleted
        platformPostId:
          type: string
          nullable: true
          example: '17912345678901234'
        platformPostUrl:
          type: string
          format: uri
          example: https://www.instagram.com/p/DAbc123/
          nullable: true
        publishedAt:
          type: string
          format: date-time
          example: '2026-11-10T09:30:00.000Z'
          nullable: true
        canUnpublish:
          type: boolean
          description: >-
            True when `POST /posts/{id}/unpublish` can remove it from the
            platform.
        errorMessage:
          type: string
          description: 'Only on `failed`: the platform message, verbatim.'
        errorCategory:
          type: string
          description: 'Only on `failed`: stable classification of the error.'
          enum:
            - auth_expired
            - billing
            - user_content
            - user_abuse
            - account_issue
            - platform_rejected
            - platform_error
            - system_error
            - unknown
        errorSource:
          type: string
          description: 'Only on `failed`: who has to act.'
          enum:
            - user
            - platform
            - system
        warning:
          type: string
          description: >-
            Only on a non-failed target: something that was skipped without
            failing the publish (e.g. Instagram products not tagged).
      required:
        - platform
        - accountId
        - status
        - platformPostId
        - platformPostUrl
        - publishedAt
        - canUnpublish
    ProductTag:
      type: object
      properties:
        productId:
          type: string
          example: '7012345678901234'
        x:
          type: number
          minimum: 0
          maximum: 1
        'y':
          type: number
          minimum: 0
          maximum: 1
      required:
        - productId
    UserTag:
      type: object
      properties:
        username:
          type: string
          example: acme
          description: Without the `@`.
        x:
          type: number
          minimum: 0
          maximum: 1
        'y':
          type: number
          minimum: 0
          maximum: 1
      required:
        - username
    Poll:
      type: object
      properties:
        options:
          type: array
          items:
            type: string
          minItems: 2
          example:
            - 'Yes'
            - 'No'
        durationMinutes:
          type: integer
        question:
          type: string
      required:
        - options
    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.