# Inspect received message

`GET /api/messages/{id}`

Returns a message summary, parsed message details while content is available, and its delivery summaries. The message ID is the 24-character receiptId from GET /api/messages. Message content and attachments follow the account's current retention policy.

Send API requests to your Wildmail application origin. The documentation host does not serve API requests.

## Authentication

- apiKey: Send `Authorization: Bearer <token>` in the request headers. Wildmail scoped kmx_ API token.

- session: Send the credential in the cookie named `better-auth.session_token`. Browser session cookie used by the hosted app. It may use the __Secure- cookie prefix. Use the auth client to manage cookies.

Each bullet above is an alternative authentication method.

Required API key scope: `messages:read`.

Audience: management.

## Parameters

### id

path parameter; required.

```json
{
  "name": "id",
  "in": "path",
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[a-f0-9]{24}$"
  }
}
```

## Responses

### 200

Success

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MessageSummary"
        },
        {
          "type": "object",
          "properties": {
            "processedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "contentAvailable": {
              "type": "boolean"
            },
            "rawDownloadUrl": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "processedAt",
            "contentAvailable",
            "rawDownloadUrl"
          ]
        }
      ]
    },
    "deliveries": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MessageDelivery"
      }
    },
    "details": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Parsed message details, or null when content is unavailable."
    }
  },
  "required": [
    "message",
    "details",
    "deliveries"
  ]
}
```

### 401

Missing, invalid or revoked credentials.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 403

Required scope or account access missing.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 404

Message not found or outside this account.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 429



### 503



## Referenced schemas

References resolve against the [OpenAPI specification](/openapi.json).

### #/components/schemas/MessageSummary

```json
{
  "type": "object",
  "properties": {
    "receiptId": {
      "type": "string",
      "pattern": "^[a-f0-9]{24}$",
      "description": "Message identifier. Treat it as opaque."
    },
    "sender": {
      "type": [
        "string",
        "null"
      ]
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "subject": {
      "type": [
        "string",
        "null"
      ]
    },
    "messageId": {
      "type": [
        "string",
        "null"
      ]
    },
    "processingStatus": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "parsed",
        "failed",
        "expired"
      ]
    },
    "processingErrorCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "processingError": {
      "type": [
        "string",
        "null"
      ]
    },
    "processingAttemptCount": {
      "type": "integer"
    },
    "processingNextRetryAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "receivedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "rawBytes": {
      "type": "integer"
    },
    "processedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "contentAvailable": {
      "type": "boolean"
    },
    "rawDownloadUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "threadId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Conversation ID, identical to message.thread_id in webhooks. Null for unavailable metadata or expired content. Treat as opaque."
    }
  },
  "required": [
    "receiptId",
    "sender",
    "recipients",
    "subject",
    "messageId",
    "processingStatus",
    "processingErrorCode",
    "processingError",
    "processingAttemptCount",
    "processingNextRetryAt",
    "receivedAt",
    "expiresAt",
    "rawBytes",
    "processedAt",
    "contentAvailable",
    "rawDownloadUrl",
    "threadId"
  ]
}
```

### #/components/schemas/MessageDelivery

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "deliveryId": {
      "type": "string"
    },
    "eventId": {
      "type": "string"
    },
    "eventType": {
      "type": "string",
      "const": "email.received"
    },
    "endpointId": {
      "type": "string"
    },
    "endpointName": {
      "type": "string"
    },
    "endpointStatus": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "retrying",
        "delivered",
        "failed"
      ]
    },
    "inProgress": {
      "type": "boolean"
    },
    "responseCode": {
      "type": [
        "integer",
        "null"
      ]
    },
    "durationMs": {
      "type": [
        "integer",
        "null"
      ]
    },
    "attemptCount": {
      "type": "integer"
    },
    "nextRetryAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "deliveryDeadlineAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastError": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "payload": {
      "type": "null"
    },
    "payloadBody": {
      "type": "null"
    },
    "attempts": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MessageAttempt"
      }
    }
  },
  "required": [
    "id",
    "deliveryId",
    "eventId",
    "eventType",
    "endpointId",
    "endpointName",
    "endpointStatus",
    "status",
    "inProgress",
    "responseCode",
    "durationMs",
    "attemptCount",
    "nextRetryAt",
    "deliveryDeadlineAt",
    "lastError",
    "createdAt",
    "payload",
    "payloadBody",
    "attempts"
  ]
}
```

### #/components/schemas/Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "limit": {
      "type": "integer"
    }
  },
  "required": [
    "error"
  ]
}
```

### #/components/schemas/MessageAttempt

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "deliveryId": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "responseCode": {
      "type": [
        "integer",
        "null"
      ]
    },
    "durationMs": {
      "type": [
        "integer",
        "null"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "deliveryId",
    "status",
    "responseCode",
    "durationMs",
    "error",
    "createdAt",
    "completedAt"
  ]
}
```
