Skip to content

Update a category

Request

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.
Security
BearerAuth
Path
client_idintegerrequired

The ID of the business.

Example:123
category_idstring, (uuid)required

The ID of the category.

Example:7cb19e45-1234-5678-abcd-ef9876543210
Bodyapplication/jsonrequired
namestring, <= 128 characters

New display name. Only accepted for custom categories (custom: true). Returns 400 for system categories.

Example:"Updated Category Name"
enabledboolean

Whether this category is available for use. Only accepted for system categories (custom: false). Returns 400 for custom categories.

Example:false
accounting_code_idstring or null, (uuid)

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"
PATCH
/v1/businesses/{client_id}/categories/{category_id}
curl -i -X PATCH \
  https://public.letsweel.com/v1/businesses/123/categories/7cb19e45-1234-5678-abcd-ef9876543210 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Updated Category Name",
    "enabled": false,
    "accounting_code_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'

Responses

OK

Bodyapplication/json
idstring, (uuid)

The unique identifier for this category.

Example:"7cb19e45-1234-5678-abcd-ef9876543210"
namestring

The display name of the category.

Example:"Travel"
customboolean

Whether this is a custom category created by the business. System-defined categories have custom: false.

Example:false
enabledboolean

Whether this category is available for use on transactions.

Example:true
accounting_code_idstring or null, (uuid)

The ID of the GL code mapped to this category, or null if no mapping exists.

Example:"3fa85f64-5717-4562-b3fc-2c963f66afa6"
createdstring, (date-time)

When this category was created in UTC.

Example:"2025-01-01T00:00:00Z"
updatedstring, (date-time)

When this category was last updated in UTC.

Example:"2025-01-01T00:00:00Z"
Response
{ "id": "7cb19e45-1234-5678-abcd-ef9876543210", "name": "Travel", "custom": false, "enabled": true, "accounting_code_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created": "2025-01-01T00:00:00Z", "updated": "2025-01-01T00:00:00Z" }