List absence codes available to the caller
Lists the absence codes the calling user can register absence on, optionally by active status, favourites or a search text.
Returns the absence codes attached (through their salary account) to the caller's salary group, where that salary account is active. status filters on the code's own active flag (-1 all, 0 inactive, 1 active; default all). The result is per caller: two users can get different lists, and the IsFavourite flag is the caller's. Limited-licence users, the Time product and PSA Starter plans get an empty list. Each entity carries hypermedia actions pointing at the create endpoint matching the code's format.
Use it to:
- Populate an absence-code picker in an employee self-service app.
- Map an HR system's leave types to TimeLog AbsenceCodeIDs (call as a user in the relevant salary group).
Not for:
- A account-wide catalogue of every absence code — the list is filtered by the caller's salary group.
Behaviour:
- Idempotent.
- Safe to retry.
- Changes are visible to the next read immediately.
Next: POST /v1/absence-code/registration-by-hours, POST /v1/absence-code/registration-by-half-day, POST /v1/absence-code/registration-by-full-day, POST /v1/absence-code/time-tracker
See also: GET /v1/absence-code/get-recently-registered
Not yet documented: request → path params → status (names); request → query params → searchText (empty).
curl -X GET "https://app3.timelog.com/your-account/api/v1/absence-code/-1?includeFavouriteOnly=false&searchText=example_string&$page=1&$pagesize=10" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/absence-code/-1?includeFavouriteOnly=false&searchText=example_string&$page=1&$pagesize=10"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/absence-code/-1?includeFavouriteOnly=false&searchText=example_string&$page=1&$pagesize=10", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://app3.timelog.com/your-account/api/v1/absence-code/-1?includeFavouriteOnly=false&searchText=example_string&$page=1&$pagesize=10", nil)
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/-1?includeFavouriteOnly=false&searchText=example_string&$page=1&$pagesize=10')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"Properties": {
"TotalRecord": "10",
"TotalPage": "1",
"PageNumber": "1"
},
"Entities": [
{
"Properties": {
"AbsenceCodeID": 2,
"AbsenceCode": "30",
"Name": "Illnes",
"Description": "Registration of ilnes",
"IsActive": true,
"FlexPositiveFactor": 1,
"SalaryAccountFactor": 1,
"SalaryAccountFactorEffect": 1,
"SalaryAccountID": 2,
"AbsenceCodeTypeID": 1,
"DeductCapacity": false,
"TimeTrackingFormat": 0,
"RequireApproval": false,
"IsPublicVisible": false,
"IsFavourite": true,
"ID": "84982c1c-634a-425c-abf3-82c465a610a2"
},
"Actions": [
{
"Name": "add-registration",
"Title": "Add Registration",
"Method": "Post",
"Href": "https://app{server-number}.timelog.com/{account}/api/v1/absence-code/registration-by-hours",
"Type": "application/json",
"Fields": [
{
"Name": "Hours",
"Type": "Number"
},
{
"Name": "Minutes",
"Type": "Number"
},
{
"Name": "AbsenceID",
"Type": "Number"
},
{
"Name": "Date",
"Type": "DateTime"
},
{
"Name": "Comment",
"Type": "Text"
}
]
},
{
"Name": "time-tracker",
"Title": "Create Time Tracker",
"Method": "Post",
"Href": "https://app{server-number}.timelog.com/{account}/api/v1/absence-code/time-tracker",
"Type": "application/json",
"Fields": [
{
"Name": "AbsenceCodeID",
"Type": "Number",
"Value": "2"
},
{
"Name": "Comment",
"Type": "Text"
},
{
"Name": "Minute",
"Type": "Number"
},
{
"Name": "TimeRegistrationID",
"Type": "Number"
}
]
}
]
},
"… 9 more"
],
"Links": [
{
"Href": "https://app{server-number}.timelog.com/{account}/api/v1/absence-code/1",
"Rel": "self"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v1/absence-code/{status}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.Any other integer is treated as Active (non-zero → true).
Filters on AbsenceCodeRead.IsActive (eq).
Allowed values:
| Value | Name | Meaning |
|---|---|---|
| -1 | All | Active and inactive codes (no filter). |
| 0 | Inactive | Only inactive codes. |
| 1 | Active | Only active codes. |
true → only the caller's favourite codes.
Filters on AbsenceCodeRead.IsFavourite (eq).
Substring match on Name OR AbsenceCode.
Filters on AbsenceCodeRead.Name (contains).
Page number.
Page size. No maximum enforced in the API layer.
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.
Path Parameters
Any other integer is treated as Active (non-zero → true).
Filters on AbsenceCodeRead.IsActive (eq).
Allowed values:
| Value | Name | Meaning |
|---|---|---|
-1 | All | Active and inactive codes (no filter). |
0 | Inactive | Only inactive codes. |
1 | Active | Only active codes. |
-101Query Parameters
true → only the caller's favourite codes.
Filters on AbsenceCodeRead.IsFavourite (eq).
Substring match on Name OR AbsenceCode.
Filters on AbsenceCodeRead.Name (contains).
Page number.
Page size. No maximum enforced in the API layer.
Responses
Paging values. They are returned as STRINGS, for example "TotalRecord": "12".
Omitted (not []) when the list is empty.