Absence codes
This page provides a comprehensive reference for all parameters, endpoints, and behaviors of the Absence codes API. Use this guide to understand request/response structures, validation rules, and integration best practices.
Purpose:
The Absence codes API manages absence code configuration used in HR Core absence processing. It enables external applications and configuration services to retrieve and deactivate absence codes, including related balances, relations, and flexi-field-dependent behaviour.
Base URL:/v1/absencecodes
Authentication:
All APIs require a Client ID and Client Secret. Refer to the global authentication documentation for details.
System Parameters:
No system parameters apply to this API.
Company Context Rule (all methods): companyId is resolved from an explicit companyId request parameter (if provided), otherwise from an authenticated token context. All operations are executed in that resolved company context.
Supported Methods
| HTTP Method | Endpoint | Description | Limits & Notes |
|---|---|---|---|
| GET | /v1/absencecodes/{absenceCode} | Retrieve one absence code configuration | absenceCode required. companyId optional query parameter. |
| DELETE | /v1/absencecodes/{absenceCode} | Deactivate (soft-delete) an absence code | Changes status to ‘Closed’. |
Swagger / Schema
Version v1
Method Details
Sample Request
GET /v1/absencecodes/HOLIDAY?companyId=ENSample Response
(Success - 200 OK)
{
"companyId": "EN",
"absenceCode": "HOLIDAY",
"description": "Holiday",
"shortRef": "HOLY",
"status": "N",
"dateFrom": "2020-01-01T00:00:00.000",
"dateTo": "2030-12-31T00:00:00.000",
"reasonCodeId": "C06",
"unit": "",
"columnName": "",
"criteriaValue": 0,
"criteriaStop": false,
"daysBetween": 0,
"position": true,
"positionMandatory": false,
"disconnectedFromWorkSchedule": false,
"openEndedAbsence": false,
"aggregateDetail": false,
"aggregateOnImport": false,
"exportToTimesheet": false,
"selfService": true,
"report": false,
"request": true,
"reduceBalance": false,
"readyAsDefault": false,
"readOnlyWhenOnWorkflow": false,
"ignoreLeadingOffDays": false,
"ignoreTrailingOffDays": false,
"linkIfNoWorkdaysBetween": false,
"doNotCountLeadingDaysOff": false,
"doNotCountTrailingDaysOff": false,
"doNotTransferDaysOffAtStartOfCase": false,
"gapOffTransferOptions": "0",
"freeField1": {
"use": false,
"lock": false,
"sum": false,
"useInDetails": false,
"lockInDetails": false
},
"freeField2": {
"use": false,
"lock": false,
"sum": false,
"useInDetails": false,
"lockInDetails": false
},
"freeField3": {
"use": false,
"lock": false,
"sum": false,
"useInDetails": false,
"lockInDetails": false
},
"freeField4": {
"use": true,
"lock": true,
"sum": true,
"useInDetails": true,
"lockInDetails": true
},
"relations": [
{
"relAttributeId": "NS",
"relValue": "HOLIDAY",
"value1": 0,
"lastUpdated": {
"updatedAt": "2026-07-27T07:07:29.000",
"updatedBy": "SYSEN"
}
}
],
"balances": [
{
"balanceId": "L402",
"balanceField": "no_of_days"
},
{
"balanceId": "ALB",
"balanceField": "value_4"
}
],
"limitControl": [
{
"attributeId": "CF",
"attributeValue": "HOLIDAY",
"attributeId2": "C50",
"attributeValue2": "SCHEME",
"controlValue": 1,
"balanceValue": "",
"limitHorizon": 4,
"limitHorizonValue": 0,
"treatmentValue": 1,
"minLimit": 0,
"maxLimit": 0,
"limitSign": "",
"noDup": false,
"dateFrom": "1900-01-01T00:00:00.000",
"dateTo": "1900-01-01T00:00:00.000",
"statusValue": "N",
"sequenceNumber": 3
}
],
"customFieldGroups": {
"group1": {
"notes_fx": ""
}
},
"lastUpdated": {
"updatedAt": "2025-04-07T08:12:52.000",
"updatedBy": "SYSID"
}
}
Path Parameters
| Parameter | Value | Description | Data Type | Required |
|---|---|---|---|---|
| absenceCode | required | Specify an absence code configuration you want to retrieve | string | yes |
Query Parameters
| Parameter | Value | Description | Data Type | Required |
|---|---|---|---|---|
| companyId | optional | Specify which companyId the absence code configuration should be retrieved from | query | no |
Limits & Notes
- One absence code per call.
absenceCodepath parameter is mandatory.companyIdquery parameter is optional and defaults to the authenticated company context when omitted.
Validation Rules for GET Method (Single)
GET_001 - User is not authorised
| Element | Details |
|---|---|
| Scenario ID | GET_001 |
| Scenario Name | User is not authorised |
| HTTP Code | 403 |
| GIVEN | A new absence code needs to be retrieved |
| WHEN | Calling the GET method of the API |
| BUT | User does NOT have permissions |
| THEN | API is not reached; 403 Forbidden response is returned |
| Example Error Message | “User is not authorised.” |
GET_002 - Unknown companyID
| Element | Details |
|---|---|
| Scenario ID | GET_002 |
| Scenario Name | Unknown companyID |
| HTTP Code | 403 |
| GIVEN | An absence code needs to be retrieved |
| WHEN | Calling the GET method of the API |
| BUT | CompanyID invalid or inaccessible |
| THEN | API is not reached; 403 Forbidden response is returned |
| Example Error Message | “User is not authorised.” |
GET_003 - Absence code retrieved
| Element | Details |
|---|---|
| Scenario ID | GET_003 |
| Scenario Name | Absence code retrieved |
| HTTP Code | 200 |
| GIVEN | Existing code in company |
| WHEN | Calling the GET method of the API |
| BUT | - |
| THEN | Record returned |
| Example Message | “Record returned.” |
GET_004 - Absence code not found
| Element | Details |
|---|---|
| Scenario ID | GET_004 |
| Scenario Name | Absence code not found |
| HTTP Code | 404 |
| GIVEN | An absence code needs to be retrieved |
| WHEN | Calling the GET method of the API |
| BUT | Code does not exist in company |
| THEN | No data returned |
| Example Error Message | “The entity of the following parameters [Company: EN, AbsenceCode: HOLIDAYXX] was not found” |
Sample Request
DELETE /v1/absencecodes/HOLIDAY?companyId=EN
Path Parameters
| Parameter | Value | Description | Data Type | Required |
|---|---|---|---|---|
| absenceCode | required | Specify an absence code configuration you want to deactivate (soft-delete) | string | yes |
Query Parameters
| Parameter | Value | Description | Data Type | Required |
|---|---|---|---|---|
| companyId | optional | Specify which companyId the request applies to | query | no |
Limits & Notes
- This is a soft delete: absence code is deactivated by setting its status to Closed.
- No hard delete is performed.
Validation Rules for DELETE Method (Single)
DEL_001 - User is not authorised
| Element | Details |
|---|---|
| Scenario ID | DEL_001 |
| Scenario Name | User is not authorised |
| HTTP Code | 403 |
| GIVEN | Existing absence code |
| WHEN | Calling the DELETE method of the API |
| BUT | User does NOT have permissions |
| THEN | API is not reached; 403 Forbidden response is returned |
| Example Error Message | “User is not authorised.” |
DEL_002 - Unknown companyID
| Element | Details |
|---|---|
| Scenario ID | DEL_002 |
| Scenario Name | Unknown companyID |
| HTTP Code | 403 |
| GIVEN | Existing absence code |
| WHEN | Calling the DELETE method of the API |
| BUT | companyID invalid or inaccessible |
| THEN | API is not reached; 403 Forbidden response is returned |
| Example Error Message | “User is not authorised.” |
DEL_003 - Absence code deactivated
| Element | Details |
|---|---|
| Scenario ID | DEL_003 |
| Scenario Name | Absence code deactivated |
| HTTP Code | 200 |
| GIVEN | Existing code |
| WHEN | Calling the DELETE method of the API |
| BUT | - |
| THEN | Status changed to Closed (C) |
| Example Error Message | - |
DEL_004 - Absence code not found
| Element | Details |
|---|---|
| Scenario ID | DEL_004 |
| Scenario Name | Absence code not found |
| HTTP Code | 404 |
| GIVEN | Existing code expected |
| WHEN | Calling the DELETE method of the API |
| BUT | Code does not exist in the company |
| THEN | The record is not found; 404 response is returned |
| Example Error Message | “Absence code VACATIONXX was not found within company EN.” |
DEL_005 - Absence code with Parked status
| Element | Details |
|---|---|
| Scenario ID | DEL_005 |
| Scenario Name | Absence code with Parked status |
| HTTP Code | 200 |
| GIVEN | Existing absence code |
| WHEN | Calling the DELETE method of the API |
| BUT | - |
| THEN | update status to Closed |
| Example Error Message | - |
DEL_006 - Absence code with Closed status
| Element | Details |
|---|---|
| Scenario ID | DEL_006 |
| Scenario Name | Absence code with Closed status |
| HTTP Code | 200 |
| GIVEN | Existing absence code |
| WHEN | Calling the DELETE method of the API |
| BUT | - |
| THEN | - |
| Example Error Message | - |
Best Practices
Resolve and validate company context before invoking CRUD operations.
Keep relation/balance payloads consistent with existing setup metadata.
Implement idempotent client behaviour for retries where appropriate (especially for network/server errors).
Log and propagate correlationId for support troubleshooting.