# List deliveries

`GET /api/deliveries`

Returns the account's delivery history, newest first, 25 per page. Optional status filters narrow the results. Content-free delivery summaries and attempt history remain available after message content expires.

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: `deliveries:read`.

Audience: management.

## Parameters

### page

query parameter; optional.

Pages are numbered from 1. Invalid input becomes 1 and excessive pages clamp to the final page.

```json
{
  "name": "page",
  "in": "query",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "default": 1
  },
  "description": "Pages are numbered from 1. Invalid input becomes 1 and excessive pages clamp to the final page."
}
```

### status

query parameter; optional.

```json
{
  "name": "status",
  "in": "query",
  "schema": {
    "type": "string",
    "enum": [
      "pending",
      "retrying",
      "delivered",
      "failed"
    ]
  }
}
```

## Responses

### 200

Success

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "deliveries": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/DeliverySummary"
      }
    },
    "pagination": {
      "$ref": "#/components/schemas/Pagination"
    }
  },
  "required": [
    "deliveries",
    "pagination"
  ]
}
```

### 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"
}
```

### 429



### 503



## Referenced schemas

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

### #/components/schemas/DeliverySummary

```json
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Delivery"
    },
    {
      "type": "object",
      "properties": {
        "receiptId": {
          "type": "string",
          "pattern": "^[a-f0-9]{24}$"
        },
        "recipients": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "receivedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "contentAvailable": {
          "type": "boolean"
        }
      },
      "required": [
        "receiptId",
        "recipients",
        "receivedAt",
        "contentAvailable"
      ]
    }
  ]
}
```

### #/components/schemas/Pagination

```json
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer"
    },
    "pageCount": {
      "type": "integer"
    },
    "total": {
      "type": "integer"
    },
    "pageSize": {
      "type": "integer"
    }
  },
  "required": [
    "page",
    "pageCount",
    "total"
  ]
}
```

### #/components/schemas/Error

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

### #/components/schemas/Delivery

```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/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"
  ]
}
```
