SecureAgentMail

List messages

Returns a paginated list of messages for the given inbox. Results can be filtered by status, direction, and a `since` timestamp.

GET
/inboxes/{slug}/messages

Authorization

BearerAuth
AuthorizationBearer <token>

API key passed as a Bearer token. Production keys start with am_live_ and sandbox keys start with am_test_.

In: header

Path Parameters

slug*string

The unique slug identifier of the inbox.

Query Parameters

status?string

Filter messages by security status.

Value in"clean" | "flagged" | "withheld"
direction?string

Filter by message direction.

Value in"inbound" | "outbound"
since?string

Only return messages created at or after this ISO 8601 timestamp.

Formatdate-time
limit?integer

Maximum number of items to return per page.

Default25
Range1 <= value <= 100
cursor?string

Opaque pagination cursor returned as next_cursor from a previous request.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://secureagentmail.com/api/v1/inboxes/string/messages"
{
  "messages": [
    {
      "id": "msg_x7k9m2",
      "inbox_id": "inb_abc123",
      "thread_id": "thr_p4q8r1",
      "direction": "inbound",
      "from": "[email protected]",
      "to": "[email protected]",
      "subject": "Need help with billing",
      "body": "string",
      "body_sanitized": "string",
      "status": "clean",
      "security_analysis": {
        "risk_score": 15,
        "summary": "Low risk. Minor keyword match detected but no injection patterns found.",
        "detections": [
          {
            "method": "dual_llm",
            "result": "clean",
            "detail": "Both models agree the content is benign.",
            "confidence": 0.95
          }
        ],
        "triggered_policy": "pol_r2t5v8"
      },
      "has_attachments": false,
      "created_at": "2026-02-25T10:15:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "string"
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key.",
    "status": 401
  }
}
{
  "error": {
    "code": "not_found",
    "message": "The requested resource was not found.",
    "status": 404
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Please retry after 30 seconds.",
    "status": 429
  }
}