Your API key. Create one in Ocoya. Authorization: Bearer <key> works too.
Get email
Returns one email with its document, audience, how many contacts it reaches, and its results.
Get email
curl --request GET \
--url https://www.app.ocoya.com/api/_public/v1/email/{emailId} \
--header 'X-API-Key: <api-key>'{
"id": "cmwdkjtfh005gy0k4ggzzg1bs",
"brandId": "cmayvq3hk00017apshay5qezu",
"type": "<string>",
"name": "Autumn sale",
"subject": "Our autumn sale starts today",
"preheader": "<string>",
"status": "draft",
"scheduledAt": "2024-01-01T00:00:00Z",
"sentAt": "<string>",
"error": "<string>",
"campaignId": "<string>",
"audience": {
"all": true,
"groupIds": [
"<string>"
],
"excludeGroupIds": [
"<string>"
]
},
"createdBy": {
"id": "<string>",
"name": "<string>"
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"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"
}
]
},
"audienceCount": 120,
"summary": {
"recipients": 123,
"sent": 123,
"delivered": 123,
"opened": 123,
"clicked": 123,
"bounced": 123,
"complained": 123,
"unsubscribed": 123,
"failed": 123,
"queued": 123,
"openRate": 123,
"clickRate": 123
},
"labels": [
{
"id": "<string>",
"value": "<string>",
"color": "<string>"
}
],
"waitingForApproval": true
}Authorizations
Response
application/json
Success
generating while AI writes it (POST /email/ai), then draft, scheduled, sending, sent; failed when writing or sending failed (see error), canceled.
When it is scheduled, or, for a campaign email not scheduled yet, its planned time.
Was this page helpful?