Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
Create an AI-generated draft email
Queues an email written by AI in the brand's voice from a prompt, alone or into a template (its layout kept, every word written for the prompt), with AI pictures drawn wherever it has a place for one and nothing real to put there: up to 3, never for products (their real photos) or people. Answers at once with generating, as POST /post/ai and POST /seo/ai do; fetch it with GET /email/{emailId} until it is draft, or failed with its error. Costs 1 credit for the words and 5 for each picture drawn. Schedule it afterwards with PATCH /email/{emailId}.
Create an AI-generated draft email
curl --request POST \
--url https://www.app.ocoya.com/api/_public/v1/email/ai \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"prompt": "Our autumn sale: 20% off everything until Sunday, code AUTUMN20.",
"templateId": "<string>",
"withImages": true,
"name": "<string>",
"subject": "<string>",
"preheader": "<string>",
"audience": {
"groupIds": [
"cmwdke1w70043y0k4ffzsa6om"
],
"excludeGroupIds": []
}
}
'{
"emailId": "cmwdkjtfh005gy0k4ggzzg1bs",
"status": "generating",
"scheduledAt": {}
}Authorizations
Body
application/json
What the email is about: the offer, news or message, with any facts, dates and links.
Was this page helpful?