---
title: "Get retention policy runs"
method: POST
path: "/retention_policy/runs"
tags: ["product:chat"]
---

# Get retention policy runs

`POST /retention_policy/runs`

Returns filtered and sorted retention cleanup run history for the app. Supports filter_conditions on 'policy' (possible values: 'old-messages', 'inactive-channels') and 'date' fields. Server-side only.

## Request body

- GetRetentionPolicyRunsRequest, nullable
  - `filter_conditions` object — Filter conditions to apply to the query
  - `limit` integer
  - `next` string
  - `prev` string
  - `sort` SortParamRequest[] — Array of sort parameters
    - `direction` integer — Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One of: -1, 1
    - `field` string — Name of field to sort by
    - `type` string — Type of field to sort by. Empty string or omitted means string type (default). One of: number, boolean

## Response `201`

Response

- GetRetentionPolicyRunsResponse, nullable — Basic response information
  - `duration` string, required — Duration of the request in milliseconds
  - `next` string
  - `prev` string
  - `runs` RetentionRunResponse[], required
    - `app_pk` integer, required
    - `date` string, required
    - `policy` string, required
    - `stats` RunStats, required
      - `channels_deleted` integer
      - `messages_deleted` integer

## Other responses

- `400` — Bad request
- `429` — Too many requests

---

[API](https://skmtc.net/getstream/apis/stream-api.md) · [All operations](https://skmtc.net/getstream/apis/stream-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getstream/stream-api/versions/3dba86aaa0d8/schema)
