1. U4 ERPx
  2. API Reference
  3. Time and expenses
  4. Absence codes

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 MethodEndpointDescriptionLimits & Notes
POST/v1/absencecodesCreate a new absence code configurationOne absence code per call. Shares the resolved company context.
GET/v1/absencecodes/{absenceCode}Retrieve one absence code configurationabsenceCode required. companyId optional query parameter.
PUT/v1/absencecodesUpdate an existing absence code configurationabsenceCode required. Full update of the configuration payload.
DELETE/v1/absencecodes/{absenceCode}Deactivate (soft-delete) an absence codeChanges 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

PropertyValueDescriptionData Type
absenceCoderequiredUnique absence code identifierstring
companyIdrequiredCompany contextstring
descriptionrequiredDescription textstring
statusrequiredAbsence code status. Active status is N.string
dateTorequiredValidity endstring

   

Limits & Notes

  • dateFrom is not mandatory, but defaults to the minimum date 1900-01-01.

   

Validation Rules for POST Method

POST_001 - User is not authorised
ElementDetails
Scenario IDPOST_001
Scenario NameUser is not authorised
HTTP Code403
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTUser does not have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
POST_002 - Unknown companyID
ElementDetails
Scenario IDPOST_002
Scenario NameUnknown companyID
HTTP Code403
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTCompany ID invalid or inaccessible
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
POST_003 - Absence code created
ElementDetails
Scenario IDPOST_003
Scenario NameAbsence code created
HTTP Code201
GIVENValid payload
WHENCalling the POST method of the API
BUT-
THENRecord created; 201 Created response is returned
Example MessageResponse: returns the JSON of the created Absence code.
POST_004 - Missing mandatory fields
ElementDetails
Scenario IDPOST_004
Scenario NameMissing mandatory fields
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTA field that is marked mandatory in the schema is missing
THENAbsence code is not created; 422 response is returned
Example Error Message“The {0} field is required.”
POST_005 - Duplicate absence code
ElementDetails
Scenario IDPOST_005
Scenario NameDuplicate absence code
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTCode already exists for the company
THENAbsence code is not created; 422 response is returned
Example Error Message“Item already exists - not saved.”
POST_006 - Invalid data
ElementDetails
Scenario IDPOST_006
Scenario NameInvalid data
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTData does not exist in ERP (attribute values, list of possible values)
THENAbsence code is not created; 422 response is returned
Example Error Message“Illegal value {0} for {1}.”
POST_007 - Unsatisfied model restrictions
ElementDetails
Scenario IDPOST_007
Scenario NameUnsatisfied model restrictions
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTField violates model restrictions (length, range, numeric limits)
THENAbsence 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
ElementDetails
Scenario IDPOST_008
Scenario NamePosition mandatory set to true but position is false
HTTP Code422
GIVENNew absence code requested with position mandatory flag set to true
WHENCalling the POST method of the API
BUTPosition flag is set to false
THENAbsence 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
ElementDetails
Scenario IDPOST_009
Scenario NameReduce balance on export is true but export to timesheet flag set to false
HTTP Code422
GIVENNew absence code requested with reduce balance flag set to true
WHENCalling the POST method of the API
BUTExport to timesheet flag set to false
THENAbsence 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
ElementDetails
Scenario IDPOST_010
Scenario NameDuplicate relation error handling
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTJSON body contains the same relation information more than once (duplicate)
THENAbsence code is not created; 422 response is returned
Example Error Message“Duplicate rows not allowed.”
POST_011 - Duplicate balances error handling
ElementDetails
Scenario IDPOST_011
Scenario NameDuplicate balances error handling
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTJSON body contains the same balance information more than once (duplicate)
THENAbsence 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
ElementDetails
Scenario IDPOST_012
Scenario NameDuplicate limit error handling
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTJSON body contains the same limit error information more than once (duplicated)
THENAbsence code is not created; 422 response is returned
Example Error Message“Duplicate rows not allowed.”
POST_013 - Invalid limit attributeValue
ElementDetails
Scenario IDPOST_013
Scenario NameInvalid limit attributeValue
HTTP Code422
GIVENA new absence code needs to be created with Limit control
WHENCalling the POST method of the API
BUTThe attributeValue provided does not match the ID of the absence code we want to create
THENAbsence 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
ElementDetails
Scenario IDPOST_014
Scenario NameNo dup. is set to true when Control is not Days or Hours
HTTP Code422
GIVENA new absence code needs to be created
WHENCalling the POST method of the API
BUTIn the LimitControl DTO, No dup. is set to true and Control is not set to Days or Hours
THENAbsence 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

ParameterValueDescriptionData TypeRequired
absenceCoderequiredSpecify an absence code configuration you want to retrievestringyes

   

Query Parameters

ParameterValueDescriptionData TypeRequired
companyIdoptionalSpecify which companyId the absence code configuration should be retrieved fromqueryno

   

Validation Rules for GET Method

