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

> Start generating a multi-post Ocoya AI campaign and return immediately while background generation continues.

## Parameters

| Name                 | Type      | Required | Description                                                                                                                                                                                       |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `workspaceId`        | string    | Yes      | Workspace ID from `ocoya_list_workspaces`.                                                                                                                                                        |
| `prompt`             | string    | Yes      | Campaign prompt or brief.                                                                                                                                                                         |
| `goal`               | string    | No       | One of `awareness`, `leads`, `launch`, `offer`, `education`, `event`. Defaults to `awareness`.                                                                                                    |
| `audience`           | string    | No       | One of `business_owners`, `founders_executives`, `marketing_teams`, `buyers_customers`, `local_community`, `investors`, `first_time_buyers`, `existing_customers`. Defaults to `business_owners`. |
| `duration`           | number    | No       | Campaign duration in days, from 1 to 30. Defaults to 7.                                                                                                                                           |
| `count`              | number    | No       | Number of posts to generate, from 3 to 30. Defaults to 5.                                                                                                                                         |
| `postLength`         | string    | No       | One of `short`, `medium`, `long`, `extra_long`. Defaults to `medium`.                                                                                                                             |
| `tone`               | string    | No       | One of `professional`, `friendly`, `educational`, `bold`, `founder_led`. Defaults to `professional`.                                                                                              |
| `brandId`            | string    | No       | Brand kit ID from `ocoya_list_brand_kits`. When campaign media is generated, brand kit logos and icons are treated as protected reference assets.                                                 |
| `hashtagLibraryId`   | string    | No       | Hashtag library ID from `ocoya_list_hashtag_libraries`.                                                                                                                                           |
| `socialProfileIds`   | string\[] | No       | Connected social profile IDs to attach when generated campaign posts are saved.                                                                                                                   |
| `generateMedia`      | boolean   | No       | Whether to generate images for campaign posts.                                                                                                                                                    |
| `imageCount`         | number    | No       | Number of images to generate for each campaign post, from 1 to 5. Values above 1 create carousel-style post creatives. Defaults to 1.                                                             |
| `referenceUrls`      | string\[] | No       | Image URLs to use as visual references when `generateMedia` is `true`. Maximum 3.                                                                                                                 |
| `referenceDesignIds` | string\[] | No       | Studio design IDs from `ocoya_list_studio_templates` to use as visual references when `generateMedia` is `true`. Maximum 3.                                                                       |

## Request example

```json theme={null}
{
  "name": "ocoya_create_ai_campaign",
  "arguments": {
    "workspaceId": "cmayvq3hk00017apshay5qezu",
    "prompt": "Summer launch campaign for our ecommerce analytics dashboard",
    "goal": "launch",
    "audience": "marketing_teams",
    "duration": 10,
    "count": 6,
    "postLength": "medium",
    "tone": "professional",
    "hashtagLibraryId": "cmayw7l5200067apsmz2tv7e8",
    "socialProfileIds": ["clh49poxf008x8kov4ncbjty9"],
    "generateMedia": true,
    "imageCount": 3
  }
}
```

## Returns

Returns the queued campaign ID, `GENERATING` status, and generation progress metadata.

This tool does not wait for generated posts. Campaign generation runs in the background, so clients should treat the immediate response as a queued job and check the campaign later in Ocoya.
