# Update a category

Updates an existing category. Accepted fields depend on the category type:
- Custom categories (`custom: true`): `name` and `accounting_code_id` are mutable; `enabled` returns 400.
- System categories (`custom: false`): `enabled` and `accounting_code_id` are mutable; `name` returns 400.

Endpoint: PATCH /v1/businesses/{client_id}/categories/{category_id}
Version: v1
Security: BearerAuth

## Path parameters:

  - `client_id` (integer, required)
    The ID of the business.

  - `category_id` (string, required)
    The ID of the category.

## Request fields (application/json):

  - `name` (string)
    New display name. Only accepted for custom categories (`custom: true`). Returns 400 for system categories.
    Example: Updated Category Name

  - `enabled` (boolean)
    Whether this category is available for use. Only accepted for system categories (`custom: false`). Returns 400 for custom categories.
    Example: false

  - `accounting_code_id` (string | null)
    The ID of a GL code to map to this category. Pass `null` to remove an existing mapping. Must belong to the same business.
    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6

## Response 200 fields (application/json):

  - `id` (string)
    The unique identifier for this category.
    Example: 7cb19e45-1234-5678-abcd-ef9876543210

  - `name` (string)
    The display name of the category.
    Example: Travel

  - `custom` (boolean)
    Whether this is a custom category created by the business. System-defined categories have `custom: false`.
    Example: false

  - `enabled` (boolean)
    Whether this category is available for use on transactions.
    Example: true

  - `accounting_code_id` (string | null)
    The ID of the GL code mapped to this category, or `null` if no mapping exists.
    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6

  - `created` (string)
    When this category was created in UTC.
    Example: 2025-01-01T00:00:00Z

  - `updated` (string)
    When this category was last updated in UTC.
    Example: 2025-01-01T00:00:00Z

