Skip to content

client.retention

client.retention — the retention operations.

On AsyncKindgi every method is the same, awaited.

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,
) -> RetentionScheduledPage

List deleted rows scheduled for purging. GET /v1/retention/scheduled

Tombstoned rows in every domain a retention policy covers, with when each is purged (purgeAt) and the policy that decides it. domainsMissingAdapter names the covered domains this deployment can't purge; unpolicedDomains the ones no policy 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.

sweep(
body: RetentionSweepBody | Mapping[str, Any] | None = None,
/,
*,
timeout: float | None = None,
**fields: Any,
) -> RetentionSweepResult

Purge the deleted rows past their grace. POST /v1/retention/sweep

Purges, for good, every tombstoned row past the grace of the retention policy that covers its domain (or only domain's), 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. Idempotent: a second call purges nothing new. Requires admin on the tenant.

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,
) -> RetentionSweepResult

Purge 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.