https://app.evoriqa.com/api/v1/workspace/retentionSet the data-retention window
Sets how long the workspace keeps its data before the retention job purges anything older. The window covers conversations (and their messages and attachments), captured leads, contacts, agent action runs, bell-feed notifications, API request logs, and webhook delivery attempts. A shorter window purges sooner; independently of it, API request logs and webhook delivery attempts also have a platform-wide 90-day ceiling, so those two are removed at 90 days even when the window is longer or set to keep forever (null). Mirrors the dashboard setting, audited identically. Bad values are 422.
Requires scope workspace:write
Access is gated — enable it before your first call
The API is off by default. A request succeeds only when all three switches are on: the platform master switch (off by default), your organisation’s API toggle, and your plan or client entitlement. Any one off returns 403 API access is not enabled for this workspace.
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
| retentionDays | integer 1–3650, or null | Required | Days to keep data; null keeps forever. |
Request
curl -X PATCH "https://app.evoriqa.com/api/v1/workspace/retention" \
-H "x-api-key: $EVORIQA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "retentionDays": 365 }'const res = await fetch("https://app.evoriqa.com/api/v1/workspace/retention", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.EVORIQA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"retentionDays": 365
}),
});
const responseBody = await res.json();import os
import requests
res = requests.patch(
"https://app.evoriqa.com/api/v1/workspace/retention",
headers={"Authorization": f"Bearer {os.environ['EVORIQA_API_KEY']}"},
json={
"retentionDays": 365
},
)
body = res.json()Response
{
"success": true,
"data": {
"retentionDays": 365
}
}