Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
Update email
Changes an email that has not gone out, and its schedule: scheduledAt schedules or reschedules it, null unschedules it, publishNow sends it at once. Only the fields sent change. A scheduled email stays editable until two minutes before it sends.
Update email
curl --request PATCH \
--url https://www.app.ocoya.com/api/_public/v1/email/{emailId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"subject": "<string>",
"preheader": "<string>",
"document": {
"theme": {},
"blocks": [
{
"type": "heading",
"text": "Hi {{first_name}}",
"level": 1
},
{
"type": "text",
"text": "Our autumn sale starts today."
},
{
"type": "button",
"label": "Shop now",
"href": "https://example.com"
}
]
},
"audience": {
"groupIds": [
"cmwdke1w70043y0k4ffzsa6om"
],
"excludeGroupIds": []
},
"scheduledAt": "2024-01-01T00:00:00Z",
"publishNow": false
}
'{
"emailId": "cmwdkjtfh005gy0k4ggzzg1bs",
"status": "draft",
"scheduledAt": null,
"recipients": 120
}Authorizations
Body
application/json
Was this page helpful?