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

# Update post

> Update a draft or scheduled post. Published posts cannot be edited. Requires an active paid plan.



## OpenAPI

````yaml PUT /posts/{id}
openapi: 3.1.0
info:
  title: Unsora API
  version: 1.2.0
  description: >-
    Public API for Unsora integrations. Authenticate with Clerk JWT or
    uns_live_* API key. API keys are rate-limited to 60 requests/minute and
    support idempotency keys. Async jobs complete via polling GET
    /image/status/{id}.
servers:
  - url: https://mvp.tryunsora.com/api/v1
    description: Versioned API (recommended)
security: []
tags:
  - name: Clippings
  - name: Connect
  - name: Image Generations
  - name: Music Generations
  - name: Influencer Studio
  - name: Posts
  - name: Thumbnails
  - name: User
  - name: Video Generations
paths:
  /posts/{id}:
    put:
      tags:
        - Posts
      summary: Update post
      description: >-
        Update a draft or scheduled post. Published posts cannot be edited.
        Requires an active paid plan.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePostRequest'
      responses:
        '200':
          description: Post updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostDataResponse'
        '400':
          description: Validation error or post already published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Paid plan required or account not owned
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PlanRequiredError'
                  - $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User or post not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdatePostRequest:
      type: object
      properties:
        mainCaption:
          type: string
        scheduledFor:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Set null to clear schedule and revert to draft
        timezone:
          type: string
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/PostAccountInput'
          minItems: 1
    PostDataResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/PostRecord'
        message:
          type: string
      required:
        - success
        - data
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - error
    PlanRequiredError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
        code:
          type: string
          enum:
            - PLAN_REQUIRED
      required:
        - success
        - error
        - code
    PostAccountInput:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
          description: Legacy alias for id
        customCaption:
          type: string
        title:
          type: string
    PostRecord:
      type: object
      properties:
        id:
          type: string
        userId:
          type: string
        type:
          $ref: '#/components/schemas/PostType'
        mainCaption:
          type: string
        status:
          $ref: '#/components/schemas/PostStatus'
        scheduledFor:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        scheduledTimezone:
          anyOf:
            - type: string
            - type: 'null'
        publishedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        media:
          type: array
          items:
            $ref: '#/components/schemas/PostMediaRecord'
        postAccounts:
          type: array
          items:
            $ref: '#/components/schemas/PostAccountLink'
      required:
        - id
        - userId
        - type
        - mainCaption
        - status
        - createdAt
        - updatedAt
    PostType:
      type: string
      enum:
        - VIDEO
        - IMAGE
        - CAROUSEL
        - TEXT
    PostStatus:
      type: string
      enum:
        - DRAFT
        - SCHEDULED
        - PUBLISHING
        - PUBLISHED
        - FAILED
    PostMediaRecord:
      type: object
      properties:
        id:
          type: string
        postId:
          type: string
        type:
          $ref: '#/components/schemas/PostMediaType'
        order:
          type: integer
        assetId:
          type: string
      required:
        - id
        - postId
        - type
        - order
        - assetId
    PostAccountLink:
      type: object
      properties:
        id:
          type: string
        postId:
          type: string
        accountId:
          type: string
        customCaption:
          anyOf:
            - type: string
            - type: 'null'
        title:
          anyOf:
            - type: string
            - type: 'null'
        published:
          type: boolean
        publishedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        account:
          $ref: '#/components/schemas/PostLinkedAccount'
      required:
        - id
        - postId
        - accountId
        - published
    PostMediaType:
      type: string
      enum:
        - VIDEO
        - IMAGE
    PostLinkedAccount:
      type: object
      properties:
        id:
          type: string
        provider:
          type: string
        accountName:
          anyOf:
            - type: string
            - type: 'null'
        accountUsername:
          anyOf:
            - type: string
            - type: 'null'
        profilePicture:
          anyOf:
            - type: string
              format: uri
            - type: 'null'
      required:
        - id
        - provider
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk session JWT or Unsora API key (uns_live_*)

````