Toggle a timesheet favourite
Flips the calling user's "favourite" mark on a task or an absence code in the timesheet — adds it if absent, removes it if present.
If the caller already has a favourite for (GroupType, ReferenceID) on the timesheet page, it is deleted; otherwise one is created. Favourites are per user. The result is visible as IsFavourite on time tracking items. Answers 204 with no body; there is no endpoint to read the current state directly.
Use it to:
- Star / un-star a task in a time-tracking client's task picker
Not for:
- Setting a known state idempotently — read IsFavourite first, then toggle only if needed
Rules across fields:
- R1: ReferenceID must be a TaskID when GroupType = 1 and an AbsenceCodeID when GroupType = 3.
Behaviour:
- Not idempotent.
- Not safe to retry blindly. A retry after a lost response flips the favourite BACK. Re-read IsFavourite before retrying.
- Duplicates: Toggle: a second identical call undoes the first.
- Side effect: Inserts or deletes the caller's favourite row (entity = task 98 / absence code 149, page TimeTrackingBase 361).
- Changes are visible to the next read immediately.
Call first: Task IDs: GET /v1/task/search-for-time-tracking (or list rows' TaskID), Absence codes: AbsenceCodeRead lookups
Next: GET /v1/time-tracking-item/get-by-date
Not yet documented: examples.
curl -X POST "https://app3.timelog.com/your-account/api/v1/time-tracking-item/save-favourite" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"ReferenceID": 123,
"GroupType": 42
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/time-tracking-item/save-favourite"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"ReferenceID": 123,
"GroupType": 42
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/time-tracking-item/save-favourite", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"ReferenceID": 123,
"GroupType": 42
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"ReferenceID": 123,
"GroupType": 42
}`)
req, err := http.NewRequest("POST", "https://app3.timelog.com/your-account/api/v1/time-tracking-item/save-favourite", 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/time-tracking-item/save-favourite')
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 = '{
"ReferenceID": 123,
"GroupType": 42
}'
response = http.request(request)
puts response.body
{}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"Code": 100,
"Details": [],
"Message": "Unknown error occur in system, please contact system administrator.",
"Parameters": "requestModel: {"ReferenceID":0,"GroupType":0}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/time-tracking-item/save-favourite"
}
/v1/time-tracking-item/save-favourite
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 TaskID (GroupType 1 = Project) or the AbsenceCodeID (GroupType 3 = Absence) to toggle as favourite.
Refers to TaskRead | AbsenceCodeRead (see GroupType).
- omitted — Binds as 0, which is no valid task / absence code → 500 Code 100.
- the task / absence code does not exist — "ReferenceId invalid" → 500 Code 100 with the generic message.
> Not yet documented: behaviour.
Says whether ReferenceID is a task or an absence code. Only 1 and 3 are accepted.
- any value other than 1 or 3 (incl. omitted = 0, and the retired 2) — Mapped to DomainType.NotSpecified → "DomainType invalid" → 500 Code 100.
Allowed values:
| Value | Name | Meaning |
|---|---|---|
| 1 | Project | ReferenceID is a TaskID: toggles the task as a timesheet favourite. |
| 3 | Absence | ReferenceID is an AbsenceCodeID: toggles the absence code as a favourite. |
| 4 | ProjectTimeTracker | Exists in the shared enum; rejected here (mapped to 'not specified'). |
| 5 | AbsenceTimeTracker | Exists in the shared enum; rejected here. |
| 6 | TravelTime | Exists in the shared enum; rejected here. |
> Not yet documented: values → serialization.
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 TaskID (GroupType 1 = Project) or the AbsenceCodeID (GroupType 3 = Absence) to toggle as favourite.
Refers to TaskRead | AbsenceCodeRead (see GroupType).
-
omitted — Binds as 0, which is no valid task / absence code → 500 Code 100.
-
the task / absence code does not exist — "ReferenceId invalid" → 500 Code 100 with the generic message.
Not yet documented: behaviour.
Says whether ReferenceID is a task or an absence code. Only 1 and 3 are accepted.
- any value other than 1 or 3 (incl. omitted = 0, and the retired 2) — Mapped to DomainType.NotSpecified → "DomainType invalid" → 500 Code 100.
Allowed values:
| Value | Name | Meaning |
|---|---|---|
1 | Project | ReferenceID is a TaskID: toggles the task as a timesheet favourite. |
3 | Absence | ReferenceID is an AbsenceCodeID: toggles the absence code as a favourite. |
4 | ProjectTimeTracker | Exists in the shared enum; rejected here (mapped to 'not specified'). |
5 | AbsenceTimeTracker | Exists in the shared enum; rejected here. |
6 | TravelTime | Exists in the shared enum; rejected here. |
Not yet documented: values → serialization.
13456