---
title: "Create a category for a company"
method: POST
path: "/companies/{company-id}/categories"
tags: ["Companies"]
---

# Create a category for a company

`POST /companies/{company-id}/categories`

## Request

- Base URL: `https://categories-api.home.mendix.com/v1`
- URL: `https://categories-api.home.mendix.com/v1/companies/{company-id}/categories`
- Auth: API key in header `Authorization`

Creates a category for the company. The category must include at least 2 inner values.
Validation: A company can have a maximum of 5 categories.
The user PAT needs to have the scope `mx:app:categories:write`.
The user must be a company admin.
The code of the provided values can be passed as an empty string. A code will be generated based on the provided input for the values.

## Path parameters

- `company-id` string, required

## Request body

- CategoryCreate
  - `name` string: Name of the category
  - `values` CategoryValueCreate[]: List of values for the category
    - `code` string: Code for the value
    - `value` string: The actual value

## Response `201`

Category created

- object
  - `categoryId` string: Unique identifier for the category
  - `name` string: Name of the category
  - `values` CategoryValue[]: List of values for the category
    - `valueId` string: Unique identifier for the value
    - `code` string: Code for the value
    - `value` string: The actual value

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable content
- `500`: Internal Server Error

---

[API](https://skmtc.dev/mendix/apis/categories-api.md) - [All operations](https://skmtc.dev/mendix/apis/categories-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/categories-api/revisions/22dd53db4f78?raw)
