Docs
Account, keys and webhooks ›

Get data retention

GET/v1/data-retention

How long your sandboxes' history is kept, and what the last clean-up deleted.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const retention = await agental.getDataRetention();
Answer200 OK · DataRetention
  1. {
  2. "keepDays": object,
  3. "enabled": boolean,
  4. "choices": integer[],
  5. "defaultKeepDays": integer,
  6. "lastCleared": {
  7. "at": string,
  8. "commands": integer,
  9. "conversations": integer,
  10. "events": integer,
  11. },
  12. "retained": [{
  13. "what": string,
  14. "kept": string,
  15. }],
  16. }

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

Authorizationrequired
Bearer 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
keepDays
object
Days the history is kept: 1, 7, 30 or 90.
More null keeps it until the sandbox is deleted.
enabled
boolean
Whether history is deleted on a schedule: keepDays is not null.
choices
integer[]
The periods keepDays may take, in days.
defaultKeepDays
integer
What an account that has not chosen keeps.
lastCleared
objectnull4 fields
What the last clean-up that deleted anything of the account's deleted.
More null until one has.
at
string
When the clean-up ran, ISO 8601.
commands
integer
conversations
integer
events
integer
retained
object[]2 fields
What agental keeps for periods of its own, which the account does not choose.
what
string
kept
string

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.