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

# Create post



## OpenAPI

````yaml /openapi.json post /workspaces/{workspace}/posts
openapi: 3.1.0
info:
  title: PublishBuddy
  version: 0.0.1
servers:
  - url: https://api.publishbuddy.com/v1
security: []
paths:
  /workspaces/{workspace}/posts:
    post:
      tags:
        - Post
      summary: Create post
      operationId: v1.workspaces.posts.store
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace UUID
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          description: JWT token.
          schema:
            type: string
          example: Bearer 123
      responses:
        '200':
          description: '`PostResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PostResource'
                  message:
                    type: string
                required:
                  - data
                  - message
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    PostResource:
      type: object
      properties:
        post_id:
          type: string
          description: Post UUID (same as `id`)
        id:
          type: string
          description: Post UUID (alias of `post_id`)
        content:
          type: string
          description: Post text
        account_ids:
          type: array
          description: Account UUIDs from scheduled-profile history (append-only)
          items:
            type: string
        scheduled_for:
          type:
            - string
            - 'null'
          description: Scheduled publish time in ISO 8601 UTC
        timezone:
          type: string
          description: Timezone echoed from the request (default `UTC`)
        media_ids:
          type: array
          description: Attached media UUIDs
          items:
            type: string
        media:
          type: object
          description: Attached media metadata
          properties:
            media_id:
              type: string
            type:
              type: string
            width:
              type:
                - integer
                - 'null'
            height:
              type:
                - integer
                - 'null'
            duration:
              type:
                - integer
                - 'null'
          required:
            - media_id
            - type
            - width
            - height
            - duration
        platform_content:
          type:
            - array
            - 'null'
          description: >-
            Per-platform settings keyed by platform slug (e.g. `instagram`,
            `tiktok`); null for universal multi-account
          items: {}
        publish_type:
          type:
            - string
            - 'null'
          description: >-
            Publish mode: `queue_using_timeslots`,
            `schedule_using_fixed_datetime`, `now`, `recurring`
        status:
          type:
            - string
            - 'null'
          description: >-
            Post status: `waiting`, `publishing`, `published`, `failed`,
            `needs_approval`, `draft`
        created_at:
          type: string
          description: Creation timestamp in ISO 8601 UTC
        updated_at:
          type: string
          description: Last update timestamp in ISO 8601 UTC
        link:
          type: string
          description: Optional link attached to the post
        labels:
          type:
            - string
            - 'null'
          description: Labels when the `labels` relation is eager-loaded; otherwise `null`
        comments:
          type: array
          description: First-comment thread items
          items:
            $ref: '#/components/schemas/CommentResource'
        published_at:
          type: string
          description: Actual publish time in ISO 8601 UTC
        error_message:
          type: string
          description: Last publish error for the active profile
        destinations:
          type: array
          description: Per-account publish targets from `post_scheduled_profiles`
          items:
            $ref: '#/components/schemas/PostDestinationResource'
      required:
        - post_id
        - id
        - content
        - account_ids
        - scheduled_for
        - timezone
        - media_ids
        - media
        - platform_content
        - publish_type
        - status
        - created_at
        - updated_at
        - link
        - labels
        - comments
        - published_at
        - error_message
        - destinations
      title: PostResource
    CommentResource:
      type: object
      properties:
        id:
          type: string
          description: ID
        text:
          type: string
          description: Text of comment
        delay_n:
          type:
            - integer
            - 'null'
          description: Amount of time to delay the post, represented as a number
        delay_type:
          type: string
          description: 'Unit of time used for delay. Example: minutes, hours, days'
        media_ids:
          type: array
          description: Attached media UUIDs
          items:
            type: string
        media:
          type: object
          description: Media content Info which included in comment
          properties:
            media_id:
              type: string
            type:
              type: string
            width:
              type:
                - integer
                - 'null'
            height:
              type:
                - integer
                - 'null'
            duration:
              type:
                - integer
                - 'null'
          required:
            - media_id
            - type
            - width
            - height
            - duration
      required:
        - id
        - text
        - delay_n
        - delay_type
        - media_ids
        - media
      title: CommentResource
    PostDestinationResource:
      type: object
      properties:
        account_id:
          type: string
          description: Target account UUID
        account_name:
          type: string
          description: Human-readable account name
        platform:
          type:
            - string
            - 'null'
          description: Platform slug (e.g. `facebook`, `instagram`)
        platform_post_id:
          type: string
          description: Platform-native post identifier when published
        platform_post_url:
          type: 'null'
          description: Public URL of the published post
        published_at:
          type: string
          description: Publish time in ISO 8601 UTC
        error:
          type: string
          description: Publish error message, if any
        status:
          description: >-
            Destination status: `queued`, `publishing`, `published`, `failed`,
            or pivot `status`
          anyOf:
            - type: string
            - type: 'null'
            - type: string
              enum:
                - published
                - publishing
                - failed
                - queued
      required:
        - account_id
        - account_name
        - platform
        - platform_post_id
        - platform_post_url
        - published_at
        - error
        - status
      title: PostDestinationResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````