curl --request PATCH \
--url https://api.adapter.com/v1/knowledge/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"temporal_settings": {
"end": {
"days": 365,
"type": "relative"
}
}
}
'import requests
url = "https://api.adapter.com/v1/knowledge/settings"
payload = { "temporal_settings": { "end": {
"days": 365,
"type": "relative"
} } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({temporal_settings: {end: {days: 365, type: 'relative'}}})
};
fetch('https://api.adapter.com/v1/knowledge/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.adapter.com/v1/knowledge/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'temporal_settings' => [
'end' => [
'days' => 365,
'type' => 'relative'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.adapter.com/v1/knowledge/settings"
payload := strings.NewReader("{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.adapter.com/v1/knowledge/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adapter.com/v1/knowledge/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"temporal_settings": {
"start": {
"days": 365,
"type": "relative"
},
"end": {
"days": 365,
"type": "relative"
}
}
}{
"message": "<string>",
"error_code": "bad_request",
"details": {}
}{
"error_code": "authentication_error",
"message": "Invalid or missing credentials.",
"details": {}
}{
"error_code": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error_code": "internal_server_error",
"message": "An unexpected error occurred.",
"details": {}
}{
"error_code": "service_unavailable",
"message": "The service is currently experiencing issues. Please try again later.",
"details": {}
}Update Knowledge Settings
Update your knowledge context settings; sections you don’t send are
unchanged. Changing temporal_settings starts a full rebuild of your
context right away; poll GET /v1/knowledge/status until up_to_date is
true. Other changes take effect on the next context refresh (POST /v1/knowledge/refresh to trigger one immediately).
temporal_settings controls how far back (and ahead) your context goes.
By default it’s one year back and one year ahead. A more recent range
keeps your context smaller, so it uses less memory and refreshes faster; if
you work with historical data, widen it to fit: set start to null for
your full history, or to {"type": "date", "date": "2020-01-01"} to start
from a fixed date. A range can only include data you’ve synced, so to go
further back also raise your connections’ sync range. Data outside the
range stays stored and searchable. Returns the full settings after the
update.
curl --request PATCH \
--url https://api.adapter.com/v1/knowledge/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"temporal_settings": {
"end": {
"days": 365,
"type": "relative"
}
}
}
'import requests
url = "https://api.adapter.com/v1/knowledge/settings"
payload = { "temporal_settings": { "end": {
"days": 365,
"type": "relative"
} } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({temporal_settings: {end: {days: 365, type: 'relative'}}})
};
fetch('https://api.adapter.com/v1/knowledge/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.adapter.com/v1/knowledge/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'temporal_settings' => [
'end' => [
'days' => 365,
'type' => 'relative'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.adapter.com/v1/knowledge/settings"
payload := strings.NewReader("{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.adapter.com/v1/knowledge/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adapter.com/v1/knowledge/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"temporal_settings\": {\n \"end\": {\n \"days\": 365,\n \"type\": \"relative\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"temporal_settings": {
"start": {
"days": 365,
"type": "relative"
},
"end": {
"days": 365,
"type": "relative"
}
}
}{
"message": "<string>",
"error_code": "bad_request",
"details": {}
}{
"error_code": "authentication_error",
"message": "Invalid or missing credentials.",
"details": {}
}{
"error_code": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error_code": "internal_server_error",
"message": "An unexpected error occurred.",
"details": {}
}{
"error_code": "service_unavailable",
"message": "The service is currently experiencing issues. Please try again later.",
"details": {}
}Authorizations
Pass your pk_live_... API key as a Bearer token.
Body
How far back (and ahead) your knowledge context goes. A more recent range keeps your context smaller, so it uses less memory and refreshes faster. If you work with historical data, widen the range to cover the period you need. Data outside the range stays stored and searchable; it just isn't part of the context. Replaces your current range; send both start and end. Omit to leave it unchanged.
Show child attributes
Show child attributes
{
"end": { "days": 365, "type": "relative" }
}
Response
Successful Response
How far back (and ahead) your knowledge context goes. A more recent range keeps your context smaller, so it uses less memory and refreshes faster. If you work with historical data, widen the range to cover the period you need. Data outside the range stays stored and searchable; it just isn't part of the context.
Show child attributes
Show child attributes
Was this page helpful?