Parameters
| Name | Type | Required | Description |
|---|---|---|---|
brandId | string | Yes | Ocoya brand id from ocoya_list_brands. |
document | object | No | The email body: {theme?, blocks: […]}. Each block has a type, e.g. {type: “heading”, text, level?: 1-4}, {type: “text”, text} (Markdown-style bold, italics, links), {type: “button”, label, href}, {type: “image”, src, alt?, href?}, {type: “divider”}, {type: “spacer”, height?}, {type: “hero”, title, text?, label?, href?, src?}. Read an existing email with ocoya_get_email to see the full format; the theme is the brand’s when left out. |
templateId | string | No | Template id from ocoya_list_email_templates. |
name | string | No | Internal name, shown in the app only. |
subject | string | No | — |
preheader | string | No | Preview line shown after the subject in the inbox. |
audience | object | No | Who gets it: every subscribed contact (omit groupIds), or the contacts in any of groupIds, minus anyone in excludeGroupIds. Group ids from ocoya_list_contact_groups. |
scheduledAt | string | No | ISO datetime to send it at. Omit for a draft. |
publishNow | boolean | No | Send it to its whole audience at once. |
Request example
{
"name": "ocoya_create_email",
"arguments": {
"brandId": "cmayvq3hk00017apshay5qezu",
"scheduledAt": "2026-07-01T09:00:00Z"
}
}Returns
Returns the result of the call as JSON.