# POST /api/v1/fixed-assets/run-depreciation

> Run depreciation

- **Tag:** fixed-assets
- **Operation ID:** `run_depreciation_api_v1_fixed_assets_run_depreciation_post`

## Description

Run depreciation for a period.

Creates depreciation entries for all active assets (or specified assets)
for the given period. Optionally creates journal entries.

## Authentication

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

## Request body

Schema: `RunDepreciationRequest`

- `period_date` (string · date · required) — First day of the month to depreciate
- `asset_ids` (array · string) — Specific assets (default: all active)
- `create_journal_entries` (boolean) — Create journal entries for depreciation

## Responses

### 201 — Successful Response

Schema: `RunDepreciationResponse`

- `period_date` (string · date · required) — Depreciation period date
- `assets_processed` (integer · required) — Number of assets depreciated
- `total_depreciation` (integer · required) — Total depreciation amount in cents
- `entries_created` (integer · required) — Depreciation entries created
- `journal_entries_created` (integer · required) — Journal entries created
- `errors` (array · string) — Errors encountered during processing

### 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/fixed-assets/run-depreciation' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "period_date": "2026-01-01"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/fixed-assets/run-depreciation', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "period_date": "2026-01-01"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "period_date": "2026-01-01"
}

response = httpx.post("https://api.ondayzero.com/api/v1/fixed-assets/run-depreciation", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/fixed-assets/run-depreciation
- OpenAPI slice: https://www.ondayzero.com/docs/reference/fixed-assets/run-depreciation/openapi.json
- Other endpoints in **fixed-assets**: https://www.ondayzero.com/docs/reference/fixed-assets
