> For the complete documentation index, see [llms.txt](https://docs.vomevolunteer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vomevolunteer.com/resources/categories/write-operations/upsert-categories.md).

# Upsert categories

This endpoint creates and updates categories in one call. An entry with no `id` is created. An entry with an `id` is updated.

<mark style="color:red;">An</mark> <mark style="color:red;">**id**</mark> <mark style="color:red;">that does not match a category in your organization is reported as an error rather than created, so that a stale ID cannot quietly produce a duplicate.</mark>

#### Endpoint

```plaintext
POST api/categories/bulk-upsert/
```

#### Example Request Payload

```json
{
    "allow_partial": true,
    "categories": [
        {
            "id": "d610ab31-e480-4ef1-9e35-94f94ebacde9",
            "title": "Community Outreach",
            "description": "Updated description."
        },
        {
            "title": "Emergency Response"
        }
    ]
}
```

#### Behavior

* Entries without an `id` follow the same rules as [Create categories](https://docs.vomevolunteer.com/resources/categories/write-operations/create-categories.md), including your organization's chat default.
* Entries with an `id` follow the same rules as [Update categories](https://docs.vomevolunteer.com/resources/categories/write-operations/update-categories.md), changing only the fields you send.
