client.retention
client.retention — the retention operations.
On AsyncKindgi every method is the same, awaited.
client.retention.scheduled()
Section titled “client.retention.scheduled()”scheduled( *, domain: Literal['org', 'agent', 'flow', 'tool', 'eval_suite', 'guardrail', 'mcp_endpoint', 'env', 'secret', 'run', 'artifact', 'policy', 'judgment', 'judge_class', 'provider', 'memory', 'conversation', 'api_key', 'service_account', '*'] | None = None, past_grace_only: bool | None = None, limit: int | None = None, cursor: str | None = None, timeout: float | None = None,) -> RetentionScheduledPageList deleted rows scheduled for purging. GET /v1/retention/scheduled
Tombstoned rows in every domain a retention policy or this server's retention limit covers, with when each is purged (purgeAt) and what decides it: the policy (policyId), or the limit (limitApplied) when no policy covers the domain or its policy keeps rows longer. domainsMissingAdapter names the covered domains this deployment can't purge; unpolicedDomains the ones neither covers, whose tombstones are kept; conflicts the domains two policies cover (stored before one policy per domain was enforced). limit caps the rows per domain; hasMore says some domain has more than it returned, and nextCursor (when the runtime can continue) is the cursor for the next page. Requires admin on the tenant.
client.retention.sweep()
Section titled “client.retention.sweep()”sweep( body: RetentionSweepBody | Mapping[str, Any] | None = None, /, *, timeout: float | None = None, **fields: Any,) -> RetentionSweepResultPurge the deleted rows past their grace. POST /v1/retention/sweep
Purges, for good, every tombstoned row past its grace (or only domain's): the grace of the retention policy that covers its domain, or this server's limit for the domain when no policy covers it or the policy keeps rows longer (limitApplied), up to maxPerDomain per domain; remaining counts what is left for the next call. Nothing sweeps on its own: call this (or POST /v1/retention/sweep/{domain}) from a schedule. A hold (graceSeconds: -1) keeps its domain's rows, unless the domain has a limit. Idempotent: a second call purges nothing new. Requires admin on the tenant.
client.retention.sweep_domain()
Section titled “client.retention.sweep_domain()”sweep_domain( domain: Literal['org', 'agent', 'flow', 'tool', 'eval_suite', 'guardrail', 'mcp_endpoint', 'env', 'secret', 'run', 'artifact', 'policy', 'judgment', 'judge_class', 'provider', 'memory', 'conversation', 'api_key', 'service_account', '*'], body: RetentionSweepDomainBody | Mapping[str, Any] | None = None, /, *, timeout: float | None = None, **fields: Any,) -> RetentionSweepResultPurge one domain's deleted rows past their grace. POST /v1/retention/sweep/{domain}
As POST /v1/retention/sweep, for one domain. Requires admin on the tenant.