Departments

Manage departments, managers and team structures

GET/api/v1/departments

List departments

Returns all departments in the organisation.

curl https://api.offly.net/api/v1/departments \
  -H "Authorization: Bearer YOUR_API_KEY"
Try it

Do not use production API keys on shared devices. Keys are stored in memory only.

POST/api/v1/departments

Create a department

Creates a new department. Requires admin or owner role.

Request body

FieldTypeDescription
name*string
manager_idstring(uuid)
default_leave_allowancenumber

Response

FieldTypeDescription
idstring(uuid)
namestring
manager_idstring(uuid)| null
default_leave_allowancenumber| null
created_atstring(date-time)
curl -X POST https://api.offly.net/api/v1/departments \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Try it

Do not use production API keys on shared devices. Keys are stored in memory only.

PATCH/api/v1/departments/{id}

Update a department

Updates a department. Requires admin or owner role.

Parameters

Parameters

NameTypeInDescription
id*string(uuid)path

Request body

FieldTypeDescription
namestring
manager_idstring(uuid)| null
default_leave_allowancenumber| null

Response

FieldTypeDescription
idstring(uuid)
namestring
manager_idstring(uuid)| null
default_leave_allowancenumber| null
created_atstring(date-time)
curl -X PATCH https://api.offly.net/api/v1/departments/{id} \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Try it

Do not use production API keys on shared devices. Keys are stored in memory only.

DELETE/api/v1/departments/{id}

Delete a department

Deletes a department. Requires admin or owner role.

Parameters

Parameters

NameTypeInDescription
id*string(uuid)path
curl -X DELETE https://api.offly.net/api/v1/departments/{id} \
  -H "Authorization: Bearer YOUR_API_KEY"
Try it

Do not use production API keys on shared devices. Keys are stored in memory only.