# Create a Department

Create a Department based on the provided details.

Endpoint: POST /departments
Version: 1.0.0
Security: api_key

## Security:

  - `api_key` (unknown)
    apiKey in header x-api-key

## Header parameters:

  - `x-managed-company-id` (string, required)
    The ID of the managed company on behalf of which the request is made

## Request fields (application/json):

  - `identificationNumber` (string)

  - `name` (string, required)

  - `headAddress` (object, required)

  - `headAddress.street` (string, required)

  - `headAddress.streetNr` (string, required)

  - `headAddress.postalCode` (string, required)

  - `headAddress.box` (string)

  - `headAddress.city` (string, required)

  - `headAddress.countryCode` (string, required)

  - `headAddress.addressAdditionalLine` (string)

  - `emailAddress` (string)

  - `phoneNumber` (string)

  - `hasSeparateInvoicing` (boolean, required)

  - `isActive` (boolean, required)

## Response 201 fields (application/json):

  - `companyId` (string, required)
    Unique identifier of the department parent company

  - `erpId` (string, required)
    ERP identifier of the department

  - `id` (string, required)
    Unique identifier of the department

  - `identificationNumber` (string)
    Identification number of the department

  - `name` (string, required)
    Name of the department

  - `headAddress` (object, required)
    Head office address of the department

  - `headAddress.street` (string, required)

  - `headAddress.streetNr` (string, required)

  - `headAddress.postalCode` (string, required)

  - `headAddress.box` (string)

  - `headAddress.city` (string, required)

  - `headAddress.countryCode` (string, required)

  - `headAddress.addressAdditionalLine` (string)

  - `emailAddress` (string)
    Email address of the department

  - `phoneNumber` (string)
    Phone number of the department

  - `hasSeparateInvoicing` (boolean, required)
    Indicates if the department has separate invoicing

  - `isActive` (boolean, required)
    Indicates if the department is active

  - `createdAt` (string, required)
    Creation date of the department

  - `lastModifiedAt` (string, required)
    Last modification date of the department

  - `lastModifiedBy` (string, required)
    Last modified by information

## Response 400:

  - `400` (unknown)
    Invalid department payload or duplicate department name

## Response 415:

  - `415` (unknown)
    Request Content-Type is not 'application/json'

