# POST /api/v1/ledgers/bulk-update

> Bulk update ledgers

- **Tag:** ledgers
- **Operation ID:** `bulk_update_ledgers_api_v1_ledgers_bulk_update_post`

## Description

Update multiple ledgers in a single request.

## Authentication

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

## Request body

Schema: `LedgerBulkUpdateRequest`

- `updates` (array · object · required)

## Responses

### 201 — Successful Response

Schema: `LedgerBulkUpdateResponse`

- `updated` (integer · required)

### 400 — Bad Request - Invalid input

### 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 POST 'https://api.ondayzero.com/api/v1/ledgers/bulk-update' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "updates": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/ledgers/bulk-update', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "updates": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "updates": []
}

response = httpx.post("https://api.ondayzero.com/api/v1/ledgers/bulk-update", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/ledgers/bulk-update-ledgers
- OpenAPI slice: https://www.ondayzero.com/docs/reference/ledgers/bulk-update-ledgers/openapi.json
- Other endpoints in **ledgers**: https://www.ondayzero.com/docs/reference/ledgers
