Skip to content

Absence Types

AttributeDescriptionDetails
account_idThe ID of the account to which the absence type belongs.Cannot be set
activeWhether an absence type is active or notMust be true or false
nameThe name of the absence typeMust be set
quota_type_idID of an Absence Quota TypeOptional

Meta data: Permissions

GroupDescription
actionsContains permissions to edit or delete an absence type

The following relationships can be included in requests:

RelationshipType
quota_typebelongs_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

ParameterDescription
absence_type_idID 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

ParameterDescription
user_idID 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

ParameterDescription
absence_type_idThe 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

ParameterDescription
absence_type_idID of the absence type to delete