Agent Mailboxes API
Mailboxes that an API key reads and sends from, the scopes that grant access to them, and keys bound to a single mailbox.
Agent Mailboxes API
An agent mailbox is an address on one of your inbox-hosted domains that is reached with an API key, not with a password. It is meant for software: an agent, a support bot, an integration that needs its own address.
An agent mailbox is separate from the mailboxes people sign in to. An API key never reaches a person's mailbox through this API, whatever its scopes.
Availability
This API is being released in steps. Available now:
- the four
inbox:*scopes, - keys bound to mailboxes,
- listing your agent mailboxes and reading one mailbox's details.
Creating a mailbox, reading its mail and sending from it are not available yet. Until creation is released, GET /mailboxes returns an empty list. This page is extended as each step ships.
Agent mailboxes require the Starter plan or above. See plans.
Scopes
| Scope | Allows |
|---|---|
inbox:read | List agent mailboxes, read a mailbox and the mail in it |
inbox:write | Mark, flag, move and trash mail in an agent mailbox |
inbox:send | Send and reply from an agent mailbox |
inbox:manage | Create, change and delete agent mailboxes, and issue keys for them |
These scopes are granted one by one. sending_access includes none of them, and no preset in the dashboard or on the connector consent screen selects them.
A key with full_access, and an older key with no stored scopes, satisfies every scope. Such a key can use this API for the agent mailboxes of its own account. Review those keys if that is not what you want. See key scopes.
Application keys (nr_app_) cannot hold these scopes and cannot use this API.
Keys bound to mailboxes
A key can be bound to one or more agent mailboxes. A bound key:
- reaches
GET /capabilities,GET /mailboxesand/mailboxes/{id}and the paths below it, for the mailboxes it is bound to; - is refused everywhere else with
403 RESOURCE_POLICY_FORBIDDEN, whatever its scopes; - holds only
inbox:read,inbox:writeandinbox:send, neverinbox:manage, so it cannot create a mailbox or issue another key; - cannot sign in to SMTP or IMAP;
- stays bound when its secret is rotated.
Give an agent a bound key. If the key leaks, what it can reach is that mailbox and nothing else on your account.
Issuing a bound key is released together with mailbox creation.
List mailboxes
GET /mailboxesScope: inbox:read. A bound key sees only the mailboxes it is bound to.
| Query parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number, from 1 |
limit | integer | 25 | Mailboxes per page, 1 to 100 |
curl "https://app.northrelay.ca/api/v1/mailboxes?limit=10" \
-H "Authorization: Bearer $NORTHRELAY_API_KEY"{
"success": true,
"data": [
{
"id": "cmg7xk2p40001abcdefghijk",
"address": "agent@acme.example.com",
"displayName": "Support agent",
"status": "active",
"quotaBytes": 104857600,
"dailySendLimit": 50,
"createdAt": "2026-12-01T14:03:00.000Z"
}
],
"meta": { "page": 1, "limit": 10, "total_count": 1, "has_more": false }
}Mailboxes are listed newest first. status is active or suspended.
Get a mailbox
GET /mailboxes/{id}Scope: inbox:read. Requires an API key; a dashboard session is not accepted on this route.
curl "https://app.northrelay.ca/api/v1/mailboxes/cmg7xk2p40001abcdefghijk" \
-H "Authorization: Bearer $NORTHRELAY_API_KEY"{
"success": true,
"data": {
"id": "cmg7xk2p40001abcdefghijk",
"address": "agent@acme.example.com",
"displayName": "Support agent",
"status": "active",
"quotaBytes": 104857600,
"usedBytes": 123456,
"dailySendLimit": 50,
"sentToday": 12,
"createdAt": "2026-12-01T14:03:00.000Z"
}
}| Field | Description |
|---|---|
address | The mailbox's own address |
quotaBytes, usedBytes | Storage allowed, and storage in use as the mail server reports it |
dailySendLimit, sentToday | Recipients the mailbox may send to in a day, and recipients sent to today (UTC) |
Rate limits
Requests are limited per API key, not per IP address:
| Class | Limit | Requests |
|---|---|---|
| Read | 300 a minute | GET requests |
| Write | 120 a minute | Changes to mail in a mailbox |
| Send | 10 a minute | Sending and replying |
A refused request answers 429 RATE_LIMIT_EXCEEDED with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Wait the number of seconds in Retry-After before retrying.
A separate limit of 600 requests a minute per IP address protects these routes from floods.
Errors
Every error from this API has the same shape:
{
"success": false,
"error": {
"code": "MAILBOX_NOT_FOUND",
"message": "No agent mailbox with this id is reachable with this key",
"fix_action": "Use an id from GET /api/v1/mailboxes",
"docs_url": "https://docs.northrelay.ca/docs/api-reference/mailboxes"
}
}Read error.code to decide what to do, and show error.fix_action to whoever has to fix it.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 401 | MISSING_API_KEY | No Authorization header | Send Authorization: Bearer <key> |
| 401 | INVALID_API_KEY | The key is unknown, revoked or expired | Check the key, or create a new one |
| 403 | SCOPE_INSUFFICIENT | The key lacks the scope the route needs; the message names it | Use a key that holds that scope |
| 403 | RESOURCE_POLICY_FORBIDDEN | A bound key called a route or a mailbox outside its binding | Use the key only for its own mailboxes, or use an account key |
| 403 | UPGRADE_REQUIRED | The plan does not include agent mailboxes | Upgrade to Starter or above |
| 403 | MAILBOX_SUSPENDED | The mailbox is yours and is suspended | Reactivate it |
| 404 | MAILBOX_NOT_FOUND | No agent mailbox with this id is reachable with this key | Use an id from GET /mailboxes |
| 409 | MAILBOX_NOT_READY | The mailbox exists but has no account on the mail server | Delete it and create it again; contact support if that fails |
| 400 | VALIDATION_ERROR | A query parameter is not valid; error.context.field names it | Correct the parameter |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests | Wait for Retry-After seconds |
| 503 | SERVICE_ERROR | The mail server is not answering | Retry after Retry-After seconds |
404 MAILBOX_NOT_FOUND is the answer for every id that is not one of your agent mailboxes: an id that does not exist, a mailbox of another account, a mailbox a person signs in to, and a deleted mailbox. The answer does not say which.
Activity
Every request made with a key is recorded against that key, as described under usage and activity. For this API the recorded route keeps the mailbox id (/api/v1/mailboxes/<id>/messages/:id), so a key's activity shows which mailbox it read.