Skip to content

Absence Types

Attribute Description Details
account_id The ID of the account to which the absence type belongs. Cannot be set
active Whether an absence type is active or not Must be true or false
name The name of the absence type Must be set
quota_type_id ID of an Absence Quota Type Optional

Meta data: Permissions

Group Description
actions Contains permissions to edit or delete an absence type

The following relationships can be included in requests:

Relationship Type
quota_type belongs_to

POST /api/v1/absence_types

Example request:

{
"data": {
"type": "absence_type",
"attributes": {
"name": "Vacation"
}
}
}

Example response:

{
"data": {
"id": "a6e9e2g8-5p4e-4r4b-8c7e-6a5b85h3c2b1a",
"type": "absence_type",
"attributes": {
"active": true,
"account_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"name": "Vacation",
"quota_type_id": null
}
}
}

This endpoint creates a new absence type for an account.

Example request:

{
"data": {
"type": "absence_type",
"attributes": {
"name": "Updated Absence Type"
}
}
}

Example response:

{
"data": {
"id": "a6e9e2g8-5p4e-4r4b-8c7e-6a5b85h3c2b1a",
"type": "absence_type",
"attributes": {
...
}
}
}

This endpoint updates an absence type.

PUT /api/v1/absence_types/:absence_type_id

Parameter Description
absence_type_id ID of the absence type to be updated

Once any absence has been created with an absence type, the fields quota_type_id and required_confirmation_count can’t be changed.

Example response:

{
"data": [
{
"id": "a6e9e2g8-5p4e-4r4b-8c7e-6a5b85h3c2b1a",
"type": "absence_type",
"attributes": {
"active": true,
"account_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"name": "Vacation"
}
},
{
...
}
]
}

This endpoint returns all absence types in an account.

GET /api/v1/absence_types

Example response:

{
"data": [
{
"id": "6a1687a2-dee1-4e67-a68d-505d36683cd8",
"type": "absence_type",
"attributes": {
"active": true,
"account_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"name": "Sick Leave"
}
},
{
...
}
]
}

This endpoint returns all absence types that the specified user is allowed to use.

GET /api/v1/users/:user_id/absence_types

Parameter Description
user_id ID of the user whose absence types should be listed

Example response:

{
"data": {
"id": "a6e9e2g8-5p4e-4r4b-8c7e-6a5b85h3c2b1a",
"type": "absence_type",
"attributes": {
"active": true,
"account_id": "c2c3a4c9-5a9e-4ad8-9b7b-9a7d6c5b2e1f",
"name": "Vacation"
}
}
}

This endpoint returns an absence type.

GET /api/v1/absence_types/:absence_type_id

Parameter Description
absence_type_id The ID of the absence type to return

Example response:

{
"data": {
"id": "56555aac-4b49-4c75-b6b8-f2d6e8052d57",
"type": "absence_type",
"attributes": {
...
}
}
}

This endpoint deletes an absence type.

DELETE /api/v1/absence_types/:absence_type_id

Parameter Description
absence_type_id ID of the absence type to delete