curl -X POST "http://localhost:8000/api/v2/agents/my-agent/policy/preset" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{"name": "balanced"}'
{
"agent_id": "my-agent",
"preset": "balanced",
"policy": {
"version": 1,
"retention": { "context": "7d", "event": "30d", "error": "30d" },
"rules": [
{ "name": "pinned", "match": { "tags": ["pinned"] }, "expire_after": "never" }
],
"purge_expired_after": "never"
}
}
{
"detail": "Unknown preset 'nope'. Must be one of: aggressive, balanced, conservative."
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
Expiry Policy
Apply Policy Preset
Adopt a predefined policy bundle as the agent’s policy.
POST
/
api
/
v2
/
agents
/
{agent_id}
/
policy
/
preset
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/policy/preset" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{"name": "balanced"}'
{
"agent_id": "my-agent",
"preset": "balanced",
"policy": {
"version": 1,
"retention": { "context": "7d", "event": "30d", "error": "30d" },
"rules": [
{ "name": "pinned", "match": { "tags": ["pinned"] }, "expire_after": "never" }
],
"purge_expired_after": "never"
}
}
{
"detail": "Unknown preset 'nope'. Must be one of: aggressive, balanced, conservative."
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
Overview
Adopts a shipped preset as the agent’s expiry policy, replacing whatever was there. Nothing expires until a sweep runs.This replaces the entire policy, including any rules written by hand. Preview
the preset first with
Get Policy Preset.
Authentication
API clients do not send an API key orAuthorization header.
string
required
Session token from Activate Agent. Must match
agent_id.string
required
Must be
application/jsonPath Parameters
string
required
The unique identifier of the agent.
Body
string
required
Preset name:
conservative, balanced, or aggressive.curl -X POST "http://localhost:8000/api/v2/agents/my-agent/policy/preset" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{"name": "balanced"}'
{
"agent_id": "my-agent",
"preset": "balanced",
"policy": {
"version": 1,
"retention": { "context": "7d", "event": "30d", "error": "30d" },
"rules": [
{ "name": "pinned", "match": { "tags": ["pinned"] }, "expire_after": "never" }
],
"purge_expired_after": "never"
}
}
{
"detail": "Unknown preset 'nope'. Must be one of: aggressive, balanced, conservative."
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
Next Steps
- Apply Expiry Policy to run the sweep
- Get Expiry Policy to read it back