Salary and absenceRegister a full day of absence (for the caller)

Register a full day of absence (for the caller)

Registers a full day of absence for the calling user on an absence code; the hours are the user's normal working time that day.

Creates an absence time registration for the authenticated user on Date with the caller's full normal working hours for that date. Type in the body is ignored. On a full/half-day absence CODE a second registration on the same code and date is refused (37954). Returns no body.

Use it to:

  • Self-service sick-day or vacation-day registration from an employee app.

Not for:

  • Absence for another employee — use POST /v1/time-registration (GroupType 3, TimeTrackingFormat 1).
  • Several days at once — call once per day (no range parameter).

Behaviour:

  • Not idempotent.
  • Safe to retry only under a condition. On a full/half-day CODE a retry after success is refused with 37954. On an hours-format code a retry duplicates.
  • Duplicates: Same code + same date refused (37954) only when the absence CODE's own format is full/half day.
  • Side effect: Creates an absence time registration for the caller and posts it to the code's salary account.
  • Side effect: Same save path as POST /v1/time-registration (TimeRegistrationCreated event).
  • Read-after-write consistency: not yet documented.

Call first: GET /v1/absence-code/{status}

See also: POST /v1/time-registration/update-full-day-absence, POST /v1/absence-code/registration-by-half-day

Not yet documented: behaviour → consistency; examples (success).

curl -X POST "https://app3.timelog.com/your-account/api/v1/absence-code/registration-by-full-day" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "AbsenceID": 123,
  "Date": "2024-12-25T10:00:00Z",
  "Comment": "null",
  "Hours": 3.14,
  "Minutes": 42,
  "Type": 42
}'
"null"
POST
/v1/absence-code/registration-by-full-day
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp). The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user. > Not yet documented: how to obtain a token. > Not yet documented: token lifetime.

OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp). The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user. > Not yet documented: how to obtain a token. > Not yet documented: token lifetime.
Content-Typestring
Required

The media type of the request body

Options: application/json
AbsenceIDinteger
Required

The absence code to register on (AbsenceCodeID from GET /v1/absence-code/{status}). Can be set on create only. Refers to AbsenceCodeRead.AbsenceCodeID. Look up valid values with GET /v1/absence-code/{status}. - Not an existing absence code — 38034 absence-not-found (HTTP 422). - Code's salary account is inactive — 37977 (HTTP 422). - Code's own TimeTrackingFormat differs from the endpoint called — Not checked — the registration takes the endpoint's format. Valid values come from GET /v1/absence-code/{status}.

Format: int32
Datestring
Required

The day of the absence. Only the date part is used (time is discarded). Can be set on create only. Date only — no time component. - Always — Truncated to the date (Date.Date). - The caller has no normal working time on the date — 37588 (HTTP 422). - Full/half-day code and the caller already has an absence on this code on the date — 37954 (HTTP 422).

Format: date-time
Commentstringnull

Conditional. Required when the account feature MandatoryComment is active (300116); optional otherwise. Can be set on create only. > Not yet documented: constraints → max length.

Hoursnumber

Must be > 0 to pass validation, but does NOT set the duration: Minutes is applied after Hours and replaces it. Send the duration in Minutes; send any Hours > 0. Can be set on create only. Unit: hours - Always (Minutes is always applied afterwards, default 0) — Replaced by Minutes / 60 (rounded to 2 decimals). With Minutes omitted the duration becomes 0 and the call fails with 37982 (HTTP 422). - Hours ≤ 0 — 400 'Hours' must be greater than '0'.

Format: double
Minutesinteger

The absence duration in minutes — the value that is actually stored. Can be set on create only. Unit: minutes > Not yet documented: constraints → min.

Format: int32
Typeinteger

Half-day endpoint: 1 = full day, anything else = half day. Full-day endpoint: ignored (always a full day). Can be set on create only. - Half-day endpoint, value other than 1 (including undefined values) — Treated as half day — the enum is not range-checked. - Full-day endpoint — The controller always uses FullDay. Accepted and ignored. Allowed values: | Value | Name | Meaning | |---|---|---| | 0 | HalfDay | Half-day endpoint: register half of the caller's normal working time on the date. Full-day endpoint (FullDay = 0 there): ignored. | | 1 | FullDay | Half-day endpoint: register the caller's full normal working time on the date. |

Options: 0, 1
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).

The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.

Not yet documented: how to obtain a token.

Not yet documented: token lifetime.

Body

application/json
AbsenceIDinteger
Required

The absence code to register on (AbsenceCodeID from GET /v1/absence-code/{status}).

Can be set on create only.

Refers to AbsenceCodeRead.AbsenceCodeID. Look up valid values with GET /v1/absence-code/{status}.

  • Not an existing absence code — 38034 absence-not-found (HTTP 422).

  • Code's salary account is inactive — 37977 (HTTP 422).

  • Code's own TimeTrackingFormat differs from the endpoint called — Not checked — the registration takes the endpoint's format.

Valid values come from GET /v1/absence-code/{status}.

Datestring
Required

The day of the absence. Only the date part is used (time is discarded).

Can be set on create only.

Date only — no time component.

  • Always — Truncated to the date (Date.Date).

  • The caller has no normal working time on the date — 37588 (HTTP 422).

  • Full/half-day code and the caller already has an absence on this code on the date — 37954 (HTTP 422).

Commentstring,null

Conditional. Required when the account feature MandatoryComment is active (300116); optional otherwise.

Can be set on create only.

Not yet documented: constraints → max length.

Hoursnumber

Must be > 0 to pass validation, but does NOT set the duration: Minutes is applied after Hours and replaces it. Send the duration in Minutes; send any Hours > 0.

Can be set on create only.

Unit: hours

  • Always (Minutes is always applied afterwards, default 0) — Replaced by Minutes / 60 (rounded to 2 decimals). With Minutes omitted the duration becomes 0 and the call fails with 37982 (HTTP 422).

  • Hours ≤ 0 — 400 'Hours' must be greater than '0'.

Minutesinteger

The absence duration in minutes — the value that is actually stored.

Can be set on create only.

Unit: minutes

Not yet documented: constraints → min.

Typeinteger

Half-day endpoint: 1 = full day, anything else = half day. Full-day endpoint: ignored (always a full day).

Can be set on create only.

  • Half-day endpoint, value other than 1 (including undefined values) — Treated as half day — the enum is not range-checked.

  • Full-day endpoint — The controller always uses FullDay.

Accepted and ignored.

Allowed values:

ValueNameMeaning
0HalfDayHalf-day endpoint: register half of the caller's normal working time on the date. Full-day endpoint (FullDay = 0 there): ignored.
1FullDayHalf-day endpoint: register the caller's full normal working time on the date.
Allowed values:01

Responses

Success without content: HTTP 200 with the literal JSON body null. Body is the literal JSON null; the registration's ID is not returned.