Stop a time tracker (v2)
Stops a running time tracker now and turns the tracked time into a time registration; answers 201 with a link to it.
Ends the tracker at the current server time, exactly like the v1 stop: a tracker that ran past midnight is split per day (start day plus at most the next day), the tracked time is saved as registration(s) — added to the linked registration when the tracker is linked to one — and the tracker is deleted. Unlike v1, the registration is NOT in the body: the response is 201 Created with body null and a Location header to GET /v1/time-registration/{id} of the LAST registration written (the v1 route, by design of the call — there is no v2 registration GET).
Use it to:
- Stop button of a timer UI; follow Location to show the resulting registration.
Not for:
- Discarding a tracker without registering time → DELETE /v1/time-tracker/{id}
Behaviour:
- Not idempotent.
- Not safe to retry blindly. A second call targets the deleted tracker and fails with 500.
- Side effect: Ends the tracker at server time; splits it across days when it ran past midnight (max 1 extra day).
- Side effect: Creates or updates time registration(s) with full registration side effects (work units, invoicing, salary, financials).
- Side effect: Deletes the tracker once converted.
- Side effect: Writes a Serilog information line (purpose MeasureTimeRegistrationServiceProcessingTime) with the tracker owner's user ID and hours.
- On failure: If conversion yields no registration, the ended tracker is saved and the call returns 500.
- Read-after-write consistency: not yet documented.
Call first: GET /v2/time-tracker/active, POST /v1/time-tracker/task/start-time-tracker, POST /v1/time-tracker/absence/start-time-tracker
Next: GET /v1/time-registration/{timeRegistrationID}
See also: POST /v1/time-registration/stop-time-tracker/{timeTrackerId}
Not yet documented: behaviour → consistency; examples (success); response → success.
curl -X POST "https://app3.timelog.com/your-account/api/v2/time-tracker/stop/123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://app3.timelog.com/your-account/api/v2/time-tracker/stop/123"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.post(url, headers=headers)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v2/time-tracker/stop/123", {
method: "POST",
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("POST", "https://app3.timelog.com/your-account/api/v2/time-tracker/stop/123", 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/v2/time-tracker/stop/123')
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'
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"
}
]
}
{
"Code": 100,
"Details": [],
"Message": "Unknown error occur in system, please contact system administrator.",
"Parameters": "timeTrackerId: 1",
"Url": "https://app{server-number}.timelog.com/{account}/api/v2/time-tracker/stop/1"
}
/v2/time-tracker/stop/{timeTrackerId}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.Integer ID of the tracker (TimeTrackerId from GET /v2/time-tracker/active), not a registration ID. No {int} route constraint: a non-integer is a 400 model-state error.
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
Integer ID of the tracker (TimeTrackerId from GET /v2/time-tracker/active), not a registration ID. No {int} route constraint: a non-integer is a 400 model-state error.