# categories.create

Create an accounting category using name and idempotencyKey, with an optional top-level parentId (subcategories are one level deep), description (up to 500 characters, read by the AI) and rules: merchant words that always use this category. Requires finance access.

`POST /api/v1/accounting/categories.create`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_create_category`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `name` | string | Yes | A display name. 1–100 characters. |
| `parentId` | string (ID) |  | The ID of the related record. |
| `description` | string |  | A short description. at most 500 characters. |
| `rules` | array of strings |  | at most 20 items; each 2–200 characters. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/categories.create \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "Synthetic Ventures Inc."
}'
```

Reference page: https://app.getoatmilk.com/docs/api/categories.create
