curl -X POST "https://api.memanto.ai/agents/my-agent/policy/apply" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true
}'
{
"agent_id": "my-agent",
"dry_run": true,
"policy_is_empty": false,
"scanned": 812,
"already_expired": 40,
"matched": 12,
"expired": 0,
"per_rule": {},
"memories": [],
"errors": [],
"evaluated_at": "2026-11-19T15:04:05.000Z"
}
Expiry Policy
Apply Policy
Expire every memory the policy matches now.
POST
/
agents
/
{agent_id}
/
policy
/
apply
curl -X POST "https://api.memanto.ai/agents/my-agent/policy/apply" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true
}'
{
"agent_id": "my-agent",
"dry_run": true,
"policy_is_empty": false,
"scanned": 812,
"already_expired": 40,
"matched": 12,
"expired": 0,
"per_rule": {},
"memories": [],
"errors": [],
"evaluated_at": "2026-11-19T15:04:05.000Z"
}
Overview
Runs a sweep: expires every active memory the policy matches. Withdry_run: true it reports what would expire without changing anything.
Authentication
Your Memanto Cloud API key (
mk_...). See Authentication.Path Parameters
Body
curl -X POST "https://api.memanto.ai/agents/my-agent/policy/apply" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dry_run": true
}'
{
"agent_id": "my-agent",
"dry_run": true,
"policy_is_empty": false,
"scanned": 812,
"already_expired": 40,
"matched": 12,
"expired": 0,
"per_rule": {},
"memories": [],
"errors": [],
"evaluated_at": "2026-11-19T15:04:05.000Z"
}