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
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/absence-code/registration-by-full-day"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"AbsenceID": 123,
"Date": "2024-12-25T10:00:00Z",
"Comment": "null",
"Hours": 3.14,
"Minutes": 42,
"Type": 42
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/absence-code/registration-by-full-day", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"AbsenceID": 123,
"Date": "2024-12-25T10:00:00Z",
"Comment": "null",
"Hours": 3.14,
"Minutes": 42,
"Type": 42
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"AbsenceID": 123,
"Date": "2024-12-25T10:00:00Z",
"Comment": "null",
"Hours": 3.14,
"Minutes": 42,
"Type": 42
}`)
req, err := http.NewRequest("POST", "https://app3.timelog.com/your-account/api/v1/absence-code/registration-by-full-day", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app3.timelog.com/your-account/api/v1/absence-code/registration-by-full-day')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"AbsenceID": 123,
"Date": "2024-12-25T10:00:00Z",
"Comment": "null",
"Hours": 3.14,
"Minutes": 42,
"Type": 42
}'
response = http.request(request)
puts response.body
"null"
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Unprocessable Entity",
"message": "The request was well-formed but contains semantic errors",
"code": 422,
"details": [
{
"field": "password",
"message": "Password must be at least 8 characters long"
}
]
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v1/absence-code/registration-by-full-day
Target server for requests. Edit to use your own host.
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.
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.The media type of the request body
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}.
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).
Conditional. Required when the account feature MandatoryComment is active (300116); optional otherwise. Can be set on create only. > Not yet documented: constraints → max length.
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'.
The absence duration in minutes — the value that is actually stored. Can be set on create only. Unit: minutes > Not yet documented: constraints → min.
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. |
Request Preview
Response
Response will appear here after sending the request
Authentication
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
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}.
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).
Conditional. Required when the account feature MandatoryComment is active (300116); optional otherwise.
Can be set on create only.
Not yet documented: constraints → max length.
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'.
The absence duration in minutes — the value that is actually stored.
Can be set on create only.
Unit: minutes
Not yet documented: constraints → min.
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. |
01Responses
Success without content: HTTP 200 with the literal JSON body null. Body is the literal JSON null; the registration's ID is not returned.