Sign in

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.

  1. 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 shell
    export ZILO_TOKEN="zo_pat_…"
  2. Check who you are
    Request
    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"
      ]
    }
  3. Read your inbox
    SHELL
    curl "https://api.zilomail.in/v1/mail/messages?folder=inbox&limit=5" -H "Authorization: Bearer $ZILO_TOKEN"
    Each message has id, from, subject, snippet, read… The answer ends with next: pass it as cursor for the next page.
  4. Send a mail
    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."}'
    It goes out from your own mailbox, with a copy in Sent, exactly like webmail.

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.

Next#