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

# List posts

> 20 posts per page.

**Required permission:** `publishing:posts:read`



## OpenAPI

````yaml /api-reference/publishing.openapi.json get /{workspace}/posts
openapi: 3.1.0
info:
  title: Publishing API
  version: 1.0.0
  description: >-
    Social accounts, posts, scheduling, approval, tags and media for one
    workspace.
servers:
  - url: https://{domain}/os/api
    description: Your platform domain
    variables:
      domain:
        default: app.example.com
        description: The domain you sign in to, without https://
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Diagnostics
  - name: Accounts
  - name: Posts
  - name: Media
  - name: Tags
paths:
  /{workspace}/posts:
    get:
      tags:
        - Posts
      summary: List posts
      description: |-
        20 posts per page.

        **Required permission:** `publishing:posts:read`
      operationId: posts.index
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your workspace UUID. Must match the API key's workspace.
        - name: status
          in: query
          schema:
            type: string
          description: Filter by status.
        - name: keyword
          in: query
          schema:
            type: string
          description: Search post content.
        - name: accounts[]
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Only posts for these account `id`s.
        - name: tags[]
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Only posts with these tag `id`s.
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - date_created
              - date_published
        - name: page
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Post'
                  links:
                    type: object
                  meta:
                    type: object
components:
  schemas:
    Post:
      type: object
      properties:
        id:
          type: integer
        uuid:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - draft
            - scheduled
            - publishing
            - published
            - failed
            - needs_approval
            - approval_denied
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/Account'
        versions:
          type: array
          items:
            type: object
            required:
              - account_id
              - is_original
              - content
            properties:
              account_id:
                type: integer
                description: >-
                  `0` for the original version. Otherwise an account `id` that
                  is also in `accounts`, to override the content for that
                  account.
                example: 0
              is_original:
                type: boolean
                description: Only the first version is the original.
                example: true
              content:
                type: array
                minItems: 1
                description: One item per post in a thread. Most posts have a single item.
                items:
                  type: object
                  properties:
                    body:
                      type: string
                      nullable: true
                      example: Our autumn sale starts today!
                    url:
                      type: string
                      nullable: true
                    media:
                      type: array
                      items:
                        type: integer
                      description: Media `id`s from the media library.
              options:
                type: object
                description: >-
                  Network-specific options, keyed by provider (for example a
                  Reddit title).
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        user:
          type: object
          properties:
            name:
              type: string
        scheduled_at:
          type: string
          nullable: true
          description: '`YYYY-MM-DD HH:mm:ss`, UTC'
        published_at:
          type: string
          nullable: true
        partially_published_at:
          type: string
          nullable: true
        failed_at:
          type: string
          nullable: true
        created_at:
          type: string
        trashed:
          type: boolean
    Account:
      type: object
      properties:
        id:
          type: integer
          description: Use this in a post's `accounts`.
        uuid:
          type: string
          format: uuid
        name:
          type: string
        username:
          type: string
        image:
          type: string
        provider:
          type: string
          example: instagram
        data:
          type: object
        authorized:
          type: boolean
        created_at:
          type: string
        published_at:
          type: string
          nullable: true
    Tag:
      type: object
      properties:
        id:
          type: integer
        uuid:
          type: string
          format: uuid
        name:
          type: string
        hex_color:
          type: string
          example: '#4F46E5'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A workspace API key: `Authorization: Bearer osk_...`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same workspace API key in the `x-api-key` header.

````

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