Update retention policy
curl --request PUT \
--url https://api.truthlocks.com/v1/audit/retention \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"retention_days": 123
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({retention_days: 123})
};
fetch('https://api.truthlocks.com/v1/audit/retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/audit/retention"
payload = { "retention_days": 123 }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/audit/retention"
payload := strings.NewReader("{\n \"retention_days\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"retention_days": 123,
"hard_delete": true,
"updated_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Audit & Logs
Update retention policy
Update the audit log retention policy for the authenticated tenant.
PUT
/
v1
/
audit
/
retention
Update retention policy
curl --request PUT \
--url https://api.truthlocks.com/v1/audit/retention \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"retention_days": 123
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({retention_days: 123})
};
fetch('https://api.truthlocks.com/v1/audit/retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/audit/retention"
payload = { "retention_days": 123 }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/audit/retention"
payload := strings.NewReader("{\n \"retention_days\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"retention_days": 123,
"hard_delete": true,
"updated_at": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Updates the retention policy that controls how long audit logs are kept and what happens when they expire. Requires the
tenant.audit.retention.manage permission.
Responses
Authorizations
API key for machine-to-machine authentication
Body
application/json

