Absence codes
This page provides a comprehensive reference for all parameters, endpoints, and behaviour 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 create, retrieve, update, 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 |
|---|---|---|---|
| POST | /v1/absencecodes | Create a new absence code configuration | One absence code per call. Shares the resolved company context. |
| GET | /v1/absencecodes/{absenceCode} | Retrieve one absence code configuration | absenceCode required. companyId optional query parameter. |
| PUT | /v1/absencecodes | Update an existing absence code configuration | absenceCode required. Full update of the configuration payload. |
| DELETE | /v1/absencecodes/{absenceCode} | Deactivate (soft-delete) an absence code | Changes status to Closed (C). |
Swagger / Schema
Version v1
Method Details
Sample Request
{
"companyId": "EN",
"absenceCode": "HOLIDAY",
"description": "Holidays",
"status": "N",
"dateFrom": "2006-01-01T00:00:00.000",
"dateTo": "2050-12-31T00:00:00.000",
"position": true,
"relations": [{
"relAttributeId": "NS",
"relValue": "LEAVEPAID",
"value1": 0
}],
"balances": [],
"limitControl": [],
"customFieldGroups": {}
}
Mandatory request body properties
| Property | Value | Description | Data Type |
|---|---|---|---|
| absenceCode | required | Unique absence code identifier | string |
| companyId | required | Company context | string |
| description | required | Description text | string |
| status | required | Absence code status. Active status is N. | string |
| dateTo | required | Validity end | string |
Limits & Notes
dateFromis not mandatory, but defaults to the minimum date 1900-01-01.
Validation Rules for POST Method
POST_001 - User is not authorised
| Element | Details |
|---|---|
| Scenario ID | POST_001 |
| Scenario Name | User is not authorised |
| HTTP Code | 403 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST 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.” |
POST_002 - Unknown companyID
| Element | Details |
|---|---|
| Scenario ID | POST_002 |
| Scenario Name | Unknown companyID |
| HTTP Code | 403 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | Company ID invalid or inaccessible |
| THEN | API is not reached; 403 Forbidden response is returned |
| Example Error Message | “User is not authorised.” |
POST_003 - Absence code created
| Element | Details |
|---|---|
| Scenario ID | POST_003 |
| Scenario Name | Absence code created |
| HTTP Code | 201 |
| GIVEN | Valid payload |
| WHEN | Calling the POST method of the API |
| BUT | - |
| THEN | Record created; 201 Created response is returned |
| Example Message | Response: returns the JSON of the created Absence code. |
POST_004 - Missing mandatory fields
| Element | Details |
|---|---|
| Scenario ID | POST_004 |
| Scenario Name | Missing mandatory fields |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | A field that is marked mandatory in the schema is missing |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “The {0} field is required.” |
POST_005 - Duplicate absence code
| Element | Details |
|---|---|
| Scenario ID | POST_005 |
| Scenario Name | Duplicate absence code |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | Code already exists for the company |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Item already exists - not saved.” |
POST_006 - Invalid data
| Element | Details |
|---|---|
| Scenario ID | POST_006 |
| Scenario Name | Invalid data |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | Data does not exist in ERP (attribute values, list of possible values) |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Illegal value {0} for {1}.” |
POST_007 - Unsatisfied model restrictions
| Element | Details |
|---|---|
| Scenario ID | POST_007 |
| Scenario Name | Unsatisfied model restrictions |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | Field violates model restrictions (length, range, numeric limits) |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “The field {0} must be a string or array type with a maximum length of {1}.” |
POST_008 - Position mandatory set to true but position is false
| Element | Details |
|---|---|
| Scenario ID | POST_008 |
| Scenario Name | Position mandatory set to true but position is false |
| HTTP Code | 422 |
| GIVEN | New absence code requested with position mandatory flag set to true |
| WHEN | Calling the POST method of the API |
| BUT | Position flag is set to false |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Position mandatory can only be activated when Position is activated.” |
POST_009 - Reduce balance on export is true but export to timesheet is false
| Element | Details |
|---|---|
| Scenario ID | POST_009 |
| Scenario Name | Reduce balance on export is true but export to timesheet flag set to false |
| HTTP Code | 422 |
| GIVEN | New absence code requested with reduce balance flag set to true |
| WHEN | Calling the POST method of the API |
| BUT | Export to timesheet flag set to false |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Reduce balance on export can only be activated when Number to order (purchase price units) is activated.” |
POST_010 - Duplicate relation error handling
| Element | Details |
|---|---|
| Scenario ID | POST_010 |
| Scenario Name | Duplicate relation error handling |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | JSON body contains the same relation information more than once (duplicate) |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Duplicate rows not allowed.” |
POST_011 - Duplicate balances error handling
| Element | Details |
|---|---|
| Scenario ID | POST_011 |
| Scenario Name | Duplicate balances error handling |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | JSON body contains the same balance information more than once (duplicate) |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Duplicate balances found for {0}: {1}. Only one balance should exist for each combination” / “Duplicate rows not allowed.” |
POST_012 - Duplicate limit error handling
| Element | Details |
|---|---|
| Scenario ID | POST_012 |
| Scenario Name | Duplicate limit error handling |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | JSON body contains the same limit error information more than once (duplicated) |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Duplicate rows not allowed.” |
POST_013 - Invalid limit attributeValue
| Element | Details |
|---|---|
| Scenario ID | POST_013 |
| Scenario Name | Invalid limit attributeValue |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created with Limit control |
| WHEN | Calling the POST method of the API |
| BUT | The attributeValue provided does not match the ID of the absence code we want to create |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “Links all entries that use this absence code {0}.” |
POST_014 - Invalid No dup. value on limit control
| Element | Details |
|---|---|
| Scenario ID | POST_014 |
| Scenario Name | No dup. is set to true when Control is not Days or Hours |
| HTTP Code | 422 |
| GIVEN | A new absence code needs to be created |
| WHEN | Calling the POST method of the API |
| BUT | In the LimitControl DTO, No dup. is set to true and Control is not set to Days or Hours |
| THEN | Absence code is not created; 422 response is returned |
| Example Error Message | “The No dup. option can only be activated if the selected limit control is set to Days or Hours.” |
Sample Request
GET /v1/absencecodes/HOLIDAY?companyId=EN
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 |
Validation Rules for GET Method
GET_001 - User is not authorised
| Element | Details |
|---|---|
| Scenario ID | GET_001 |
| Scenario Name | User is not authorised |
| HTTP Code | 403 |
| GIVEN | An 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 | 200 response is returned together with the information about the absence code |
| Example Message | “Absence code information is retrieved.” |
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
{
"companyId": "EN",
"absenceCode": "HOL_BAL",
"description": "BALANCES",
"shortRef": "",
"status": "N",
"dateFrom": "1900-01-01T00:00:00.000",
"dateTo": "2050-12-31T00:00:00.000",
"reasonCodeId": "",
"unit": "",
"columnName": "",
"criteriaValue": 0,
"criteriaStop": true,
"daysBetween": 0,
"position": true,
"positionMandatory": false,
"disconnectedFromWorkSchedule": false,
"openEndedAbsence": true,
"aggregateDetail": true,
"aggregateOnImport": false,
"exportToTimesheet": false,
"selfService": false,
"report": false,
"request": false,
"reduceBalance": false,
"readyAsDefault": false,
"readOnlyWhenOnWorkflow": false,
"ignoreLeadingOffDays": false,
"ignoreTrailingOffDays": false,
"linkIfNoWorkdaysBetween": false,
"doNotCountLeadingDaysOff": false,
"doNotCountTrailingDaysOff": false,
"doNotTransferDaysOffAtStartOfCase": false,
"gapOffTransferOptions": "0",
"freeField2": {
"use": false,
"lock": false,
"sum": false,
"formula": "A18",
"useInDetails": false,
"lockInDetails": false,
"formulaInDetails": ""
},
"freeField3": {
"use": false,
"lock": false,
"sum": false,
"formula": "",
"useInDetails": true,
"lockInDetails": false,
"formulaInDetails": "XHALF"
},
"relations": [
{
"relAttributeId": "C35",
"relValue": "SICKBENEFIT",
"value1": 1
}
],
"balances": [
{
"balanceId": "L403",
"balanceField": "no_of_days",
"credit": true
},
{
"balanceId": "ALC",
"balanceField": "total_hrs",
"credit": false
}
],
"limitControl": [
],
"customFieldGroups": {}
}
Mandatory request body properties
| Property | Value | Description | Data Type |
|---|---|---|---|
| absenceCode | required | Unique absence code identifier | string |
| companyId | required | Company context | string |
| description | required | Description text | string |
| status | required | Absence code status. Active status is N. | string |
| dateTo | required | Validity end | string |
Validation Rules for PUT Method
PUT_001 - User is not authorised
| Element | Details |
|---|---|
| Scenario ID | PUT_001 |
| Scenario Name | User is not authorised |
| HTTP Code | 403 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT 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.” |
PUT_002 - Unknown companyID
| Element | Details |
|---|---|
| Scenario ID | PUT_002 |
| Scenario Name | Unknown companyID |
| HTTP Code | 403 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT 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.” |
PUT_003 - Absence code updated
| Element | Details |
|---|---|
| Scenario ID | PUT_003 |
| Scenario Name | Absence code updated |
| HTTP Code | 200 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | - |
| THEN | Record updated; 200 OK response is returned |
| Example Message | Response: returns the JSON with the information of the updated record. |
PUT_004 - Absence code not found
| Element | Details |
|---|---|
| Scenario ID | PUT_004 |
| Scenario Name | Absence code not found |
| HTTP Code | 404 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | The given absence code ID does not exist |
| THEN | Absence code is not updated; 404 response is returned |
| Example Error Message | “The entity of the following parameters [Company: {0}, AbsenceCode: {1}] was not found.” |
PUT_005 - Missing mandatory fields
| Element | Details |
|---|---|
| Scenario ID | PUT_005 |
| Scenario Name | Missing mandatory fields |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | A mandatory field is missing |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “The {0} field is required.” |
PUT_006 - Duplicated values
| Element | Details |
|---|---|
| Scenario ID | PUT_006 |
| Scenario Name | Duplicate values such as Relations, Limit control or Balances |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | The given JSON contains duplicated values |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “Duplicate rows not allowed.” |
PUT_007 - Invalid data
| Element | Details |
|---|---|
| Scenario ID | PUT_007 |
| Scenario Name | Invalid data |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | Data does not exist in ERP (attribute values, list of possible values) |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “Illegal value {0} for {1}” / “Illegal value entered” / “Illegal {0}.” |
PUT_008 - Unsatisfied model restrictions
| Element | Details |
|---|---|
| Scenario ID | PUT_008 |
| Scenario Name | Unsatisfied model restrictions |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | Field violates model restrictions (length, range, numeric limits) |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “The field {0} must be a string or array type with a maximum length of {1}.” |
PUT_009 - Position mandatory set to true but position is false
| Element | Details |
|---|---|
| Scenario ID | PUT_009 |
| Scenario Name | Position mandatory set to true but position is false |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | Position flag is set to false |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “Position mandatory can only be activated when Position is activated.” |
PUT_010 - Reduce balance on export is true but export to timesheet is false
| Element | Details |
|---|---|
| Scenario ID | PUT_010 |
| Scenario Name | Reduce balance on export is true but export to timesheet flag set to false |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | Export to timesheet flag set to false |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “Reduce balance on export can only be activated when Number to order (purchase price units) is activated.” |
PUT_011 - Invalid No dup. value on limit control
| Element | Details |
|---|---|
| Scenario ID | PUT_011 |
| Scenario Name | No dup. is set to true when Control is not Days or Hours |
| HTTP Code | 422 |
| GIVEN | An existing absence code needs to be updated |
| WHEN | Calling the PUT method of the API |
| BUT | In the LimitControl DTO, No dup. set to true and Control is not set to Days or Hours |
| THEN | Absence code is not updated; 422 response is returned |
| Example Error Message | “The No dup. option can only be activated if the selected limit control is set to Days or Hours.” |
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
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). 200 response is returned with an empty response body |
| Example Message | Empty 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 | Status changed to Closed (C). 200 response is returned with an empty response body |
| Example Message | Empty 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 | The status remains Closed (C). 200 response is returned with an empty response body |
| Example Message | Empty message. |
Best Practices
Resolve and validate company context before invoking CRUD operations.
Validate reference data and attribute values before POST/PUT to prevent 422 errors.
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.