---
title: "Create Department"
method: POST
path: "/v2/company/{company_id}/departments"
tags: ["Departments"]
---

# Create Department

`POST /v2/company/{company_id}/departments`

## Request

- Base URL: `https://api.7shifts.com`
- URL: `https://api.7shifts.com/v2/company/{company_id}/departments`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://app.7shifts.com/oauth2/authorize`
    - Client credentials
    - Password
    - Token URL: `https://app.7shifts.com/oauth2/token`
  - API key in cookie `7session`

## Path parameters

- `company_id` integer, required

## Headers

- `x-api-version` string: An API version
- `x-company-guid` string, uuid

## Request body

- object
  - `location_id` number, required: Location ID
  - `name` string, required: Department name
  - `default` boolean, required: If true department is set as the default for the location

## Response `201`

Created

- object
  - `object` 'department', required
  - `data` object
    - `id` number, required: Department ID
    - `company_id` number, required: Company ID
    - `location_id` number, required: Location ID
    - `name` string, required: Department name
    - `default` boolean, required: If true department is set as the default for the location
    - `deleted` string, nullable, required: If true the location is deleted
    - `created` string, required
    - `modified` string, required

## Other responses

- `403`: Forbidden
- `422`: Unprocessable Entity
- `500`: Server Error

---

[API](https://skmtc.dev/7shifts/apis/7shifts-api.md) - [All operations](https://skmtc.dev/7shifts/apis/7shifts-api/llms.txt) - [OpenAPI document](https://skmtc.dev/7shifts/apis/7shifts-api/revisions/40e0ef40dfcd?raw)
