Create a department
Creates a new department.
Tip
Check the Swagger page for more technical information on the endpoints.
Endpoint details
POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/departments
Headers: Authorization: Bearer {token}, User-Agent: {agent}
Scope: connector-protimeapi-departments.write
Body properties
| Field | Type | Required | Writable | Description |
|---|---|---|---|---|
name.default |
string | Yes | Yes | Default name of the department. |
name.translations |
object | No | Yes | Translated names, keyed by ISO language code (for example nl, fr). |
externalCode |
string | No | Yes | External code for the department. Maximum 50 characters. |
External references
This endpoint does not accept the externalReferences query parameter. Register a custom external reference for the created department with the external references endpoints.
Error responses
| Status | Condition |
|---|---|
400 |
Validation failed (missing name.default, invalid translation key, value too long) |
401 |
Missing or invalid access token, or insufficient scope |
Success response
201 Created with a Location header pointing to the new department. The response body is empty.
Examples
Create a department
POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/departments
{
"name": {
"default": "Production"
},
"externalCode": "PROD-01"
}Create a department with translated names
POST
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/departments
{
"name": {
"default": "Production",
"translations": {
"nl": "Productie",
"fr": "Production"
}
}
}