Skip to content

Messages


GET /inboxes/:id/messages

Returns all messages received by an inbox.

Query parameters

ParamTypeDescription
qstringFilter by subject (case-insensitive substring match)
fromstringFilter by sender address (case-insensitive substring match)
pagenumberPage number (default: 1)
limitnumberResults per page, max 100 (default: 20)
waitnumberLong-poll: block up to N seconds (max 60) until a message arrives

The ?wait parameter turns the request into a long-poll. The connection stays open until either a message arrives or the timeout is reached. This is the recommended approach for test assertions — no polling loop needed.

Terminal window
# Block up to 30 seconds for the next message
curl "https://api.inboxical.com/v1/inboxes/ix_3f9a/messages?wait=30" \
-H "X-API-Key: $API_KEY"
// In a test — waits until the email arrives (up to 30s)
const messages = await api.get(`/inboxes/${inbox.id}/messages?wait=30`)
const [msg] = messages
expect(msg.subject).toBe('Welcome to MyApp!')

Response 200

[
{
"id": "msg_7b2c",
"inbox_id": "ix_3f9a",
"from": "[email protected]",
"subject": "Welcome to MyApp!",
"text": "Thanks for signing up...",
"html": "<h1>Thanks for signing up...</h1>",
"size": 1240,
"attachments": [],
"received_at": "2026-03-21T12:00:03Z"
}
]

GET /inboxes/:id/messages/:messageId

Returns a single message with full body content.

Terminal window
curl https://api.inboxical.com/v1/inboxes/ix_3f9a/messages/msg_7b2c \
-H "X-API-Key: $API_KEY"

DELETE /inboxes/:id/messages/:messageId
Terminal window
curl -X DELETE https://api.inboxical.com/v1/inboxes/ix_3f9a/messages/msg_7b2c \
-H "X-API-Key: $API_KEY"

Response 204 — no body.


FieldTypeDescription
idstringUnique message ID
inbox_idstringParent inbox ID
fromstringSender address
tostringRecipient address
subjectstringEmail subject
textstringPlain-text body
htmlstringHTML body
sizenumberMessage size in bytes
attachmentsarrayList of attachment objects
received_atstringISO 8601 timestamp