---
title: "Create a new category"
method: POST
path: "/categories"
tags: ["Categories"]
---

# Create a new category

`POST /categories`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/categories`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/categories/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new work order category within a primary category.
            <br />For more information, refer to [Managing categories](https://servicechannel.atlassian.net/wiki/spaces/SCU/pages/556302506/Managing+Categories) in ServiceChannel University.

## Request body

- ServiceChannelServicesMessagingCategoryAddCategoryRequest: Object containing the details of the new category.
  - `Name` string: Category name. The maximum characters count is 50.
  - `PrimaryCategoryId` integer: Primary category ID.

## Response `201`

The new category has been created.

- ServiceChannelServicesMessagingCategoryAddCategoryResponse: Category object.
  - `Id` integer: Category ID.
  - `ErrorCode` integer: Numeric identifier that determines the nature of an error. Possible values: `0` - success, otherwise - error.
  - `Message` string: Defines that the file’s remote storage is unavailable or its URL cannot be found.

## Other responses

- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 100 — User has no rights to perform this action
- `500`: The server was unable to complete the request due to an internal error. <br/> Error codes: 501 — Category already exists 501 — Object reference is not set to an instance of an object

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
