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

# Create post

> Creates one logical post that can target multiple connected accounts. Include `publish_at` to schedule it instead of sending immediately.



## OpenAPI

````yaml /openapi/public-api.yaml post /v1/posts
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:
    post:
      summary: Create post
      description: >-
        Creates one logical post that can target multiple connected accounts.
        Include `publish_at` to schedule it instead of sending immediately.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - targets
              properties:
                content:
                  type: string
                  example: Shipping the public API today.
                external_id:
                  type: string
                  nullable: true
                  example: launch-001
                media:
                  type: array
                  items:
                    $ref: '#/components/schemas/MediaInput'
                publish_at:
                  type: string
                  format: date-time
                  nullable: true
                  example: '2026-04-01T14:00:00.000Z'
                targets:
                  type: array
                  items:
                    $ref: '#/components/schemas/PostTargetInput'
            examples:
              immediate:
                value:
                  content: Shipping the public API today.
                  external_id: launch-001
                  targets:
                    - account_id: account-1
                    - account_id: account-2
                      content_override: Shorter version for X
              mediaSingle:
                value:
                  content: Launching with a hero image.
                  media:
                    - url: https://cdn.example.com/launch-image.png
                      type: image
                      width: 1200
                      height: 630
                  targets:
                    - account_id: account-1
              mediaMultiple:
                value:
                  content: Carousel post with multiple images.
                  media:
                    - url: https://cdn.example.com/carousel-1.png
                      type: image
                    - url: https://cdn.example.com/carousel-2.png
                      type: image
                    - url: https://cdn.example.com/carousel-3.png
                      type: image
                  targets:
                    - account_id: account-1
              perTargetCustomization:
                value:
                  content: Shipping the public API today.
                  targets:
                    - account_id: twitter-account-id
                      content_override: Shipping today. API is live.
                    - account_id: linkedin-account-id
                      platform_options:
                        title: Public API launch
              scheduled:
                value:
                  content: Scheduled launch note
                  publish_at: '2026-04-01T14:00:00.000Z'
                  targets:
                    - account_id: account-1
              tiktokDraft:
                value:
                  content: Finish this caption in TikTok
                  media:
                    - url: https://cdn.example.com/video.mp4
                      type: video
                  targets:
                    - account_id: tiktok-account-id
                      platform_options:
                        publish_mode: draft
      responses:
        '201':
          description: Post created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Post'
        '400':
          description: One or more target accounts are invalid or inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing, invalid, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
components:
  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'
    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.
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
    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

````