# POST /api/v1/fixed-assets/categories

> Create asset category

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

## Description

Create a new asset category.

**Request Body:**
- `name`: Category name, 1-255 chars (required)
- `description`: Category description, max 1000 chars (optional)
- `default_useful_life_months`: Default useful life in months, 1-600 (optional, defaults to 60)
- `default_depreciation_method`: Default depreciation method - straight_line, declining_balance, double_declining, units_of_production (optional, defaults to 'straight_line')
- `default_salvage_percent`: Default salvage percentage, 0-100 (optional, defaults to 0)
- `asset_ledger_id`: Ledger ID for asset account (optional)
- `depreciation_expense_ledger_id`: Ledger ID for depreciation expense (optional)
- `accumulated_depreciation_ledger_id`: Ledger ID for accumulated depreciation (optional)

**Returns:** Created asset category.

## Authentication

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

## Request body

Schema: `AssetCategoryCreate`

- `name` (string · required) — Category name
- `description` (string) — Category description
- `default_useful_life_months` (integer) — Default useful life in months for assets in this category
- `default_depreciation_method` (DepreciationMethod) → `DepreciationMethod` — Default depreciation method
- `default_salvage_percent` (integer) — Default salvage value as percentage of cost
- `asset_ledger_id` (string) — Ledger account for asset cost
- `depreciation_expense_ledger_id` (string) — Ledger account for depreciation expense
- `accumulated_depreciation_ledger_id` (string) — Ledger account for accumulated depreciation

## Example request

```json
{
  "default_depreciation_method": "straight_line",
  "default_salvage_percent": 10,
  "default_useful_life_months": 36,
  "name": "Computer equipment"
}
```

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_AssetCategoryResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (AssetCategoryResponse)

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/fixed-assets/categories' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "default_depreciation_method": "straight_line",
  "default_salvage_percent": 10,
  "default_useful_life_months": 36,
  "name": "Computer equipment"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/fixed-assets/categories', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "default_depreciation_method": "straight_line",
  "default_salvage_percent": 10,
  "default_useful_life_months": 36,
  "name": "Computer equipment"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'default_depreciation_method': 'straight_line',
 'default_salvage_percent': 10,
 'default_useful_life_months': 36,
 'name': 'Computer equipment'}

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

## See also

- HTML version: https://www.ondayzero.com/docs/reference/fixed-assets/create-asset-category
- OpenAPI slice: https://www.ondayzero.com/docs/reference/fixed-assets/create-asset-category/openapi.json
- Other endpoints in **fixed-assets**: https://www.ondayzero.com/docs/reference/fixed-assets (markdown bundle: https://www.ondayzero.com/docs/reference/fixed-assets.md, OpenAPI: https://www.ondayzero.com/docs/reference/fixed-assets/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
