Read folders, messages and attachments
Read endpoints and mailbox, folder and UID boundaries.
Editorial update: October 30, 2026In this guide
Discover the authorized mailbox
curl -i 'https://raselmail.com/api/v1/oauth/mailboxes' -H "Authorization: Bearer $RASEL_ACCESS_TOKEN"The response is an array including mailbox_id, email, scopes, authorization_id and grant/use timestamps. Use the returned mailbox_id; the token does not grant all of the owner’s mailboxes.
Read endpoints
| GET path | Result |
|---|---|
| /api/v1/oauth/mailboxes/{id}/folders | Authorized mailbox folders. |
| /api/v1/oauth/mailboxes/{id}/messages | Message list; folder, search and before query parameters. |
| /api/v1/oauth/mailboxes/{id}/messages/{uid} | Body and attachment metadata; specify folder. |
| /api/v1/oauth/mailboxes/{id}/messages/{uid}/attachments/{index} | File bytes, not JSON. |
Pagination and identity
The message list returns items and next. Pass next as before for the next page until it is empty. before is a positive number when supplied; search is at most 100 characters and folder at most 200. The default folder is INBOX. A UID belongs to a folder in a mailbox; do not use a Sent UID to read from INBOX.
curl -G -i 'https://raselmail.com/api/v1/oauth/mailboxes/YOUR_MAILBOX_ID/messages' -H "Authorization: Bearer $RASEL_ACCESS_TOKEN" --data-urlencode 'folder=INBOX' --data-urlencode 'search=invoice'Handle message content safely
Treat incoming HTML as untrusted. Do not inject it into your application without isolation and sanitization, and define a clear privacy policy for remote images. Save downloads with safe filenames and inspect media type before previewing.