The last 50 messages in this inbox
const url = 'https://api.facteur.eu/v1/inboxes/example/messages';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.facteur.eu/v1/inboxes/example/messages \ --header 'Authorization: Bearer <token>'Newest first, and capped at 50 with no pagination. This route answers
“what is in the drawer”; to page, to filter, or to wait for a message
that has not arrived yet, use POST /v1/messages/search.
Read status on each message before anything derived from the body: a
message exists for a few milliseconds after SMTP acknowledgement with no
subject, no OTP and no links, because parsing happens after.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The inbox identifier — the same string that prefixes its receiving address.
Responses
Section titled “Responses”The messages, newest first.
Read status first. A message accepted over SMTP exists before it is
parsed, and a refused one carries no derived fields at all — an absent
otp pushes a client to read status rather than assert on a plausible
null.
object
The inbox this arrived in.
How long the message took to reach us.
received — accepted and stored, not parsed yet. Everything derived
from the body is still empty; look again.
parsed — everything below is populated.
quota_exceeded — refused for want of plan. Nothing was stored or
parsed, and the derived fields are absent rather than null.
object
object
object
The one-time code found in the message, when there is one. This is the field most suites assert on.
object
object
object
One property per extractor saved on this inbox, keyed by the extractor’s key.
object
Present instead of the derived fields when the message was not processed.
object
Example
[ { "status": "received", "error": { "code": "PLAN_QUOTA_EXCEEDED" } }]No usable credential. UNAUTHENTICATED when none was presented,
KEY_UNKNOWN, KEY_REVOKED or KEY_EXPIRED when a key was — kept
distinct on purpose, because “mint a new one” and “somebody took this
away from you” are different facts to whoever is reading a red pipeline.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}SCOPE_INSUFFICIENT (the message names the scope this request wanted and
the ones the key holds), KEY_CANNOT_REACH (no scope opens this route to
a key at all), FORBIDDEN, or one of the stated refusals listed under
x-api-key-refusals.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}INBOX_NOT_FOUND. An inbox in a workspace the key does not reach answers
the same way as one that does not exist — telling the two apart would let
anyone map a colleague’s workspaces one request at a time.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}