Skip to content

Messages

Query messages processed by MXHook.

List Messages

GET /messages

Returns messages with optional pagination.

Query Parameters

ParameterTypeDefaultDescription
limitinteger50Maximum number of messages to return
offsetinteger0Number of messages to skip

Response 200 OK

json
[
  {
    "id": "msg-123",
    "message_id": "<abc123@example.com>",
    "from": "sender@example.com",
    "to": ["recipient@yourdomain.com"],
    "subject": "Hello",
    "received_at": "2025-03-19T12:00:00Z",
    "state": "delivered"
  }
]

Get Message

GET /messages/{id}

Retrieve a single message by ID.

Parameters

ParameterInTypeRequiredDescription
idpathstringYesMessage ID

Response 200 OK

json
{
  "id": "msg-123",
  "message_id": "<abc123@example.com>",
  "from": "sender@example.com",
  "to": ["recipient@yourdomain.com"],
  "subject": "Hello",
  "received_at": "2025-03-19T12:00:00Z",
  "state": "delivered"
}

Errors

StatusReason
401Invalid or missing API key
404Message not found

Message Object

FieldTypeDescription
idstringInternal message identifier
message_idstringEmail Message-ID header value
fromstringSender address
tostring[]Recipient addresses
subjectstringEmail subject
received_atstring (ISO 8601)When the message was received
statestringCurrent lifecycle state

Message States

StateDescription
acceptedReceived by SMTP server
queuedPlaced in processing queue
parsedEmail parsed into structured data
routedMatched to a route
deliveredWebhook delivery succeeded
failedWebhook delivery failed, retrying
retriedRetry in progress
dlqAll retries exhausted, in dead letter queue

Released under the Apache 2.0 License.