---
title: "Refresh bandit"
method: POST
path: "/api/v2/experiments/bandits/{bandit_id}/refresh"
tags: ["Experiments"]
---

# Refresh bandit

`POST /api/v2/experiments/bandits/{bandit_id}/refresh`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/bandits/{bandit_id}/refresh`
- 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_write`

Start a refresh of a running bandit now, instead of waiting for its schedule. The refresh reads the bandit's latest data and saves new results. Outside warmup it also serves the traffic split it proposes, so it can change traffic. HTTP 202 confirms the refresh started, not that it finished. The response returns the refresh ID, which the bandit then reports as `latest_refresh`. Bandits must be enabled for the organization.

## Path parameters

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

## Query parameters

- `full_refresh` boolean: Recompute the bandit's whole history instead of updating its latest refresh; for example, after its exposure or metric data was backfilled. Defaults to `false`.

## Response `202`

Accepted

- ExperimentsBanditRefreshV2DTO: Response acknowledging a refresh that has started.
  - `data` ExperimentsBanditRefreshV2DTOData, required: The refresh that started.
    - `attributes` ExperimentsBanditRefreshV2DTODataAttributes, required: The bandit being refreshed.
      - `bandit_id` string, uuid, required: The ID of the bandit being refreshed.
    - `id` string, uuid, required: The refresh ID. The bandit reports it as `latest_refresh`.
    - `type` 'bandit-refresh', required: Bandit refresh resource type.

## Other responses

- `400`: Malformed bandit ID (not a valid UUID), or `full_refresh` is not a valid boolean.
- `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, the caller lacks the product_analytics_experiments_write permission, or the caller lacks edit access to the bandit's flag or environment.
- `404`: No bandit with this ID exists for the organization.
- `409`: The bandit isn't running, or a refresh of it is already running.
- `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/refresh/post.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)
