Runs the data retention purge for the workspace straight away. The same purge runs automatically once a day. For every agent with data_storage_retention_days set, it deletes that agent's calls older than the retention period, together with their recordings. Agents without a retention period keep their calls. It also deletes recording files older than the workspace's recording_retention_days (30 by default); those calls stay, with their recording URLs set to null.
Only finished calls are deleted (status ended, error or not_connected). The retention period is read from the latest version of each agent. This cannot be undone.
Request#
This endpoint takes no path, query or body parameters.
Example request#
curl -X POST https://api.tried.com.au/privacy/run-retention \
-H "Authorization: Bearer $TRIED_API_KEY"const res = await fetch("https://api.tried.com.au/privacy/run-retention", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const result = await res.json();import os, requests
res = requests.post(
"https://api.tried.com.au/privacy/run-retention",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
result = res.json()Response#
200 OK
{
"deleted": 412,
"agents": 2,
"recordings_deleted": 37
}| Field | Type | Description |
|---|---|---|
deleted |
integer | Calls deleted by this run. |
agents |
integer | Agents that have a retention period and had calls older than one day to check. |
recordings_deleted |
integer | Calls whose recordings were deleted for passing the workspace's recording retention. |
Errors#
| Status | When |
|---|---|
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the admin scope. Dashboard members get The member role is read-only. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.