NorthRelayNorthRelay
API Reference

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

ScopeAllows
inbox:readList agent mailboxes, read a mailbox and the mail in it
inbox:writeMark, flag, move and trash mail in an agent mailbox
inbox:sendSend and reply from an agent mailbox
inbox:manageCreate, 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 /mailboxes and /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:write and inbox:send, never inbox: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 /mailboxes

Scope: inbox:read. A bound key sees only the mailboxes it is bound to.

Query parameterTypeDefaultDescription
pageinteger1Page number, from 1
limitinteger25Mailboxes 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"
  }
}
FieldDescription
addressThe mailbox's own address
quotaBytes, usedBytesStorage allowed, and storage in use as the mail server reports it
dailySendLimit, sentTodayRecipients 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:

ClassLimitRequests
Read300 a minuteGET requests
Write120 a minuteChanges to mail in a mailbox
Send10 a minuteSending 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.

StatusCodeMeaningWhat to do
401MISSING_API_KEYNo Authorization headerSend Authorization: Bearer <key>
401INVALID_API_KEYThe key is unknown, revoked or expiredCheck the key, or create a new one
403SCOPE_INSUFFICIENTThe key lacks the scope the route needs; the message names itUse a key that holds that scope
403RESOURCE_POLICY_FORBIDDENA bound key called a route or a mailbox outside its bindingUse the key only for its own mailboxes, or use an account key
403UPGRADE_REQUIREDThe plan does not include agent mailboxesUpgrade to Starter or above
403MAILBOX_SUSPENDEDThe mailbox is yours and is suspendedReactivate it
404MAILBOX_NOT_FOUNDNo agent mailbox with this id is reachable with this keyUse an id from GET /mailboxes
409MAILBOX_NOT_READYThe mailbox exists but has no account on the mail serverDelete it and create it again; contact support if that fails
400VALIDATION_ERRORA query parameter is not valid; error.context.field names itCorrect the parameter
429RATE_LIMIT_EXCEEDEDToo many requestsWait for Retry-After seconds
503SERVICE_ERRORThe mail server is not answeringRetry 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.

On this page