Skip to main content
Messages are the emails an identity receives and sends. Every inbound message is annotated server-side as otp, magic_link, or other, with the extracted code or link — so an agent can wait for exactly the verification email it needs. See Receive verification codes.

The message object

List messages

GET /v1/messages
Response 200: an array of message objects, newest first. 404 {"error": "identity not found"} if identityId isn’t your org’s.

Wait for a message (long-poll)

GET /v1/messages/wait Holds the HTTP request open until a matching message arrives, then returns it. This is the primitive behind “wait for the OTP”. Returns 200 with the oldest matching message, or 204 with no body when the timeout elapses with no match. On 204, poll again — reuse the same since so nothing is skipped.
The robust pattern: stamp since yourself before triggering the action that sends the email, then pass it explicitly. The 60-second default lookback covers most timing gaps, but an explicit since is exact — and lets you re-poll without matching an old code.
Response 200 (a message object; the code is at annotation.code):

Get a message

GET /v1/messages/:id
Response 200: the full message object. 404 {"error": "not found"} otherwise.

Send an email

POST /v1/messages Sends as the identity’s address (DKIM-signed) and persists an outbound message.
Response 201:
Errors:

Archive / unarchive

POST /v1/messages/:id/archive · POST /v1/messages/:id/unarchive Archived messages drop out of GET /v1/messages unless includeArchived=true, and are never matched by wait. Idempotent; returns the updated message object.
Response 200: the message object with "archived": true.