Parameters

NameTypeRequiredDescription
brandIdstringYesOcoya brand id from ocoya_list_brands.
emailIdstringYesEmail id from ocoya_list_emails or ocoya_create_email.
namestringNo—
subjectstringNo—
preheaderstringNo—
documentobjectNoThe 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.
audienceobjectNoWho 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.
scheduledAtstring or nullNoISO datetime to send it at, or null to unschedule.
publishNowbooleanNoSend it to its whole audience at once. Confirm with the user first.

Request example

{
  "name": "ocoya_update_email",
  "arguments": {
    "brandId": "cmayvq3hk00017apshay5qezu",
    "emailId": "cmwdkjtfh005gy0k4ggzzg1bs",
    "scheduledAt": "2026-07-01T09:00:00Z"
  }
}

Returns

Returns the result of the call as JSON.