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 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 MethodEndpointDescriptionLimits & Notes
GET/v1/absencecodes/{absenceCode}Retrieve one absence code configurationabsenceCode required. companyId optional query parameter.
DELETE/v1/absencecodes/{absenceCode}Deactivate (soft-delete) an absence codeChanges status to ‘Closed’.

   

Swagger / Schema

Version v1

   

Method Details

Sample Request

GET /v1/absencecodes/HOLIDAY?companyId=EN

Sample 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

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

   

Limits & Notes

  • One absence code per call.
  • absenceCode path parameter is mandatory.
  • companyId query parameter is optional and defaults to the authenticated company context when omitted.

   

Validation Rules for GET Method (Single)

GET_001 - User is not authorised
ElementDetails
Scenario IDGET_001
Scenario NameUser is not authorised
HTTP Code403
GIVENA new 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-
THENRecord returned
Example Message“Record returned.”
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

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 (Single)

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)
Example Error 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-
THENupdate status to Closed
Example Error 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-
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.

       

Query APIs (Read-Only)