# List an experiment's versions

Every saved version of the experiment's setup, newest first. A commit, an agent write and a restore each add a numbered version. Ordinary typing rewrites one autosave row, which is the entry with `autoSaved` true. Page through them with `limit` and `cursor`.

> Page: https://langwatch.ai/docs/api-reference/experiments/list-an-experiment-s-versions
> Source: https://github.com/langwatch/langwatch/blob/main/docs/api-reference/experiments/list-an-experiment-s-versions.mdx
> Index of all pages: https://langwatch.ai/docs/llms.txt

## Endpoint

`GET https://app.langwatch.ai/api/v1/experiments/{slug}/versions`

## Authentication

### project_api_key

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

```json
{"id":"project_api_key","type":"apiKey","in":"header","name":"X-Auth-Token"}
```

## Parameters

### slug (path, required)

The experiment's slug, or its id

```json
{"type":"string","minLength":1}
```

### limit (query, optional)

Versions per page, capped at 100

```json
{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}
```

### cursor (query, optional)

The `nextCursor` of the previous page

```json
{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}
```

## Request example

```bash
curl --request GET \
  --url 'https://app.langwatch.ai/api/v1/experiments/<slug>/versions' \
  --header "X-Auth-Token: $LANGWATCH_API_KEY"
```

## Responses

### 200

Success

#### application/json

Schema:

```json
{
  "type": "object",
  "properties": {
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Restore this version by this number. Named versions run 1, 2, 3 with no gaps. The autosave row also has a number, but it changes with every save, so read it as a handle and not as a place in the history."
          },
          "counterVersion": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "The setup version this row was written at. It says how recent the row is, and it equals the experiment's current version on the row holding the live setup."
          },
          "autoSaved": {
            "type": "boolean",
            "description": "True for the single autosave row, which every ordinary save rewrites in place"
          },
          "commitMessage": {"type":["string","null"]},
          "authorLabel": {
            "type": "string",
            "description": "Who wrote it: user, langy or api",
            "example": "user"
          },
          "authorId": {
            "description": "User id, when a person wrote it",
            "type": ["string","null"]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 timestamp of the first write"
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601 timestamp of the last write. The autosave row is rewritten in place, so this is what says how old its content is."
          }
        },
        "required": [
          "version",
          "counterVersion",
          "autoSaved",
          "commitMessage",
          "authorLabel",
          "authorId",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "description": "Newest first, by `counterVersion`"
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {"type":"null"}
      ],
      "description": "Pass as `cursor` to read the next page, null on the last one"
    }
  },
  "required": ["versions","nextCursor"],
  "additionalProperties": false
}
```

### 400

The experiment is not an evaluations workbench (experiment_type_mismatch)

### 401

Missing or invalid API key, or the key lacks the permission

### 404

No such experiment in this project

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.
