> ## 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.

# Publish post

> Publish a post to its connected social platforms and return per-platform results, including platform post IDs and any errors.



## OpenAPI

````yaml POST /posts/{id}/publish
openapi: 3.1.0
info:
  title: Unsora API
  version: 1.3.0
  description: >-
    Public API for Unsora integrations. Use Bearer token from Clerk in
    Authorization header.
servers:
  - url: /api/v1
    description: Versioned API
security: []
tags:
  - name: User
  - name: Connect
  - name: Stripe
  - name: Models
    description: >-
      Every video, image and motion-control model, with each model's inputs
      taken from the provider's own request schema and prices quoted live. One
      generate endpoint covers all of them.
  - name: Video
  - name: Image
  - name: Influencer
  - name: Thumbnail
  - name: Clipping
  - name: Music
  - name: Voiceover
  - name: Uploads
  - name: Scheduler
paths:
  /posts/{id}/publish:
    post:
      tags:
        - Scheduler
      summary: Publish a post now
      description: >-
        Starts publishing to every account on the post that has not published
        yet and returns 202 right away with status PUBLISHING. Publishing runs
        in the background; poll GET /posts/{id} until `status` is PUBLISHED,
        PARTIALLY_PUBLISHED or FAILED. Accepts DRAFT, SCHEDULED, FAILED and
        PARTIALLY_PUBLISHED posts. Before starting, the post is checked. It
        needs at least one account. VIDEO needs exactly one video, IMAGE exactly
        one image, CAROUSEL at least one image, and TEXT no media and a
        non-empty caption; video and images can't be mixed (THUMBNAIL items are
        not counted). The platform of every unpublished account must support the
        post type: YouTube supports VIDEO; TikTok, Instagram and Pinterest
        support VIDEO, IMAGE and CAROUSEL; Facebook, Threads, Bluesky, LinkedIn
        and X support all four types; Google Business Profile supports IMAGE and
        TEXT. Requires an active paid plan.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Publishing started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishPostResponse'
        '400':
          description: >-
            The post can't be published. `code` is POST_PUBLISHED (the post, or
            every account on it, is already published), ACCOUNT_REQUIRED,
            MEDIA_REQUIRED, MEDIA_NOT_ALLOWED, MIXED_MEDIA, CAPTION_REQUIRED or
            UNSUPPORTED_FORMAT.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: 'PLAN_REQUIRED: no active paid plan.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Post not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: 'POST_PUBLISHING: the post is already publishing.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    PublishPostResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
          description: '"Publishing started" or "Retry started".'
        data:
          type: object
          properties:
            postId:
              type: string
            status:
              type: string
              enum:
                - PUBLISHING
            results:
              type: array
              items:
                type: object
                additionalProperties: true
              description: >-
                Always empty. Per-account results are on the post (GET
                /posts/{id}).
          required:
            - postId
            - status
            - results
      required:
        - success
        - message
        - data
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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