---
title: "List bandit policies"
method: GET
path: "/api/v2/experiments/bandits/{bandit_id}/policies"
tags: ["Experiments"]
---

# List bandit policies

`GET /api/v2/experiments/bandits/{bandit_id}/policies`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/policies`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_experiments_read`

List the policies a bandit has served, newest first by default, including the policy it serves after it ends. Each policy is the traffic split SDKs served from when it was applied until the next one. Exposures log the policy's ID as `bandit.policy_id`, so the history tells you the split behind each exposure. Exposures logged after the bandit ends have no policy ID. `filter[from]` and `filter[to]` keep the policies in effect during the range, including the one already in effect at `filter[from]`. Bandits must be enabled for the organization.

## Path parameters

- `bandit_id` string, uuid, required: The UUID of the bandit.

## Query parameters

- `filter[from]` string, date-time: Return only the policies in effect at or after this RFC 3339 time (inclusive), including the one already in effect at it.
- `filter[to]` string, date-time: Return only the policies applied before this RFC 3339 time (exclusive).
- `page[offset]` integer: Number of results to skip for pagination. Defaults to 0 when omitted.
- `page[limit]` integer: Maximum number of results to return. Defaults to 25 when omitted, and is capped at 50 (larger values are clamped to 50). The response includes meta.page (with total) and pagination links.
- `sort` string: `applied_at` for oldest first, or `-applied_at` for newest first. Defaults to `-applied_at`.

## Response `200`

OK

- ExperimentsBanditPolicyHistoryV2DTOArray: Response containing a page of a bandit's policy history.
  - `data` ExperimentsBanditPolicyHistoryV2DTOData[], required: Policies on this page.
    - `attributes` ExperimentsBanditPolicyHistoryV2DTODataAttributes, required: A traffic split the bandit served, with the same fields as `active_policy`.
      - `applied_at` string, date-time, required: When the policy was saved. SDKs pick it up on their next configuration fetch.
      - `config_version` integer, required: The configuration version the policy was made for.
      - `is_active` boolean, required: Whether this is the policy the bandit serves now, the one Get bandit returns as `active_policy`. A paused bandit keeps serving it, and an ended bandit serves its fallback.
      - `kind` 'WARMUP' | 'ADAPTIVE' | 'FALLBACK', required: `WARMUP` serves the arms equally. `ADAPTIVE` serves the initial split or a split from a refresh. `FALLBACK` serves one variant after the bandit ends.
      - `policy_number` integer, required: The policy's place in the bandit's policy history. It follows `applied_at` and orders policies saved at the same time.
      - `reason` 'ACTIVATION' | 'REFRESH' | 'ARM_CHANGE' | 'SCHEDULED_END' | 'STOP', required: Why the policy was applied.
      - `refresh_id` string, uuid, nullable, required: The refresh that proposed the policy. `null` for policies no refresh proposed, such as the first split and the policy served after the bandit ends.
      - `variants` ExperimentsBanditPolicyVariantV2[], required: Each variant's share of traffic. The probabilities add up to 1. A variant served as an arm keeps the key the arm had, even if the arm was removed later.
        - `feature_flag_variant_id` string, uuid, required: The variant's ID on the flag.
        - `probability` number, double, required: The share of traffic the variant gets, from 0 to 1.
        - `variant_key` string, nullable, required: The variant's key. `null` when it can't be resolved.
    - `id` string, uuid, required: The policy ID. Each exposure logs it as `bandit.policy_id`, except exposures logged after the bandit ends.
    - `type` 'bandit-policies', required: Bandit policy resource type.
  - `links` ExperimentsOffsetLinks, required: Links for navigating a paginated result set.
    - `first` string: URL of the first page of results.
    - `last` string: URL of the last page of results.
    - `next` string: URL of the next page of results.
    - `prev` string: URL of the previous page of results.
    - `self` string: URL of the current page of results.
  - `meta` ExperimentsOffsetMeta, required: Pagination information for a list response.
    - `page` ExperimentsOffsetMetaPage: Result counts and offsets for a page of results.
      - `first_offset` integer: Offset of the first page of results.
      - `last_offset` integer, nullable: Offset of the last page of results.
      - `limit` integer: Maximum number of results returned in one page.
      - `next_offset` integer, nullable: Offset of the next page of results.
      - `offset` integer: Number of results skipped before this page.
      - `prev_offset` integer, nullable: Offset of the previous page of results.
      - `total` integer, nullable: Total number of matching results across all pages.
      - `type` string: Pagination method used for this result set.

## Other responses

- `400`: Malformed bandit ID (not a valid UUID), a sort other than `applied_at` or `-applied_at`, a malformed page parameter, `filter[from]` or `filter[to]` isn't an RFC 3339 time, or `filter[from]` isn't before `filter[to]`.
- `401`: Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).
- `403`: Bandits are not enabled for the organization, or the caller lacks the product_analytics_experiments_read permission.
- `404`: No bandit with this ID exists for the organization.
- `429`: Too many requests

## Changes

- **2026-11-20** `3b1c63e31740`: 4 warning
  - the optional response header `X-RateLimit-Limit` removed for the status `429`
  - the optional response header `X-RateLimit-Period` removed for the status `429`
  - the optional response header `X-RateLimit-Remaining` removed for the status `429`
  - the optional response header `X-RateLimit-Reset` removed for the status `429`
- **2026-11-19** `8623cd014a4f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/changes/api/v2/experiments/bandits/:bandit_id/policies/get.md)

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/4ba32926196d?raw)
