SettingsUpdate a car

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
}'
{
  "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": [
    {}
  ]
}
PUT
/v1/car
PUT
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

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.

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.
Content-Typestring
Required

The media type of the request body

Options: application/json
CarIDinteger

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.

Format: int32
Namestring

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.

Min length: 1 • Max length: 255
LicensePlatestring

New registration plate. Always written. Contains personal data. - Missing, null or blank — 500 Code 102, ErrorCode 60109.

Min length: 1 • Max length: 255
IsDefaultboolean

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

header
Authorizationstring
Required

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

application/json
CarIDinteger

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 &#123;}).

  • 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.

Namestring

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.
LicensePlatestring

New registration plate. Always written.

Contains personal data.

  • Missing, null or blank — 500 Code 102, ErrorCode 60109.
IsDefaultboolean

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

Propertiesobject

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.

Linksarray
Actionsobject[]