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

# Create an AI-generated draft post

> Generates a post caption from a prompt and creates a draft post. Optionally attaches social profiles, brand kit context, a reusable hashtag library, and one AI-generated image.



## OpenAPI

````yaml /openapi.yaml post /post/ai
openapi: 3.1.0
info:
  version: 1.1.0
  title: Ocoya API
  description: REST API reference for Ocoya.
servers:
  - url: https://app.ocoya.com/api/_public/v1
security:
  - ApiKeyAuth: []
paths:
  /post/ai:
    post:
      summary: Create an AI-generated draft post
      description: >-
        Generates a post caption from a prompt and creates a draft post.
        Optionally attaches social profiles, brand kit context, a reusable
        hashtag library, and one AI-generated image.
      parameters:
        - in: query
          name: workspaceId
          required: true
          description: Ocoya workspace ID. Get one from `GET /workspaces`.
          schema:
            type: string
            example: cmayvq3hk00017apshay5qezu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  description: >-
                    Prompt describing the post Ocoya should generate. Minimum 10
                    characters.
                  minLength: 10
                  example: Write a launch post for our new analytics dashboard.
                brandId:
                  type: string
                  description: >-
                    Brand kit ID used for brand context. Get IDs from `GET
                    /brand-kits`.
                  example: cmayw38dz00047apsue9nw4tf
                tone:
                  type: string
                  description: Caption tone for the AI draft.
                  enum:
                    - professional
                    - friendly
                    - educational
                    - bold
                    - founder_led
                  example: professional
                length:
                  type: string
                  description: Target caption length for the AI draft.
                  enum:
                    - short
                    - medium
                    - long
                    - extra_long
                  example: medium
                socialProfileIds:
                  type: array
                  description: >-
                    Connected social profile IDs that should receive the post.
                    Get IDs from `GET /social-profiles`.
                  items:
                    type: string
                  example:
                    - clh49poxf008x8kov4ncbjty9
                hashtagLibraryId:
                  type: string
                  description: >-
                    Hashtag library ID used for hashtag context. Get IDs from
                    `GET /hashtag-libraries`.
                  example: cmayw7l5200067apsmz2tv7e8
                generateImage:
                  type: boolean
                  description: Whether to generate one square image for the AI draft.
                  example: true
                referenceUrls:
                  type: array
                  description: >-
                    Optional image URLs to use as visual references when
                    `generateImage` is `true`. Ocoya uses these images for
                    style, composition, layout, and subject guidance; they are
                    not attached directly to the post.
                  items:
                    type: string
                  example:
                    - https://example.com/reference.png
                referenceDesignIds:
                  type: array
                  description: >-
                    Optional Studio design IDs to use as visual references when
                    `generateImage` is `true`. Get IDs from `GET
                    /studio-templates`.
                  items:
                    type: string
                  example:
                    - design_123
      responses:
        '201':
          description: Created
        '400':
          description: Invalid request
        '500':
          description: Unknown error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````