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

# ocoya_create_ai_post

> Generate a ready-to-edit Ocoya draft post from a prompt using AI.

# `ocoya_create_ai_post`

Generates a ready-to-edit Ocoya draft post from a prompt using AI. It can optionally apply a brand kit, attach connected social profiles, connect a reusable hashtag library, and generate one square image.

This tool uses the same generation flow as the New AI post composer in Ocoya.

## Arguments

| Name                 | Type      | Required | Description                                                                                                        |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `workspaceId`        | string    | Yes      | Workspace ID from `ocoya_list_workspaces`.                                                                         |
| `prompt`             | string    | Yes      | What the post should be about. Minimum 10 characters.                                                              |
| `brandId`            | string    | No       | Brand kit ID from `ocoya_list_brand_kits`.                                                                         |
| `tone`               | string    | No       | Caption tone. One of `professional`, `friendly`, `educational`, `bold`, `founder_led`. Defaults to `professional`. |
| `length`             | string    | No       | Caption length. One of `short`, `medium`, `long`, `extra_long`. Defaults to `medium`.                              |
| `socialProfileIds`   | string\[] | No       | Connected social profile IDs to attach to the draft.                                                               |
| `hashtagLibraryId`   | string    | No       | Hashtag library ID from `ocoya_list_hashtag_libraries`.                                                            |
| `generateImage`      | boolean   | No       | Whether to generate one square image for the draft.                                                                |
| `referenceUrls`      | string\[] | No       | Image URLs to use as visual references when `generateImage` is `true`.                                             |
| `referenceDesignIds` | string\[] | No       | Studio design IDs from `ocoya_list_studio_templates` to use as visual references when `generateImage` is `true`.   |

## Example

```json theme={null}
{
  "name": "ocoya_create_ai_post",
  "arguments": {
    "workspaceId": "cmayvq3hk00017apshay5qezu",
    "prompt": "Create a LinkedIn post announcing our new analytics dashboard for ecommerce brands.",
    "tone": "professional",
    "length": "medium",
    "socialProfileIds": ["clh49poxf008x8kov4ncbjty9"],
    "hashtagLibraryId": "cmayw7l5200067apsmz2tv7e8",
    "generateImage": true,
    "referenceDesignIds": ["design_123"]
  }
}
```

## Returns

Returns post action details such as post group ID, status, and schedule.

The generated post is saved as an editable Ocoya draft unless the normal post review flow later schedules or publishes it.
