> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply Policy

> Expire every memory the policy matches now.

## Overview

Runs a sweep: expires every active memory the policy matches. With `dry_run: true` it reports what would expire without changing anything.

## Authentication

**x-api-key** `string` *required*

Your Memanto Cloud API key (`mk_...`). See [Authentication](https://docs.memanto.ai/cloud/api/introduction.md#authentication).

## Path Parameters

**agent\_id** `string` *required*

The agent's ID.

## Body

**dry\_run** `boolean` (default: false)

Report only.

```bash cURL theme={null}
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
  }'
```

```json 200 - OK theme={null}
{
  "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"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.