List stored mail
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Mail kept in the domain's inbox, newest first, with unread counts per
folder, the mailbox list and the inbox usage. Metadata only — open a
message for its content. Needs a key with email:read and
domain.view on the domain. Every list made with a key is recorded.
Path parameters
- domainstringrequiredpath
The domain name (for example
example.com) — not a numeric id.
Query parameters
- folderstringquery
inbox(default),spam,trash, orall.One of:"inbox""spam""trash""all"Default:"inbox" - mailboxstringquery
Only mail for this local part (
infoforinfo@example.com). - qstringquery
Case-insensitive match against From, subject and envelope sender.
- unreadbooleanquery
true(or1) for unread mail only. - pageintegerqueryDefault:
1 - per_pageintegerqueryDefault:
50
Responses
200A page of messages.
Content type: application/json
- itemsarray of InboxMessageSummary
Item fields
- idinteger
Use it with
GET …/inbox/{id}. - rcptstring
The address it was sent to on your domain.
- mailboxstring
The local part of
rcpt(info). - fromstring
The From header.
- mail_fromstring
The envelope sender.
- subjectstring
- sent_atstring | null (date-time)
The Date header
- created_atstring (date-time)
When it arrived.
- sizeinteger
Size in bytes.
- has_attachmentsboolean
- readboolean
- folderstringOne of:
"inbox""spam""trash" - is_spamboolean
- authobject
What NSIN checked on arrival.
Fields
- spfstring
- dkimstring
- dmarcstring
- totalinteger
- pageinteger
- per_pageinteger
- unreadobject
Unread counts per folder.
Fields
- inboxinteger
- spaminteger
- mailboxesarray of string
- usageobject
Fields
- used_bytesinteger
- cap_bytesinteger | null
null= no cap.
{
"items": [
{
"id": 0,
"rcpt": "string",
"mailbox": "string",
"from": "string",
"mail_from": "string",
"subject": "string",
"sent_at": "2026-01-01T00:00:00Z",
"created_at": "2026-01-01T00:00:00Z",
"size": 0,
"has_attachments": true,
"read": true,
"folder": "inbox",
"is_spam": true,
"auth": {
"spf": "string",
"dkim": "string",
"dmarc": "string"
}
}
],
"total": 0,
"page": 0,
"per_page": 0,
"unread": {
"inbox": 0,
"spam": 0
},
"mailboxes": [
"string"
],
"usage": {
"used_bytes": 0,
"cap_bytes": 0
}
}400Bad filter.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}403The key has no email:read ("code": "email_read_required"), or
the plan has no inbox and the domain has no stored mail
("code": "plan_required").
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}Example request
curl -X GET "https://api.nsin.ir/domains/example.com/email-routing/inbox/" \
-H "Authorization: Bearer $NSIN_API_KEY"