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

# Update post

> Updates a scheduled post before it runs.



## OpenAPI

````yaml /openapi/public-api.yaml patch /v1/posts/{id}
openapi: 3.1.0
info:
  title: PostOnce Public API
  version: 1.0.0-alpha
  description: Public API for PostOnce paid users
servers:
  - url: https://postonce.to/api/public
security:
  - bearerAuth: []
paths:
  /v1/posts/{id}:
    patch:
      summary: Update post
      description: Updates a scheduled post before it runs.
      parameters:
        - $ref: '#/components/parameters/postId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                external_id:
                  type: string
                  nullable: true
                media:
                  type: array
                  items:
                    $ref: '#/components/schemas/MediaInput'
                publish_at:
                  type: string
                  format: date-time
                  nullable: true
                targets:
                  type: array
                  items:
                    $ref: '#/components/schemas/PostTargetInput'
            examples:
              reschedule:
                value:
                  publish_at: '2026-04-02T15:00:00.000Z'
              changeContent:
                value:
                  content: Updated launch copy.
                  external_id: launch-002
      responses:
        '200':
          description: Scheduled post updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Post'
        '401':
          description: Missing, invalid, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '409':
          description: Post can no longer be updated in its current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    postId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Aggregate post ID.
  schemas:
    MediaInput:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          example: https://cdn.example.com/launch-image.png
        type:
          type: string
          enum:
            - image
            - video
          example: image
        width:
          type: integer
        height:
          type: integer
        size:
          type: integer
        duration:
          type: number
          description: Video duration in seconds when known.
    PostTargetInput:
      type: object
      required:
        - account_id
      properties:
        account_id:
          type: string
        content_override:
          type: string
          nullable: true
        platform_options:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Platform-specific settings. For Snapchat, pass
            {"placements":["spotlight","public_story"],"locale":"en_US"};
            placements default to Spotlight. For a TikTok draft upload, pass
            {"publish_mode":"draft"}; the creator must finish and publish it
            from their TikTok inbox.
    Post:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        external_id:
          type: string
          nullable: true
        media:
          type: array
          items:
            $ref: '#/components/schemas/MediaInput'
        origin:
          type: string
          enum:
            - ui
            - api
          nullable: true
        publish_at:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - queued
            - scheduled
            - processing
            - partial
            - published
            - failed
            - cancelled
          example: scheduled
        created_at:
          type: string
          format: date-time
          nullable: true
        targets:
          type: array
          items:
            $ref: '#/components/schemas/PostTarget'
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: workflow_limit_reached
            message:
              type: string
              example: You have reached the maximum number of workflows for your plan.
    PostTarget:
      type: object
      properties:
        target_post_id:
          type: string
        account_id:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        target_variant:
          type: string
          enum:
            - spotlight
            - public_story
          nullable: true
          description: >-
            Concrete placement for platforms that fan one account target into
            multiple publications.
        username:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - pending
            - scheduled
            - processing
            - submitted
            - published
            - failed
            - skipped
            - cancelled
          example: pending
        error:
          type: string
          nullable: true
        platform_post_id:
          type: string
          nullable: true
        platform_post_url:
          type: string
          nullable: true
        scheduled_time:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````