Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

People Absence Company Resource

Correct an absence

put

The employee is taken from the stored record; only the period and reason change.

Authorizations
SessionIdstringRequired

SessionId

Path parameters
absenceIdstringRequiredExample: 64f8a0e2d5b7c9a1e3f4a5b6
Body

Absence period to register or correct

emailstringOptional

Employee e-mail. Give this or externalId when registering a new absence.

externalIdstringOptional

Employee id in the company's own HR system. Give this or email when registering.

fromstring · dateRequired

First day of the absence, inclusive

tostring · dateOptional

Last day of the absence, inclusive. Omit while the employee is still on leave; on a correction, sending it closes an ongoing absence and omitting it reopens a closed one.

reasonstring · enumRequired

Reason for a period of absence: work accident or temporary disability

Possible values:
Responses
200

OK

*/*

A period of absence of one employee

idstringOptional

Absence identifier (24-char hex)

emailstringOptional

Employee e-mail

namestringOptional

Employee name

externalIdstringOptional

Employee id in the company's own HR system

fromstring · dateOptional

First day of the absence, inclusive

tostring · dateOptional

Last day of the absence, inclusive. Null while the employee is still on leave.

ongoingbooleanOptional

True while the employee is still on leave, i.e. the absence has no end date yet

reasonstring · enumOptional

Reason for a period of absence: work accident or temporary disability

Possible values:
calendarDaysinteger · int32Optional

Duration in calendar days, both ends inclusive. This is the figure filters use. For an ongoing absence, the days elapsed up to today.

estimatedWorkingDaysinteger · int32Optional

Duration in working days, derived from the employee's registered shift. Null when the employee has no shift registered. It is an estimate — no bank-holiday calendar exists — and it is never used for filtering. Counted up to today while ongoing.

put/api/v1/company/absences/{absenceId}
PUT /api/v1/company/absences/{absenceId} HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "email": "text",
  "externalId": "text",
  "from": "2026-01-01",
  "to": "2026-01-01",
  "reason": "WORK_ACCIDENT"
}
200

OK

{
  "id": "text",
  "email": "text",
  "name": "text",
  "externalId": "text",
  "from": "2026-01-01",
  "to": "2026-01-01",
  "ongoing": true,
  "reason": "WORK_ACCIDENT",
  "calendarDays": 1,
  "estimatedWorkingDays": 1
}

Delete an absence

delete
Authorizations
SessionIdstringRequired

SessionId

Path parameters
absenceIdstringRequiredExample: 64f8a0e2d5b7c9a1e3f4a5b6
Responses
200

OK

No content

delete/api/v1/company/absences/{absenceId}
DELETE /api/v1/company/absences/{absenceId} HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Accept: */*
200

OK

No content

List absences overlapping a period

get

A leave counts when it overlaps the window; it need not be contained in it.

Authorizations
SessionIdstringRequired

SessionId

Query parameters
fromstring · dateOptional
tostring · dateOptional
Responses
200

OK

*/*

A period of absence of one employee

idstringOptional

Absence identifier (24-char hex)

emailstringOptional

Employee e-mail

namestringOptional

Employee name

externalIdstringOptional

Employee id in the company's own HR system

fromstring · dateOptional

First day of the absence, inclusive

tostring · dateOptional

Last day of the absence, inclusive. Null while the employee is still on leave.

ongoingbooleanOptional

True while the employee is still on leave, i.e. the absence has no end date yet

reasonstring · enumOptional

Reason for a period of absence: work accident or temporary disability

Possible values:
calendarDaysinteger · int32Optional

Duration in calendar days, both ends inclusive. This is the figure filters use. For an ongoing absence, the days elapsed up to today.

estimatedWorkingDaysinteger · int32Optional

Duration in working days, derived from the employee's registered shift. Null when the employee has no shift registered. It is an estimate — no bank-holiday calendar exists — and it is never used for filtering. Counted up to today while ongoing.

get/api/v1/company/absences
GET /api/v1/company/absences HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Accept: */*
200

OK

