> ## Documentation Index
> Fetch the complete documentation index at: https://omni.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /v1/tickets/categories/{category_id}

> Rename or recolour a ticket category.

Renames or recolours a category. Only what the body gives changes; its tickets keep it.

<Note>Needs the `tickets:write` scope.</Note>

## Path parameters

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| category\_id | integer | Yes | The category's id. |

## Body

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `name` | string | No | Up to 60 characters; a longer name is cut short. |
| `colour` | string | No | `brand` (mint), `info` (blue), `warning` (amber), `ai` (violet), `rose` or `neutral` (grey). |

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.fireflo.au/v1/tickets/categories/3" \
    -H "Authorization: Bearer $OMNI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Refunds and returns"
    }'
  ```

  ```python Python theme={null}
  import os

  import requests

  response = requests.patch(
      "https://api.fireflo.au/v1/tickets/categories/3",
      headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
      json={
          "name": "Refunds and returns"
      },
  )
  print(response.status_code, response.json())
  ```

  ```javascript Node theme={null}
  const response = await fetch("https://api.fireflo.au/v1/tickets/categories/3", {
    method: "PATCH",
    headers: {
      Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "Refunds and returns"
    }),
  });
  console.log(response.status, await response.json());
  ```
</CodeGroup>

## Response

`200 OK` — the category as it is now.

```json theme={null}
{
  "id": 3,
  "name": "Refunds and returns",
  "colour": "warning"
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `not_found` | No category has that id on this account. |
| 400 | `invalid_request` | `name` is empty or already used by another category, or `colour` isn't one of the colours (`field` names it). |
| 400 | `invalid_json` | The body isn't valid JSON. |
| 404 | `module_off` | The account's plan doesn't include Tickets. |
| 403 | `scope_missing` | The key doesn't have the `tickets:write` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](/api-reference/overview).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.