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

> ## Agent Instructions
> Postploy's MCP server for posting is https://api.postploy.com/mcp and signs in with OAuth. The REST API base URL is https://api.postploy.com/public/v1 and takes an API key as a Bearer token. The API calls channels accounts.

# Create posts

> Creates up to 50 posts. Every post is checked against its platform first. If any post is invalid, nothing is saved.

If you can't publish in your team, your posts wait for approval instead of being scheduled.




## OpenAPI

````yaml /openapi.yaml post /posts
openapi: 3.1.0
info:
  title: Postploy API
  version: '1'
  description: Schedule and manage social media posts in your Postploy team.
  contact:
    name: Postploy support
    email: support@postploy.com
servers:
  - url: https://api.postploy.com/public/v1
security:
  - apiKey: []
tags:
  - name: Channels
  - name: Posts
  - name: Approvals
  - name: Media
  - name: Trash
  - name: Webhooks
paths:
  /posts:
    post:
      tags:
        - Posts
      summary: Create posts
      description: >
        Creates up to 50 posts. Every post is checked against its platform
        first. If any post is invalid, nothing is saved.


        If you can't publish in your team, your posts wait for approval instead
        of being scheduled.
      operationId: createPosts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePosts'
            example:
              posts:
                - socialAccountId: 5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d
                  text: >-
                    Our spring blend is here. Bright, citrusy and roasted this
                    week.
                  scheduledAt: '2030-01-15T09:00:00Z'
                  timezone: Europe/London
      responses:
        '201':
          description: The posts you created, in the order you sent them.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Post'
              example:
                data:
                  - id: 3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9
                    status: scheduled
                    statusGroup: scheduled
                    blockedReason: null
                    socialAccountId: 5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d
                    platform: linkedin
                    title: null
                    text: >-
                      Our spring blend is here. Bright, citrusy and roasted this
                      week.
                    thread: null
                    scheduledAt: '2030-01-15T09:00:00.000Z'
                    timezone: Europe/London
                    acceptedAt: null
                    publishedAt: null
                    deletedAt: null
                    link: null
                    failureReason: null
                    failureKind: null
                    sentBack: null
                    review: null
                    attempts: 0
                    mediaIds: []
                    media: []
                    platformFields: null
                    conversationId: null
                    seriesId: null
                    createdAt: '2030-01-10T12:00:00.000Z'
                    actions:
                      edit: true
                      approve: false
                      reject: false
                      retry: false
                      delete: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenOrPlanLimit'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    CreatePosts:
      type: object
      required:
        - posts
      additionalProperties: false
      properties:
        posts:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/NewPost'
        publishNow:
          type: boolean
          default: false
          description: >-
            Publish every post right away instead of at `scheduledAt`. Can't be
            combined with `pending_approval`.
    Post:
      allOf:
        - $ref: '#/components/schemas/PostData'
        - type: object
          required:
            - actions
          properties:
            actions:
              $ref: '#/components/schemas/PostActions'
    NewPost:
      type: object
      required:
        - socialAccountId
      additionalProperties: false
      properties:
        socialAccountId:
          type: string
          format: uuid
          description: >-
            The channel to post to, from [List
            channels](/api-reference/channels/list-channels).
        text:
          type: string
          description: The post's text. For an X thread, the first post.
        title:
          type: string
          description: YouTube needs one. Most other platforms ignore it.
        mediaIds:
          type: array
          maxItems: 35
          default: []
          description: Media from your library, in the order they show.
          items:
            type: string
            format: uuid
        scheduledAt:
          type: string
          format: date-time
          description: >-
            When to publish, ISO 8601 with an offset, to the minute. Must be in
            the future. Required unless `status` is `draft` or `publishNow` is
            `true`.
        timezone:
          type: string
          default: UTC
          description: >-
            The IANA time zone the app shows the post in, such as
            `America/New_York`. It doesn't change when the post goes out.
        status:
          allOf:
            - $ref: '#/components/schemas/WritableStatus'
          default: scheduled
        thread:
          type: array
          maxItems: 25
          description: >-
            X only. The follow-up posts of a thread, in order. Each must fit X's
            length limit.
          items:
            type: string
        platformFields:
          $ref: '#/components/schemas/PlatformFields'
    PostData:
      type: object
      required:
        - id
        - status
        - statusGroup
        - blockedReason
        - socialAccountId
        - platform
        - title
        - text
        - thread
        - scheduledAt
        - timezone
        - acceptedAt
        - publishedAt
        - deletedAt
        - link
        - failureReason
        - failureKind
        - sentBack
        - review
        - attempts
        - mediaIds
        - media
        - platformFields
        - conversationId
        - seriesId
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/Status'
        statusGroup:
          $ref: '#/components/schemas/StatusGroup'
        blockedReason:
          type:
            - string
            - 'null'
          enum:
            - account_disconnected
            - null
          description: >-
            `account_disconnected` when the post can't go out until its channel
            is reconnected.
        socialAccountId:
          type:
            - string
            - 'null'
          format: uuid
        platform:
          oneOf:
            - $ref: '#/components/schemas/Platform'
            - type: 'null'
        title:
          type:
            - string
            - 'null'
        text:
          type:
            - string
            - 'null'
        thread:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            An X post's follow-up posts, in order. `[]` when it isn't a thread,
            `null` on other platforms.
        scheduledAt:
          type: string
          format: date-time
          description: When it publishes, in UTC.
        timezone:
          type: string
          description: The time zone the app shows the post in.
        acceptedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the network took the post while publishing. Some networks, like
            TikTok, still process it for a few minutes before it shows on the
            profile.
        publishedAt:
          type:
            - string
            - 'null'
          format: date-time
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Set while the post is in the trash.
        link:
          type:
            - string
            - 'null'
          format: uri
          description: The live post, once it's published.
        failureReason:
          type:
            - string
            - 'null'
          description: Why the post failed, in plain words.
        failureKind:
          type:
            - string
            - 'null'
          enum:
            - transient
            - permanent
            - account
            - null
          description: >-
            `transient`: retrying may work. `permanent`: the platform rejected
            it, so change it first. `account`: reconnect the channel.
        sentBack:
          oneOf:
            - $ref: '#/components/schemas/SentBack'
            - type: 'null'
        review:
          oneOf:
            - $ref: '#/components/schemas/PostReview'
            - type: 'null'
        attempts:
          type: integer
          description: How many times Postploy tried to publish it.
        mediaIds:
          type: array
          items:
            type: string
            format: uuid
        media:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        platformFields:
          oneOf:
            - $ref: '#/components/schemas/PlatformFields'
            - type: 'null'
        conversationId:
          type:
            - string
            - 'null'
          description: The Postploy assistant chat that made the post, if one did.
        seriesId:
          type:
            - string
            - 'null'
          description: Set when the post is one of a repeating series.
        createdAt:
          type: string
          format: date-time
    PostActions:
      type: object
      description: What you can do with the post right now.
      required:
        - edit
        - approve
        - reject
        - review
        - retry
        - delete
      properties:
        edit:
          type: boolean
        approve:
          type: boolean
        reject:
          type: boolean
        review:
          type: boolean
          description: Whether you can send it to an outside reviewer.
        retry:
          type: boolean
        delete:
          type: boolean
    Error:
      type: object
      required:
        - statusCode
        - message
        - errors
        - timestamp
        - route
      properties:
        statusCode:
          type: integer
        message:
          type: string
          description: What went wrong, in plain words. Safe to show to people.
        errors:
          type:
            - array
            - 'null'
          description: Every problem, when there's more than one place to look.
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                description: Where the problem is, such as `["posts", 0, "scheduledAt"]`.
                items:
                  type:
                    - string
                    - integer
              cause:
                type: string
              code:
                type: string
                description: >-
                  On plan limits, `PLATFORM_LIMIT_REACHED` or
                  `TOTAL_LIMIT_REACHED`.
              platform:
                type: string
        timestamp:
          type: string
          format: date-time
        route:
          type: string
    WritableStatus:
      type: string
      description: >-
        `scheduled` publishes at `scheduledAt`. `draft` saves it without going
        out. `pending_approval` keeps its time but waits for someone to approve
        it.
      enum:
        - scheduled
        - draft
        - pending_approval
    PlatformFields:
      type: object
      description: >-
        Options for the post's platform, under the platform's name. See
        [Platform options](/api/platform-options).
      properties:
        linkedin:
          type: object
          additionalProperties: false
          properties:
            visibility:
              type: string
              enum:
                - PUBLIC
                - CONNECTIONS
            firstComment:
              type: string
              description: Posted as the first comment.
            link:
              type: string
              description: Added to the end of the post.
        twitter:
          type: object
          properties:
            replyRule:
              type: string
              enum:
                - everyone
                - follow
                - mention
              default: everyone
              description: >-
                Who can reply. `follow` is people you follow; `mention` is
                people you mention.
            retweetConfig:
              type: object
              description: Repost the post this long after it goes out.
              required:
                - value
                - frequency
              properties:
                value:
                  type: integer
                  minimum: 1
                frequency:
                  type: string
                  enum:
                    - hour
                    - day
        instagram:
          type: object
          additionalProperties: false
          properties:
            postType:
              type: string
              enum:
                - post
                - reel
                - story
              default: post
            reelGrid:
              type: string
              enum:
                - reel_only
                - reel_and_main
              default: reel_only
              description: '`reel_and_main` also shows a reel in your main feed.'
            firstComment:
              type: string
              description: Posted as the first comment. Not on stories.
            collaborators:
              type: array
              maxItems: 3
              description: Instagram usernames to invite as collaborators.
              items:
                type: string
        tiktok:
          type: object
          required:
            - visibility
            - discloseContent
            - allowMusic
            - promotion
            - allowUsersTo
          additionalProperties: false
          properties:
            visibility:
              type: string
              enum:
                - public
                - friends
                - followers
                - private
            discloseContent:
              type: boolean
              description: Whether the post promotes a brand, product or service.
            allowMusic:
              type: boolean
              description: Let TikTok add music to photo posts.
            promotion:
              type: array
              description: >-
                Whose promotion it is, when `discloseContent` is true (it's
                ignored otherwise): `brand` is your own, `branded_content` is a
                paid partnership. Pick at least one. Branded content can't be
                private.
              items:
                type: string
                enum:
                  - brand
                  - branded_content
            allowUsersTo:
              type: array
              description: What viewers may do.
              items:
                type: string
                enum:
                  - comment
                  - duet
                  - stitch
        youtube:
          type: object
          required:
            - visibility
            - forKids
          additionalProperties: false
          properties:
            visibility:
              type: string
              enum:
                - public
                - unlisted
                - private
            forKids:
              type: boolean
              description: Whether the video is made for kids.
    Status:
      type: string
      description: Where the post is. See [Statuses](/concepts#statuses).
      enum:
        - draft
        - pending_approval
        - scheduled
        - queued
        - publishing
        - published
        - failed
        - cancelled
    StatusGroup:
      type: string
      enum:
        - draft
        - approval
        - scheduled
        - published
        - failed
    Platform:
      type: string
      description: '`twitter` is X.'
      enum:
        - linkedin
        - twitter
        - instagram
        - facebook
        - tiktok
        - youtube
    SentBack:
      type: object
      description: Why a reviewer sent the post back to drafts.
      required:
        - reason
        - note
        - by
        - at
      properties:
        reason:
          type:
            - string
            - 'null'
        note:
          type:
            - string
            - 'null'
        by:
          type: object
          required:
            - id
            - name
            - kind
          properties:
            id:
              type: string
              format: uuid
              description: >-
                The teammate's user id, or the reviewer's id when `kind` is
                `reviewer`.
            name:
              type: string
            kind:
              type: string
              enum:
                - member
                - reviewer
              description: >-
                `member`: someone on your team. `reviewer`: someone outside it,
                from their review link.
        at:
          type: string
          format: date-time
    PostReview:
      type: object
      description: The reviewer outside your team that the post is waiting on.
      required:
        - reviewer
        - sentAt
      properties:
        reviewer:
          type: object
          required:
            - id
            - name
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        sentAt:
          type: string
          format: date-time
    Media:
      type: object
      description: An image or video in your team's media library.
      required:
        - id
        - type
        - fileName
        - url
        - thumbnailUrl
        - mimeType
        - duration
        - altText
      properties:
        id:
          type: string
          format: uuid
          description: Put this in a post's `mediaIds`.
        type:
          type: string
          enum:
            - image
            - video
        fileName:
          type: string
        url:
          type: string
          format: uri
        thumbnailUrl:
          type: string
          format: uri
        mimeType:
          type:
            - string
            - 'null'
        duration:
          type:
            - number
            - 'null'
          description: A video's length in seconds.
        altText:
          type:
            - string
            - 'null'
  responses:
    BadRequest:
      description: >-
        The request is invalid, or a post breaks its platform's rules. `message`
        gives the first problem, and `errors` lists every one with its `path`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            message: Scheduled date and time must be in the future
            errors:
              - message: Scheduled date and time must be in the future
                path:
                  - posts
                  - 0
                  - scheduledAt
                cause: custom
            timestamp: '2030-01-10T12:00:00.000Z'
            route: /public/v1/posts
    Unauthorized:
      description: The API key is missing, unknown or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Invalid API key
            errors: null
            timestamp: '2030-01-10T12:00:00.000Z'
            route: /public/v1/accounts
    ForbiddenOrPlanLimit:
      description: >-
        Your role doesn't allow this, your team doesn't have a plan, or the
        posts would go over your plan's monthly limit. Plan limits list each
        limit in `errors` with a `code` of `PLATFORM_LIMIT_REACHED` or
        `TOTAL_LIMIT_REACHED`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: It doesn't exist, or you can't see it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: >-
        More than 120 requests a minute to this endpoint. All of a person's keys
        count together. Wait the number of seconds in `Retry-After-caller`, then
        try again.
      headers:
        Retry-After-caller:
          description: Seconds to wait before trying again.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from **Settings › AI apps & API** in Postploy. Keys start
        with `ppk_`.

````

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