Account, keys and webhooks ›
Get data retention
GET
/v1/data-retentionHow long your sandboxes' history is kept, and what the last clean-up deleted.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const retention = await agental.getDataRetention();
Answer200 OK · DataRetention
- {
- "keepDays": object,
- "enabled": boolean,
- "choices": integer[],
- "defaultKeepDays": integer,
- "lastCleared": {
- "at": string,
- "commands": integer,
- "conversations": integer,
- "events": integer,
- },
- "retained": [{
- "what": string,
- "kept": string,
- }],
- }
How long the account keeps its sandboxes' history: the output of their commands, their agent conversations, their events and the runs of their schedules, of which each schedule keeps its newest 10 however old.
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 How long the account keeps its sandboxes' history: the output of their commands, their agent conversations, their events and the runs of their schedules, of which each schedule keeps its newest 10 however old. A deleted sandbox's history is deleted with it, whatever is set, its schedules too: its events a day later.
DataRetention6 fields
keepDaysobject
Days the history is kept: 1, 7, 30 or 90.
More
null keeps it until the sandbox is deleted.enabledboolean
Whether history is deleted on a schedule: keepDays is not null.
choicesinteger[]
The periods keepDays may take, in days.
defaultKeepDaysinteger
What an account that has not chosen keeps.
lastClearedobjectnull4 fields
What the last clean-up that deleted anything of the account's deleted.
More
null until one has.atstring
When the clean-up ran, ISO 8601.
commandsinteger
conversationsinteger
eventsinteger
retainedobject[]2 fields
What agental keeps for periods of its own, which the account does not choose.
whatstring
keptstring
Errors and other answers
| 404 | Not found. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.