# Update a category

Source: https://docs.orbiqhq.com/docs/api/v1/categories/id/patch

### PATCH /api/v1/categories/{id}

**Update a category**

Partially update a tenant-owned custom category. Supplied language codes are merged and missing languages are preserved. Built-in global categories cannot be changed.

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes |  |

**Request body** (`application/json`) - required:

- `title` (string)
- `translations` (array of CategoryTranslationPatchInput (object)): Omit or send an empty array to leave existing translations unchanged. Send a null title to delete that language translation. Use one entry per supported language. Each languages_code value must be unique.
  - `languages_code` (enum: en-US | de-DE | fr-FR | nl-NL | ja-JP | ko-KR | zh-CN, required)
  - `title` (any, required): Send null to delete this language translation.

Example (Rename a custom category):

```json
{
  "title": "Security Questionnaires",
  "translations": [
    {
      "languages_code": "de-DE",
      "title": "Sicherheitsfragebögen"
    }
  ]
}
```

**Responses:**

- `200` - Category updated
  - `success` (boolean)
  - `data` (object)
    - `category` (Category (object))
      - `id` (string): Category identifier
      - `title` (string): Category title
      - `icon` (string): Icon name for the category
      - `tenant` (string): Owning tenant identifier for custom categories
      - `translations` (array of CategoryTranslation (object)): One entry per supported language. Each languages_code value must be unique.
        - `id` (string)
        - `languages_code` (enum: en-US | de-DE | fr-FR | nl-NL | ja-JP | ko-KR | zh-CN)
        - `title` (string)
- `400` - Bad Request - validation failed
  - `error` (string): Error code or message
- `401` - Unauthorized
- `403` - Forbidden - missing documents permission
- `404` - Category not found or not editable by this tenant
- `500` - Internal server error

**Code samples:**

cURL:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/categories/cat-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Security Questionnaires",
    "translations": [
      {
        "languages_code": "de-DE",
        "title": "Sicherheitsfragebögen"
      }
    ]
  }'
```
