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

# Archive A/B test

> Archive an A/B test.

Every version is kept. Saving a next version with [Set A/B test](https://docs.weflayr.com/api/management/set-ab-test.md) restores it.

> [!WARNING]
>
> Changes live routing: the AI gateway refuses the calls that send an archived A/B test's `strategy/<slug>` as their model.

## Parameters

Passed in the request body.

**slug** `string` *required*

The slug of the A/B test to archive.

The response also carries `blockers` (what prevents the usual next step), in plain words. It is empty when the usual workflow applies.

```python Python theme={null}
import weflayr
from weflayr.openapi.models import ArchiveAbTestInput

client = weflayr.client()  # reads WEFLAYR_API_KEY

client.archive_ab_test(body=ArchiveAbTestInput.from_dict({
    "slug": "summarize-profile-ab-test",
}))
```

```js Node.js theme={null}
const weflayr = require('weflayr');

const client = weflayr.client(); // reads WEFLAYR_API_KEY

await weflayr.api.archiveAbTest({
  client,
  throwOnError: true,
  body: {
    slug: 'summarize-profile-ab-test',
  },
});
```

```bash cURL theme={null}
curl -X POST https://app.weflayr.com/api/ab-test-archive/ \
  -H "Authorization: Bearer $WEFLAYR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "summarize-profile-ab-test"
  }'
```

```json 200 theme={null}
{
  "slug": "summarize-profile-ab-test",
  "version": 1,
  "document": {
    "name": "Summarize profile A/B test",
    "slug": "summarize-profile-ab-test",
    "variants": {
      "variant_a": {
        "traffic_pct": 80,
        "target": {
          "model": "claude-sonnet-5-5",
          "provider": "anthropic",
          "region": "GLOBAL",
          "type": "model"
        }
      },
      "variant_b": {
        "traffic_pct": 20,
        "target": {
          "type": "strategy",
          "strategy_slug": "summarize-profile-router",
          "version": null
        }
      }
    },
    "customer_exclusion": {
      "excluded_customers": [
        "Meridian Health"
      ],
      "target": {
        "model": "claude-sonnet-5-5",
        "provider": "anthropic",
        "region": "GLOBAL",
        "type": "model"
      }
    }
  },
  "archived_at": "2026-10-27T08:00:00+00:00",
  "updated_at": "2026-10-24T10:00:00+00:00",
  "url": "https://app.weflayr.com/dashboard/ab-tests/?test=summarize-profile-ab-test",
  "blockers": [
    "The A/B test is archived: the AI gateway refuses calls that send 'strategy/summarize-profile-ab-test'."
  ]
}
```

```json 401 theme={null}
{"error": "Invalid or missing API key. Send it as \"Authorization: Bearer <your key>\"."}
```

```json 404 theme={null}
{"error": "No A/B test has the slug 'nope'. List the project's A/B tests, archived ones included, with get_ab_tests (status=all)."}
```

```json 422 theme={null}
{"error": "Invalid request payload.", "detail": [{"field": "slug", "error": "Field required"}]}
```


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