Save my search categories
Saves which global-search categories are switched on for the calling user.
Replaces the caller's MainSearchCategory user default with the sum of the flag values of the entries sent with IsSelected true. Categories not in the body are switched off. Only the caller's own preference changes (user ID from the token). The preference is what GET /v2/search/categories reports; GET /v2/search does not read it.
Use it to:
- Persist the search-box checkboxes.
Behaviour:
- Idempotent.
- Safe to retry.
- Side effect: Raises event UserSettingConfigurationUpdated.
- Changes are visible to the next read immediately.
Call first: GET /v2/search/categories
Not yet documented: examples (success).
curl -X PUT "https://app3.timelog.com/your-account/api/v2/search/categories" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"Categories": [
"null"
],
"Categories[].Name": "John Doe",
"Categories[].IsSelected": true
}'
import requests
import json
url = "https://app3.timelog.com/your-account/api/v2/search/categories"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"Categories": [
"null"
],
"Categories[].Name": "John Doe",
"Categories[].IsSelected": true
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v2/search/categories", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"Categories": [
"null"
],
"Categories[].Name": "John Doe",
"Categories[].IsSelected": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Categories": [
"null"
],
"Categories[].Name": "John Doe",
"Categories[].IsSelected": true
}`)
req, err := http.NewRequest("PUT", "https://app3.timelog.com/your-account/api/v2/search/categories", 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/v2/search/categories')
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 = '{
"Categories": [
"null"
],
"Categories[].Name": "John Doe",
"Categories[].IsSelected": true
}'
response = http.request(request)
puts response.body
"null"
{
"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": "categories: {"Categories":null}",
"Url": "https://app{server-number}.timelog.com/{account}/api/v2/search/categories"
}
/v2/search/categories
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 category entries. Omitted / null → 500 (the loop dereferences it). Duplicates are not rejected and are counted twice.
Category (MainSearchCategory).
Bit flags — values combine.
| Value | Name | Meaning |
|---|---|---|
| 0 | None | No category; adds nothing. |
| 1 | Customer | Customers. |
| 2 | Contact | Contact persons. |
| 4 | Project | Projects. |
| 8 | Invoice | Invoices and vouchers. |
| 16 | Employee | Employees. |
| -1 | All | All categories as a filter value; ADDED (not OR-ed) to the stored sum, so combined with other entries it corrupts the value. |
True to switch the category on. false and omitted are the same (not counted).
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 category entries. Omitted / null → 500 (the loop dereferences it). Duplicates are not rejected and are counted twice.
Category (MainSearchCategory).
Bit flags — values combine.
| Value | Name | Meaning |
|---|---|---|
0 | None | No category; adds nothing. |
1 | Customer | Customers. |
2 | Contact | Contact persons. |
4 | Project | Projects. |
8 | Invoice | Invoices and vouchers. |
16 | Employee | Employees. |
-1 | All | All categories as a filter value; ADDED (not OR-ed) to the stored sum, so combined with other entries it corrupts the value. |
True to switch the category on. false and omitted are the same (not counted).
Responses
Success without content: HTTP 200 with the literal JSON body null. Literal JSON null (TafSuccessResult).