Absences
Valid Attributes
Attribute | Description | Details |
---|---|---|
user_id | The ID of the user to whom the absence belongs. | Must be set |
absence_type_id | The ID of the absence type of this absence. | Must be set |
starts_at | The start date of the absence. | Must be set (format: YYYY-MM-DD) |
ends_at | The end date of the absence. | Must be set; must be >= starts_at |
status | The status of the absence entry. | Cannot be set; defaults to created (options: created , confirmed , rejected ) |
Create
HTTP Request
POST /api/v1/absences
Example request:
{ "data": { "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06" } }}
Example response:
{ "data": { "id": "a6e9e2f8-5b4e-4a4b-8c7e-6a5b85a3c2b1", "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06", "status": "created" } }}
This endpoint creates a new absence entry.
Update
Example request:
{ "data": { "type": "absence", "attributes": { "status": "confirmed" } }}
Example response:
{ "data": { "id": "a6e9e2f8-5b4e-4a4b-8c7e-6a5b85a3c2b1", "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06", "status": "confirmed" } }}
This endpoint updates an absence entry.
HTTP Request
PUT /api/v1/absences/:absence_id
URL Parameters
Parameter | Description |
---|---|
absence_id | ID of the absence to be updated |
Show
Example response:
{ "data": { "id": "a6e9e2f8-5b4e-4a4b-8c7e-6a5b85a3c2b1", "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06", "status": "created" } }}
This endpoint returns an absence entry.
HTTP Request
GET /api/v1/absences/:absence_id
URL Parameters
Parameter | Description |
---|---|
absence_id | ID of the absence to return |
List
Example response:
{ "data": [ { "id": "a6e9e2f8-5b4e-4a4b-8c7e-6a5b85a3c2b1", "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06", "status": "created" } }, { ... } ]}
This endpoint returns absence entries.
HTTP Request
GET /api/v1/absences
Delete
Example response:
{ "data": { "id": "a6e9e2f8-5b4e-4a4b-8c7e-6a5b85a3c2b1", "type": "absence", "attributes": { "user_id": "9f8d7c6b-5a4e-3d2c-1b0a-9e8f7d6c5b4a", "absence_type_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "starts_at": "2025-10-02", "ends_at": "2025-10-06", "status": "confirmed", "discarded_at": "2025-10-13T11:30:00Z" } }}
This endpoint deletes an absence.
HTTP Request
DELETE /api/v1/absences/:absence_id
URL Parameters
Parameter | Description |
---|---|
absence_id | ID of the absence to delete |