[
  {
    "id": "text",
    "email": "text",
    "name": "text",
    "externalId": "text",
    "from": "2026-01-01",
    "to": "2026-01-01",
    "ongoing": true,
    "reason": "WORK_ACCIDENT",
    "calendarDays": 1,
    "estimatedWorkingDays": 1
  }
]

Register a single absence

post
Authorizations
SessionIdstringRequired

SessionId

Body

Absence period to register or correct

emailstringOptional

Employee e-mail. Give this or externalId when registering a new absence.

externalIdstringOptional

Employee id in the company's own HR system. Give this or email when registering.

fromstring · dateRequired

First day of the absence, inclusive

tostring · dateOptional

Last day of the absence, inclusive. Omit while the employee is still on leave; on a correction, sending it closes an ongoing absence and omitting it reopens a closed one.

reasonstring · enumRequired

Reason for a period of absence: work accident or temporary disability

Possible values:
Responses
200

OK

*/*

A period of absence of one employee

idstringOptional

Absence identifier (24-char hex)

emailstringOptional

Employee e-mail

namestringOptional

Employee name

externalIdstringOptional

Employee id in the company's own HR system

fromstring · dateOptional

First day of the absence, inclusive

tostring · dateOptional

Last day of the absence, inclusive. Null while the employee is still on leave.

ongoingbooleanOptional

True while the employee is still on leave, i.e. the absence has no end date yet

reasonstring · enumOptional

Reason for a period of absence: work accident or temporary disability

Possible values:
calendarDaysinteger · int32Optional

Duration in calendar days, both ends inclusive. This is the figure filters use. For an ongoing absence, the days elapsed up to today.

estimatedWorkingDaysinteger · int32Optional

Duration in working days, derived from the employee's registered shift. Null when the employee has no shift registered. It is an estimate — no bank-holiday calendar exists — and it is never used for filtering. Counted up to today while ongoing.

post/api/v1/company/absences
POST /api/v1/company/absences HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "email": "text",
  "externalId": "text",
  "from": "2026-01-01",
  "to": "2026-01-01",
  "reason": "WORK_ACCIDENT"
}
200

OK

{
  "id": "text",
  "email": "text",
  "name": "text",
  "externalId": "text",
  "from": "2026-01-01",
  "to": "2026-01-01",
  "ongoing": true,
  "reason": "WORK_ACCIDENT",
  "calendarDays": 1,
  "estimatedWorkingDays": 1
}

Upload a spreadsheet of absences

post

Rows are processed independently: valid rows are stored even when others fail. The response reports every row — accepted, already existing, or rejected with the reason and its line number. A row identical to a stored absence is reported as already existing rather than as an error, so a corrected file can be uploaded whole.

Authorizations
SessionIdstringRequired

SessionId

Body
filestring · binaryRequired
Responses
200

OK

*/*

Per-row outcome of an absence spreadsheet upload

totalRowsinteger · int32Optional

Data rows read from the file, excluding the header

acceptedinteger · int32Optional

Rows stored by this upload

alreadyExistedinteger · int32Optional

Rows describing an absence that was already stored, identical in every field

closedinteger · int32Optional

Rows giving the end date of an absence stored as still ongoing, which is now closed

rejectedinteger · int32Optional

Rows that could not be stored

post/api/v1/company/absences/upload
POST /api/v1/company/absences/upload HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}
200

OK

{
  "totalRows": 1,
  "accepted": 1,
  "alreadyExisted": 1,
  "closed": 1,
  "rejected": 1,
  "rows": [
    {
      "line": 1,
      "outcome": "ACCEPTED",
      "error": "text",
      "employee": "text"
    }
  ]
}

Download the absence upload template

get

Empty xlsx with the expected columns and a dropdown of the accepted reasons.

Authorizations
SessionIdstringRequired

SessionId

Responses
200

OK

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
string · binaryOptional
get/api/v1/company/absences/template
GET /api/v1/company/absences/template HTTP/1.1
Host: api.happyforce.com
SessionId: YOUR_API_KEY
Accept: */*
200

OK

binary

Last updated