GET_001 - User is not authorised
ElementDetails
Scenario IDGET_001
Scenario NameUser is not authorised
HTTP Code403
GIVENAn absence code needs to be retrieved
WHENCalling the GET method of the API
BUTUser does NOT have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
GET_002 - Unknown companyID
ElementDetails
Scenario IDGET_002
Scenario NameUnknown companyID
HTTP Code403
GIVENAn absence code needs to be retrieved
WHENCalling the GET method of the API
BUTCompanyID invalid or inaccessible
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
GET_003 - Absence code retrieved
ElementDetails
Scenario IDGET_003
Scenario NameAbsence code retrieved
HTTP Code200
GIVENExisting code in company
WHENCalling the GET method of the API
BUT-
THEN200 response is returned together with the information about the absence code
Example Message“Absence code information is retrieved.”
GET_004 - Absence code not found
ElementDetails
Scenario IDGET_004
Scenario NameAbsence code not found
HTTP Code404
GIVENAn absence code needs to be retrieved
WHENCalling the GET method of the API
BUTCode does not exist in company
THENNo 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

PropertyValueDescriptionData Type
absenceCoderequiredUnique absence code identifierstring
companyIdrequiredCompany contextstring
descriptionrequiredDescription textstring
statusrequiredAbsence code status. Active status is N.string
dateTorequiredValidity endstring

   

Validation Rules for PUT Method

PUT_001 - User is not authorised
ElementDetails
Scenario IDPUT_001
Scenario NameUser is not authorised
HTTP Code403
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTUser does not have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
PUT_002 - Unknown companyID
ElementDetails
Scenario IDPUT_002
Scenario NameUnknown companyID
HTTP Code403
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTCompanyID invalid or inaccessible
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
PUT_003 - Absence code updated
ElementDetails
Scenario IDPUT_003
Scenario NameAbsence code updated
HTTP Code200
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUT-
THENRecord updated; 200 OK response is returned
Example MessageResponse: returns the JSON with the information of the updated record.
PUT_004 - Absence code not found
ElementDetails
Scenario IDPUT_004
Scenario NameAbsence code not found
HTTP Code404
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTThe given absence code ID does not exist
THENAbsence 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
ElementDetails
Scenario IDPUT_005
Scenario NameMissing mandatory fields
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTA mandatory field is missing
THENAbsence code is not updated; 422 response is returned
Example Error Message“The {0} field is required.”
PUT_006 - Duplicated values
ElementDetails
Scenario IDPUT_006
Scenario NameDuplicate values such as Relations, Limit control or Balances
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTThe given JSON contains duplicated values
THENAbsence code is not updated; 422 response is returned
Example Error Message“Duplicate rows not allowed.”
PUT_007 - Invalid data
ElementDetails
Scenario IDPUT_007
Scenario NameInvalid data
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTData does not exist in ERP (attribute values, list of possible values)
THENAbsence 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
ElementDetails
Scenario IDPUT_008
Scenario NameUnsatisfied model restrictions
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTField violates model restrictions (length, range, numeric limits)
THENAbsence 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
ElementDetails
Scenario IDPUT_009
Scenario NamePosition mandatory set to true but position is false
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTPosition flag is set to false
THENAbsence 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
ElementDetails
Scenario IDPUT_010
Scenario NameReduce balance on export is true but export to timesheet flag set to false
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTExport to timesheet flag set to false
THENAbsence 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
ElementDetails
Scenario IDPUT_011
Scenario NameNo dup. is set to true when Control is not Days or Hours
HTTP Code422
GIVENAn existing absence code needs to be updated
WHENCalling the PUT method of the API
BUTIn the LimitControl DTO, No dup. set to true and Control is not set to Days or Hours
THENAbsence 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

ParameterValueDescriptionData TypeRequired
absenceCoderequiredSpecify an absence code configuration you want to deactivate (soft-delete)stringyes

   

Query Parameters

ParameterValueDescriptionData TypeRequired
companyIdoptionalSpecify which companyId the request applies toqueryno

   

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
ElementDetails
Scenario IDDEL_001
Scenario NameUser is not authorised
HTTP Code403
GIVENExisting absence code
WHENCalling the DELETE method of the API
BUTUser does NOT have permissions
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
DEL_002 - Unknown companyID
ElementDetails
Scenario IDDEL_002
Scenario NameUnknown companyID
HTTP Code403
GIVENExisting absence code
WHENCalling the DELETE method of the API
BUTCompanyID invalid or inaccessible
THENAPI is not reached; 403 Forbidden response is returned
Example Error Message“User is not authorised.”
DEL_003 - Absence code deactivated
ElementDetails
Scenario IDDEL_003
Scenario NameAbsence code deactivated
HTTP Code200
GIVENExisting code
WHENCalling the DELETE method of the API
BUT-
THENStatus changed to Closed (C). 200 response is returned with an empty response body
Example MessageEmpty message.
DEL_004 - Absence code not found
ElementDetails
Scenario IDDEL_004
Scenario NameAbsence code not found
HTTP Code404
GIVENExisting code expected
WHENCalling the DELETE method of the API
BUTCode does not exist in the company
THENThe 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
ElementDetails
Scenario IDDEL_005
Scenario NameAbsence code with Parked status
HTTP Code200
GIVENExisting absence code
WHENCalling the DELETE method of the API
BUT-
THENStatus changed to Closed (C). 200 response is returned with an empty response body
Example MessageEmpty message.
DEL_006 - Absence code with Closed status
ElementDetails
Scenario IDDEL_006
Scenario NameAbsence code with Closed status
HTTP Code200
GIVENExisting absence code
WHENCalling the DELETE method of the API
BUT-
THENThe status remains Closed (C). 200 response is returned with an empty response body
Example MessageEmpty 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.

       

Query APIs (Read-Only)