Parameters

NameTypeRequiredDescription
brandIdstringYesOcoya brand id from ocoya_list_brands.
promptstringYesWhat the email is about: the offer, news or message, with any facts, dates and links. At least 10 characters.
templateIdstringNoOptional template id to write it into.
withImagesbooleanNoDraw AI pictures for it. Defaults to true.
namestringNo—
subjectstringNoUse this subject instead of the one AI writes.
preheaderstringNo—
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.

Request example

{
  "name": "ocoya_create_ai_email",
  "arguments": {
    "brandId": "cmayvq3hk00017apshay5qezu",
    "prompt": "Write a launch post for our new analytics dashboard."
  }
}

Returns

Returns the result of the call as JSON.