API reference / Mail
Mailboxes, folders, messages, drafts, sending and the changes feed.
List mailboxes#
The person's own mailboxes.
Answer · 200 OK
dataarray of objectidstringaddressstringnamestring | nullquotaBytesintegerusedBytesintegerprimarybooleanmailbox isn't given.curl "https://api.zilomail.in/v1/mail/mailboxes" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"data": [
{
"id": "string",
"address": "string",
"name": "string",
"quotaBytes": 0,
"usedBytes": 0,
"primary": false
}
]
}Try it
Sign in to call it as yourself.
List folders#
Every folder of a mailbox with its message and unread counts.
Query
mailboxstringAnswer · 200 OK
dataarray of objectidstringnamestringroleenum | nullinbox, sent, drafts, trash, junk, archive.parentIdstring | nulltotalintegerunreadintegeruidValidityintegeruidNextintegercurl "https://api.zilomail.in/v1/mail/folders" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"data": [
{
"id": "string",
"name": "string",
"role": "inbox",
"parentId": "string",
"total": 0,
"unread": 0,
"uidValidity": 0,
"uidNext": 0
}
]
}Try it
Sign in to call it as yourself.
Create a folder#
Body
mailboxstringnamestringrequiredparentIdstringAnswer · 201 Created
idstringnamestringroleenum | nullinbox, sent, drafts, trash, junk, archive.parentIdstring | nulltotalintegerunreadintegeruidValidityintegeruidNextintegercurl -X POST "https://api.zilomail.in/v1/mail/folders" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices"
}'{
"id": "string",
"name": "string",
"role": "inbox",
"parentId": "string",
"total": 0,
"unread": 0,
"uidValidity": 0,
"uidNext": 0
}Try it
Sign in to call it as yourself.
Rename a folder#
Special folders (Inbox, Sent, Drafts, Trash, Junk) keep their names.
Path
idstringrequiredBody
namestringrequiredAnswer · 200 OK
idstringnamestringroleenum | nullinbox, sent, drafts, trash, junk, archive.parentIdstring | nulltotalintegerunreadintegeruidValidityintegeruidNextintegercurl -X PATCH "https://api.zilomail.in/v1/mail/folders/ID" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'{
"id": "string",
"name": "string",
"role": "inbox",
"parentId": "string",
"total": 0,
"unread": 0,
"uidValidity": 0,
"uidNext": 0
}Try it
Sign in to call it as yourself.
Delete a folder#
Its messages go to Trash first. Special folders can't be deleted.
Path
idstringrequiredcurl -X DELETE "https://api.zilomail.in/v1/mail/folders/ID" \
-H "Authorization: Bearer $ZILO_TOKEN"Answers 204 with no body.
Try it
Sign in to call it as yourself.
List messages#
Newest first. Search with q (sender, subject, text and attachment names). For keeping an app in step, list once, then follow the changes feed.
Query
mailboxstringfolderstringq to search everywhere. Up to 200 characters.qstringunreadbooleanstarredbooleansincestringthreadIdstringlimitintegercursorstringnext value from the previous page. Up to 500 characters.Answer · 200 OK
dataarray of objectidstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullnextstring | nullcursor for the next page; null on the last.curl "https://api.zilomail.in/v1/mail/messages?limit=20" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"data": [
{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string"
}
],
"next": "string"
}Try it
Sign in to call it as yourself.
Get a message#
Headers, text, HTML and the list of attachments. ?format=raw answers the whole message as RFC 822 (message/rfc822). Reading doesn't mark it read: send read: true.
Path
idstringrequiredQuery
formatenumfull, raw.Answer · 200 OK
idstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullmessageIdstring | nullinReplyTo to reply).inReplyTostring | nullreplyToobject | nullnamestring | nulladdressstringbccarray of objectnamestring | nulladdressstringtextstring | nullhtmlstring | nullattachmentListarray of objectidstringfilenamestringcontentTypestringsizeBytesintegerinlinebooleanurlstringcurl "https://api.zilomail.in/v1/mail/messages/ID" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string",
"messageId": "string",
"inReplyTo": "string",
"replyTo": {
"name": "string",
"address": "string"
},
"bcc": [
{
"name": "string",
"address": "string"
}
],
"text": "string",
"html": "string",
"attachmentList": [
{
"id": "string",
"filename": "string",
"contentType": "string",
"sizeBytes": 0,
"inline": false,
"url": "string"
}
]
}Try it
Sign in to call it as yourself.
Mark or move a message#
Change any of: read, starred, answered, or the folder (id, name or role). Moving gives the message a new uid.
Path
idstringrequiredBody
readbooleanstarredbooleanansweredbooleanfolderstringAnswer · 200 OK
idstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullcurl -X PATCH "https://api.zilomail.in/v1/mail/messages/ID" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"read": true,
"folder": "archive"
}'{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string"
}Try it
Sign in to call it as yourself.
Delete a message#
Moves it to Trash. A message already in Trash (or with ?permanent=true) is deleted for good.
Path
idstringrequiredQuery
permanentbooleancurl -X DELETE "https://api.zilomail.in/v1/mail/messages/ID" \
-H "Authorization: Bearer $ZILO_TOKEN"Answers 204 with no body.
Try it
Sign in to call it as yourself.
Download an attachment#
Path
idstringrequiredattachmentIdstringrequiredcurl "https://api.zilomail.in/v1/mail/messages/ID/attachments/ATTACHMENT_ID" \
-H "Authorization: Bearer $ZILO_TOKEN"Try it
Sign in to call it as yourself.
Send a message#
Sends from one of the person's mailboxes; a copy goes to Sent. Mail to addresses on this server arrives at once; other mail is queued and retried. Up to 50 recipients (to, cc and bcc together) and 25 MB of attachments; each person may send to 500 recipients an hour through the API.
Body
mailboxstringfromNamestringtoarray of stringrequiredccarray of stringbccarray of stringreplyTostringsubjectstringrequiredtextstringhtmlstringinReplyTostringattachmentsarray of objectfilenamestringrequiredcontentTypestringcontentstringrequiredAnswer · 202 Accepted
idstringmessageIdstring | nullfromstringtoarray of stringccarray of stringbccarray of stringcurl -X POST "https://api.zilomail.in/v1/mail/send" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"to": [
"priya@example.com"
],
"subject": "Order 1182 shipped",
"text": "It'\''s on its way: AWB 1290012.",
"html": "<p>It'\''s on its way: <b>AWB 1290012</b>.</p>"
}'{
"id": "string",
"messageId": "string",
"from": "string",
"to": [
"string"
],
"cc": [
"string"
],
"bcc": [
"string"
]
}Try it
Sign in to call it as yourself.
Delivery status#
For each outside recipient: queued, sent, deferred (retrying) or failed, with the last error.
Path
idstringrequiredAnswer · 200 OK
idstringdeliveriesarray of objectrecipientstringstatusstringattemptsintegerlastErrorstring | nullnextAttemptAtstring | nullcurl "https://api.zilomail.in/v1/mail/send/ID" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"id": "string",
"deliveries": [
{
"recipient": "string",
"status": "string",
"attempts": 0,
"lastError": "string",
"nextAttemptAt": "2026-10-17T09:30:00.000Z"
}
]
}Try it
Sign in to call it as yourself.
List drafts#
Query
mailboxstringlimitintegercursorstringnext value from the previous page. Up to 500 characters.Answer · 200 OK
dataarray of objectidstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullnextstring | nullcursor for the next page; null on the last.curl "https://api.zilomail.in/v1/mail/drafts?limit=20" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"data": [
{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string"
}
],
"next": "string"
}Try it
Sign in to call it as yourself.
Save a draft#
Drafts are messages in the Drafts folder, the same ones webmail and mail apps show.
Body
mailboxstringfromNamestringtoarray of stringccarray of stringbccarray of stringreplyTostringsubjectstringtextstringhtmlstringinReplyTostringattachmentsarray of objectfilenamestringrequiredcontentTypestringcontentstringrequiredAnswer · 201 Created
idstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullmessageIdstring | nullinReplyTo to reply).inReplyTostring | nullreplyToobject | nullnamestring | nulladdressstringbccarray of objectnamestring | nulladdressstringtextstring | nullhtmlstring | nullattachmentListarray of objectidstringfilenamestringcontentTypestringsizeBytesintegerinlinebooleanurlstringcurl -X POST "https://api.zilomail.in/v1/mail/drafts" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string",
"messageId": "string",
"inReplyTo": "string",
"replyTo": {
"name": "string",
"address": "string"
},
"bcc": [
{
"name": "string",
"address": "string"
}
],
"text": "string",
"html": "string",
"attachmentList": [
{
"id": "string",
"filename": "string",
"contentType": "string",
"sizeBytes": 0,
"inline": false,
"url": "string"
}
]
}Try it
Sign in to call it as yourself.
Change a draft#
Fields sent replace the draft's; the rest stay. The draft gets a new id (mail apps store a new version and remove the old).
Path
idstringrequiredBody
mailboxstringfromNamestringtoarray of stringccarray of stringbccarray of stringreplyTostringsubjectstringtextstringhtmlstringinReplyTostringattachmentsarray of objectfilenamestringrequiredcontentTypestringcontentstringrequiredAnswer · 200 OK
idstringmailboxIdstringfolderIdstringuidintegerthreadIdstring | nullfromobject | nullnamestring | nulladdressstringtoarray of objectnamestring | nulladdressstringccarray of objectnamestring | nulladdressstringsubjectstring | nullsnippetstringdatestring | nullreceivedAtstringsizeBytesintegerreadbooleanstarredbooleanansweredbooleandraftbooleanattachmentsintegerzilosecurstring | nullmessageIdstring | nullinReplyTo to reply).inReplyTostring | nullreplyToobject | nullnamestring | nulladdressstringbccarray of objectnamestring | nulladdressstringtextstring | nullhtmlstring | nullattachmentListarray of objectidstringfilenamestringcontentTypestringsizeBytesintegerinlinebooleanurlstringcurl -X PATCH "https://api.zilomail.in/v1/mail/drafts/ID" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"id": "string",
"mailboxId": "string",
"folderId": "string",
"uid": 0,
"threadId": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"snippet": "string",
"date": "2026-10-17T09:30:00.000Z",
"receivedAt": "2026-10-17T09:30:00.000Z",
"sizeBytes": 0,
"read": false,
"starred": false,
"answered": false,
"draft": false,
"attachments": 0,
"zilosecur": "string",
"messageId": "string",
"inReplyTo": "string",
"replyTo": {
"name": "string",
"address": "string"
},
"bcc": [
{
"name": "string",
"address": "string"
}
],
"text": "string",
"html": "string",
"attachmentList": [
{
"id": "string",
"filename": "string",
"contentType": "string",
"sizeBytes": 0,
"inline": false,
"url": "string"
}
]
}Try it
Sign in to call it as yourself.
Discard a draft#
Path
idstringrequiredcurl -X DELETE "https://api.zilomail.in/v1/mail/drafts/ID" \
-H "Authorization: Bearer $ZILO_TOKEN"Answers 204 with no body.
Try it
Sign in to call it as yourself.
Send a draft#
Sends it as it is (with its attachments) and removes it from Drafts.
Path
idstringrequiredAnswer · 202 Accepted
idstringmessageIdstring | nullfromstringtoarray of stringccarray of stringbccarray of stringcurl -X POST "https://api.zilomail.in/v1/mail/drafts/ID/send" \
-H "Authorization: Bearer $ZILO_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "string",
"messageId": "string",
"from": "string",
"to": [
"string"
],
"cc": [
"string"
],
"bcc": [
"string"
]
}Try it
Sign in to call it as yourself.
What changed#
Everything that happened in a mailbox since since, in order: new mail, read/starred/moved, deleted, from any app (webmail, phones over IMAP, other API apps). Start with no since to get the current position, then pass back cursor each time. With wait (seconds, up to 25) the request holds until something changes: an app can keep one open instead of polling. A position older than 30 days answers 410: list the folders again.
Query
mailboxstringsincestringwaitintegerlimitintegerAnswer · 200 OK
dataarray of objectseqstringkindenumcreated, updated, deleted.messageIdstringfolderIdstringuidintegeratstringcursorstringsince next time.morebooleancurl "https://api.zilomail.in/v1/mail/changes?limit=20&since=CURSOR&wait=25" \
-H "Authorization: Bearer $ZILO_TOKEN"{
"data": [
{
"seq": "string",
"kind": "created",
"messageId": "string",
"folderId": "string",
"uid": 0,
"at": "2026-10-17T09:30:00.000Z"
}
],
"cursor": "string",
"more": false
}Try it
Sign in to call it as yourself.