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
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.
200 (a message object; the code is at annotation.code):
Get a message
GET /v1/messages/:id
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.
201:
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.
200: the message object with "archived": true.