Update a car
Renames a car, changes its plate and sets or clears it as the caller's default car; returns the car.
Ordinary users can update only their OWN private cars. Users with access to the car administration page can update any car of the account (other employees' private cars and company cars). Name and LicensePlate are always overwritten, so send both. Owner, type, active state and mileage rate are not changeable here. IsDefault acts on the CALLER's default-car setting, even when the car belongs to someone else.
Use it to:
- Employee corrects the plate of their car
- Make a car the caller's default for mileage registrations
Behaviour:
- Idempotent.
- Safe to retry.
- Side effect: Updates Name and LicensePlate (always written, even when unchanged) and raises CarUpdated.
- Side effect: IsDefault true → the caller's default car becomes this car; false (or omitted) → clears the caller's default if it was this car.
- Changes are visible to the next read immediately.
Call first: GET /v1/car
See also: GET /v1/car/default
Not yet documented: examples.
curl -X PUT "https://app3.timelog.com/your-account/api/v1/car" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"CarID": 123,
"Name": "John Doe",
"LicensePlate": "example_string",
"IsDefault": true
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v1/car"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"CarID": 123,
"Name": "John Doe",
"LicensePlate": "example_string",
"IsDefault": true
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v1/car", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"CarID": 123,
"Name": "John Doe",
"LicensePlate": "example_string",
"IsDefault": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"CarID": 123,
"Name": "John Doe",
"LicensePlate": "example_string",
"IsDefault": true
}`)
req, err := http.NewRequest("PUT", "https://app3.timelog.com/your-account/api/v1/car", 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/car')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"CarID": 123,
"Name": "John Doe",
"LicensePlate": "example_string",
"IsDefault": true
}'
response = http.request(request)
puts response.body
{
"Properties": {
"CarID": 123,
"ID": "123e4567-e89b-12d3-a456-426614174000",
"Name": "John Doe",
"LicensePlate": "example_string",
"CarType": 42,
"EmployeeUserID": "null",
"EmployeeUser": {
"UserID": 123,
"ID": "123e4567-e89b-12d3-a456-426614174000",
"FirstName": "John Doe",
"LastName": "John Doe",
"Initials": "example_string",
"IsActive": true,
"UserType": "Employee",
"LegalEntityID": 123,
"Email": "user@example.com"
},
"IsActive": true,
"DefaultMileageRate": {
"ID": "123e4567-e89b-12d3-a456-426614174000",
"MileageRateID": 123,
"Name": "John Doe",
"IsActive": true,
"SalaryCodeTaxFree": "null",
"SalaryCodeTaxable": "null",
"AccountNumber": "null",
"IsDefaultForPrivateCar": true,
"HasReimbursement": true,
"UnitType": 42,
"ReimbursementCurrencyID": 123,
"LegalEntityID": 123
},
"IsDefault": true,
"AllowEmployeeChangeMileageRate": true
},
"Links": [
{
"Href": "example_string",
"Rel": "example_string"
}
],
"Actions": [
{}
]
}
{
"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": "carApiUpdateModel: {"CarID":0,"Name":null,"LicensePlate":null,"IsDefault":false}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v1/car"
}
/v1/car
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 car to change.
Refers to CarRead.CarID. Look up valid values with GET /v1/car.
- Missing, 0 or unknown — 500 Code 100 — the car lookup throws (captured for {}).
- Another employee's private car or a company car, caller without access to the car administration page — 500 Code 102, ErrorCode 37833.
Valid values come from GET /v1/car.
New display name. Always written — omitting it does not keep the old name. - Missing, null or blank — 500 Code 102, ErrorCode 60015 "Name must be set on Car" — not 400, the update validator never runs.
New registration plate. Always written. Contains personal data. - Missing, null or blank — 500 Code 102, ErrorCode 60109.
true = make this car the CALLER's default car; false = if it is the caller's default, clear the caller's default. Applies to the caller's own setting even when an administrator updates another employee's car. - Omitted — false — clears the caller's default car if it was this car.
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 car to change.
Refers to CarRead.CarID. Look up valid values with GET /v1/car.
-
Missing, 0 or unknown — 500 Code 100 — the car lookup throws (captured for {}).
-
Another employee's private car or a company car, caller without access to the car administration page — 500 Code 102, ErrorCode 37833.
Valid values come from GET /v1/car.
New display name. Always written — omitting it does not keep the old name.
- Missing, null or blank — 500 Code 102, ErrorCode 60015 "Name must be set on Car" — not 400, the update validator never runs.
New registration plate. Always written.
Contains personal data.
- Missing, null or blank — 500 Code 102, ErrorCode 60109.
true = make this car the CALLER's default car; false = if it is the caller's default, clear the caller's default. Applies to the caller's own setting even when an administrator updates another employee's car.
- Omitted — false — clears the caller's default car if it was this car.
Responses
A car that mileage registrations are driven in. Two kinds exist (CarType): a COMPANY car (1) has no owner and can be picked by every employee of its legal entity; a PRIVATE car (2) belongs to exactly one employee (EmployeeUserID) and only that employee may register mileage with it. Each car belongs to one legal entity and carries a default mileage rate (the rate preselected on a mileage registration). The registration plate and the owner make a private car personal data.