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

> Saves content and optional media or destinations without publishing or scheduling it. Reuse an Idempotency-Key when retrying.



## OpenAPI

````yaml /openapi/public-api.yaml post /v1/drafts
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/drafts:
    post:
      summary: Create draft
      description: >-
        Saves content and optional media or destinations without publishing or
        scheduling it. Reuse an Idempotency-Key when retrying.
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 200
          description: >-
            Stable retry key. Reusing it with the same body returns the original
            draft; reusing it with a different body returns 409.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                content:
                  type: string
                candidate_angle:
                  type: string
                media:
                  type: array
                  items:
                    $ref: '#/components/schemas/DraftMediaInput'
                selected_account_ids:
                  type: array
                  uniqueItems: true
                  items:
                    type: string
                    format: uuid
                suggested_platforms:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: Draft created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Draft'
        '400':
          description: Invalid draft or destination account.
          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:
    DraftMediaInput:
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        url:
          type: string
        type:
          type: string
          enum:
            - image
            - video
        file_name:
          type: string
        mime_type:
          type: string
        width:
          type: integer
          minimum: 0
        height:
          type: integer
          minimum: 0
        size:
          type: integer
          minimum: 0
        duration:
          type: number
          minimum: 0
        thumbnail_url:
          type: string
          nullable: true
    Draft:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        candidate_angle:
          type: string
        media:
          type: array
          items:
            $ref: '#/components/schemas/DraftMediaInput'
      selected_account_ids:
        type: array
        uniqueItems: true
        items:
          type: string
          format: uuid
        suggested_platforms:
          type: array
          items:
            type: string
        source_type:
          type: string
      status:
        type: string
        enum:
          - inbox
          - ready
          - scheduled
          - archived
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    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.
            hint:
              type: string
              description: Suggested action to resolve the error.
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
            hint:
              type: string
              description: Suggested action to resolve the error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Scoped API key issued in PostOnce Settings. OAuth authorization grants
        are not currently supported.
      x-scopes:
        accounts:read: List and read connected accounts.
        accounts:write: Connect and disconnect social accounts.
        media:read: Read uploaded media.
        media:write: Upload media.
        posts:read: Read posts and unpublished drafts.
        posts:write: Create, update, publish, cancel, retry, and delete posts and drafts.
        workflows:read: List and read crossposting workflows.
        workflows:write: Create, update, and delete crossposting workflows.

````