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

# List Agent Versions

Use this API to fetch the version history for a custom agent. A new version is created automatically on every [Update Agent Version](https://velt.dev/docs/api-reference/rest-apis/v2/agents/version/update.md) call. Versions are returned newest-first (descending by version number). Each version is a **behavioral** snapshot of the agent at that point in time — identity fields (`name`, `description`, `enabled`, `managedBy`) live on the root agent document and are not part of version snapshots.

Any auth secrets in a version snapshot are redacted (`"__redacted__"`) before the response is returned: both `rest-api` strategy secrets and `mcp-tools` server secrets (`execution.mcpServers[].auth`).

# Endpoint

`POST https://api.velt.dev/v2/agents/versions/list`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**agentId** `string` *required*

Min 1 char. Agent ID.

## **Example Requests**

```JSON theme={null}
{
  "data": {
    "agentId": "abc123def456"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Versions listed successfully",
    "data": {
      "versions": [
        {
          "id": "v3",
          "version": 3,
          "createdAt": 1711900000000,
          "instructions": "Check headings use 'Inter' font. Verify #1A73E8 on all CTAs and links.",
          "contextGathering": {
            "strategies": ["web-page-text", "web-page-screenshot", "web-page-html"]
          },
          "execution": {
            "executionStrategy": "ai",
            "responseDescriptions": { "title": "Short name for the brand inconsistency" }
          },
          "postProcess": {
            "guardrails": { "enabled": true },
            "deletePreviousSuggestions": { "enabled": true }
          }
        },
        {
          "id": "v2",
          "version": 2,
          "createdAt": 1711800000000,
          "instructions": "Check headings use 'Inter' font. Verify #1A73E8 on all CTAs and links.",
          "contextGathering": { "strategies": ["web-page-text", "web-page-screenshot"] },
          "execution": { "executionStrategy": "ai" }
        },
        {
          "id": "v1",
          "version": 1,
          "createdAt": 1711700000000,
          "instructions": "Check headings use Inter font...",
          "contextGathering": { "strategies": ["web-page-text"] }
        }
      ]
    }
  }
}
```

| Field | Type | Description |
| - | - | - |
| `data.versions` | object\[] | Version snapshots, newest first. |
| `versions[].id` | string | Version document ID in the `v{N}` format (e.g. `"v3"`). |
| `versions[].version` | number | Version number. |
| `versions[].createdAt` | number | Epoch ms when the version was created. |

Alongside those three `versions[]` fields, **every behavioral field the agent had at that version** is present on each row: `rawInstructions`, `instructions`, `phaseTimeoutMs`, `contextGathering`, `execution`, `response`, `postProcess`, `input`, `scope`, and `setup`. The example above is abridged. Identity fields (`name`, `description`, `enabled`, `managedBy`) are not versioned and never appear here; read them from [Get Agent](https://velt.dev/docs/api-reference/rest-apis/v2/agents/get.md).

> [!NOTE]
>
> This endpoint returns the agent's **full** version history in one response. There is no pagination and no cap, so an agent with a long edit history returns a correspondingly large payload.

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "NOT_FOUND"
  }
}
```

**Errors:** `INVALID_ARGUMENT` (missing or empty `agentId`) / `NOT_FOUND` (the workspace store database could not be resolved).

> [!NOTE]
>
> An agent that does not exist is **not** an error here. It returns `200` with an empty `versions` array, which is indistinguishable from an agent that exists but has no version history.

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Versions listed successfully",
    "data": {
      "versions": []
    }
  }
}
```


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