Quickstart
A token, three calls, a mail sent.
Five minutes from nothing to sending a mail, with a personal token. Apps for other people use Sign in with ZiloOne instead (next page); the calls are the same.
- Make a personal tokenOpen Personal tokens, pick the permissions (for this walk-through: Read mail, Send mail), and copy the token. It starts with
zo_pat_and is shown once.Keep it in your shellexport ZILO_TOKEN="zo_pat_…" - Check who you areRequest
curl https://api.zilomail.in/v1/me -H "Authorization: Bearer $ZILO_TOKEN"Answer{ "id": "3f1c…", "email": "you@your-company.com", "name": "Your Name", "role": "user", "organisation": { "id": "9a2b…", "name": "Your Company", "kind": "organisation" }, "via": "personal", "app": null, "scopes": [ "mail.read", "mail.send" ] } - Read your inboxEach message hasSHELL
curl "https://api.zilomail.in/v1/mail/messages?folder=inbox&limit=5" -H "Authorization: Bearer $ZILO_TOKEN"id,from,subject,snippet,read… The answer ends withnext: pass it ascursorfor the next page. - Send a mailIt goes out from your own mailbox, with a copy in Sent, exactly like webmail.
curl -X POST https://api.zilomail.in/v1/mail/send \ -H "Authorization: Bearer $ZILO_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"to": ["friend@example.com"], "subject": "Hello from the API", "text": "It works."}'
Everything runs as you: you see and change only what you can in the apps. A token with permissions you don't have in your role still can't do those things.