# GET /api/v1/month-end-packages

> List month-end packages

- **Tag:** month-end-packages
- **Operation ID:** `list_packages_api_v1_month_end_packages_get`

## Description

List all month-end packages requested for the business.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `status` (query, string, optional) — Filter by status: queued, in_progress, ready, failed
- `cursor` (query, string, optional) — Cursor for pagination
- `limit` (query, integer, optional) — Pagination limit
- `direction` (query, string, optional) — Pagination direction: 'next' or 'prev'
- `include_total_count` (query, boolean, optional) — Whether to include total count (expensive - avoid if possible)
- `sort_by` (query, string, optional) — Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.
- `descending` (query, boolean, optional) — Sort direction: true for descending (newest/largest first), false for ascending

## Responses

### 200 — Successful Response

Schema: `MonthEndPackagesListResponse`

- `items` (array · MonthEndPackageResponse · required) → `MonthEndPackageResponse` — List of items
  - `id` (string · required) — Month-end package UUID
  - `business_id` (string · required) — Owning business UUID
  - `accounting_period_id` (string) — Linked accounting period UUID, if any
  - `period_start` (string · date-time · required) — Start of the covered period
  - `period_end` (string · date-time · required) — End of the covered period
  - `status` (MonthEndPackageStatusEnum · required) → `MonthEndPackageStatusEnum` — Build status: queued, in_progress, ready, or failed
  - `report_format` (MonthEndPackageFormatEnum · required) → `MonthEndPackageFormatEnum` — Per-report format inside the zip
  - `selected_reports` (array · string) — Report keys included in the package
  - `workflow_id` (string) — Temporal workflow id driving the build
  - `file_size_bytes` (integer) — Final zip size in bytes (set when ready)
  - `filename` (string) — Suggested attachment filename for the zip download
  - `error_message` (string) — Failure reason when ``status == 'failed'``
  - `requested_by_user_id` (string) — User who requested the package
  - `started_at` (string · date-time) — When the build started
  - `ready_at` (string · date-time) — When the package became downloadable
  - `created_at` (string · date-time · required) — Creation timestamp
  - `updated_at` (string · date-time · required) — Last update timestamp
- `total` (integer) — Total number of items (null when not calculated for performance)
- `limit` (integer) — Pagination limit
- `next_cursor` (string) — Cursor for next page
- `prev_cursor` (string) — Cursor for previous page
- `has_next` (boolean · required) — Whether there are more items
- `has_prev` (boolean · required) — Whether there are previous items

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/month-end-packages' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/month-end-packages', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.get("https://api.ondayzero.com/api/v1/month-end-packages", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/month-end-packages/list-packages
- OpenAPI slice: https://www.ondayzero.com/docs/reference/month-end-packages/list-packages/openapi.json
- Other endpoints in **month-end-packages**: https://www.ondayzero.com/docs/reference/month-end-packages
