---
title: "Create department."
method: POST
path: "/company/v1/departments"
tags: ["departments (usersService)"]
---

# Create department.

`POST /company/v1/departments`

## Request

- Base URL: `https://{domain}.uspacy.ua`
- URL: `https://{domain}.uspacy.ua/company/v1/departments`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/uspacy/apis/uspacy-api-2/docs/company/v1/departments/post.ts> (a function with typed inputs; its response is checked against the schema)

Create department.

## Request body

- DepartmentPatch
  - `name` string
  - `headId` string
  - `description` string
  - `parentDepartmentId` string

## Response `201`

OK

- object
  - `id` integer
  - `description` string
  - `name` string
  - `headId` string
  - `parentDepartmentId` string
  - `usersIds` string
  - `roles` string[]

## Other responses

- `401`: Access token is missing or invalid
- `403`: Forbidden

---

[API](https://skmtc.dev/uspacy/apis/uspacy-api-2.md) - [All operations](https://skmtc.dev/uspacy/apis/uspacy-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/uspacy/apis/uspacy-api-2/revisions/c3f48fd1c26b?raw)
