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

# Edit a post

> Edit or reschedule a draft or scheduled post. Only the fields you send change; scheduled_at null turns it into a draft.



## OpenAPI

````yaml /openapi.json patch /posts/{id}
openapi: 3.1.0
info:
  title: Postbase API
  version: 1.0.0
  description: >-
    Schedule and manage social posts on X, LinkedIn, Bluesky, Mastodon and
    YouTube. Authenticate with an API key from Postbase → Developers, sent as
    `Authorization: Bearer pb_live_…`.
  contact:
    url: https://www.postbase.so
  license:
    name: AGPL-3.0
    identifier: AGPL-3.0-only
servers:
  - url: https://www.postbase.so/api/v1
security:
  - bearerAuth: []
tags:
  - name: Posts
  - name: Media
  - name: Analytics
  - name: Webhooks
  - name: Channels
  - name: Account
paths:
  /posts/{id}:
    patch:
      tags:
        - Posts
      summary: Edit a post
      description: >-
        Edit or reschedule a draft or scheduled post. Only the fields you send
        change; scheduled_at null turns it into a draft.
      operationId: updatePost
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  description: The post text, for a single post.
                thread:
                  type: array
                  items:
                    type: string
                  description: >-
                    Several posts to publish as a thread, in order. Takes
                    precedence over body.
                channel_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Channels to publish to, from GET /channels.
                channel_bodies:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Text for particular channels instead of body, keyed by
                    channel id. Each is a single post.
                scheduled_at:
                  type:
                    - string
                    - 'null'
                  description: >-
                    When to publish: ISO 8601 with Z or an offset
                    (2026-10-01T09:00:00+01:00). Omit or null to save a draft.
                  format: date-time
                schedule_in_minutes:
                  type: number
                  description: >-
                    Publish this many minutes from now, on the server's clock.
                    Instead of scheduled_at.
                media_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Files from GET /media to attach, in order.
                media_urls:
                  type: array
                  items:
                    type: string
                    format: uri
                  description: >-
                    Public https links to images or a video, attached after
                    media_ids. Each is downloaded into the media library (up to
                    10 per request, 200 MB each).
                  maxItems: 10
                youtube:
                  type: object
                  properties:
                    title:
                      type: string
                      maxLength: 100
                    privacy:
                      type: string
                      enum:
                        - public
                        - unlisted
                        - private
                    made_for_kids:
                      type: boolean
                      description: Required to schedule to YouTube.
            example:
              scheduled_at: '2026-10-02T09:00:00+01:00'
      responses:
        '200':
          description: The edited post
          content:
            application/json:
              schema:
                type: object
                properties:
                  post:
                    $ref: '#/components/schemas/Post'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: No active plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict with the post's state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Post:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - draft
            - scheduled
            - publishing
            - published
            - failed
        body:
          type: string
        thread:
          type: array
          items:
            type: string
        scheduled_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        media:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              type:
                type: string
        channels:
          type: array
          items:
            $ref: '#/components/schemas/PostChannel'
        summary:
          type: object
          properties:
            published:
              type: integer
            failed:
              type: integer
            pending:
              type: integer
        warning:
          type: string
      required:
        - id
        - status
        - channels
    Error:
      type: object
      properties:
        error:
          type: string
          description: A readable message
        code:
          type: string
          description: A stable code, e.g. not_found
      required:
        - error
    PostChannel:
      type: object
      properties:
        channel_id:
          type: string
          format: uuid
        platform:
          type:
            - string
            - 'null'
        handle:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - draft
            - scheduled
            - publishing
            - published
            - failed
        url:
          type:
            - string
            - 'null'
          format: uri
          description: The live post, once published
        error:
          type:
            - string
            - 'null'
          description: Why it failed
        warning:
          type:
            - string
            - 'null'
          description: It published, with something to know
        retry_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When Postbase will retry a failed channel on its own
        body:
          type:
            - string
            - 'null'
          description: This channel's own text, if any
        metrics:
          type:
            - object
            - 'null'
          additionalProperties:
            type: number
          description: Latest likes, impressions, etc.
      required:
        - channel_id
        - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A pb_live_ API key

````

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