---
docId: doc_51553fb966734f0d889be62a84eea1cf
title: List versions
description: Lists an agent's version history, newest first, without each version's configuration.
api:
  group: agentes/versiones
  auth: bearer
  operations:
    - operationId: listVersions
      method: GET
      path: '/v1/agents/{agentId}/versions'
      postmanName: List versions
---

<script>
  import { Ways } from '$lib/components';
</script>

# List versions

Find who changed the agent or choose a version to [restore](/api-reference/agents/drafts/restore) or [publish](/api-reference/agents/publications/publish). Versions appear newest first. Each change saved to the draft creates a version that cannot be modified.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/agents/$AGENT_ID/versions?limit=20" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.versions.list("agent_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `limit` | integer | Versions per page, from 1 to 100. Defaults to `20` | - |
| `pageToken` | string | The `nextPageToken` from the previous page | - |

## Response

```json
{
  "status": "success",
  "data": [
    {
      "versionId": "v5",
      "number": 5,
      "basedOnVersionId": "v4",
      "restoredFromVersionId": null,
      "copiedFrom": null,
      "createdAt": "2026-10-28T12:05:00.000Z",
      "createdBy": { "kind": "user", "email": "ana@acme.com" },
      "source": "mcp",
      "via": null,
      "note": "Shorter answers"
    }
  ],
  "nextPageToken": "eyJuIjo0fQ"
}
```

## Response fields

| Field | Description |
|-------|-------------|
| `data` | The versions on this page, without their configuration |
| `data[].versionId` | Version id, for example `v5` |
| `data[].number` | Version number |
| `data[].basedOnVersionId` | Version it was saved on top of. `null` if there isn't one |
| `data[].restoredFromVersionId` | If the version is a [restore](/api-reference/agents/drafts/restore), the version it copied. Otherwise `null` |
| `data[].copiedFrom` | If the version comes from [copying an agent](/api-reference/agents/copy), the source `agentId` and `versionId`. Otherwise `null` |
| `data[].createdAt` | Creation date in ISO 8601 format |
| `data[].createdBy` | Who made it. See the table below |
| `data[].source` | How it was created: `app` (the Platica app), `api`, `mcp` (an MCP client) or `assistant` (Platica's assistant) |
| `data[].via` | If a Platica agent made it, that agent's `agentId` and the `conversationId` of the conversation. Otherwise `null` |
| `data[].note` | Version note. Empty if none was sent |
| `nextPageToken` | Token for the next page. `null` when there are no more |

Shapes of `createdBy`:

| `kind` | Fields | Who |
|--------|--------|-----|
| `user` | `email` | A person, from the app or from an app connected with OAuth. `email` is `null` when it isn't known |
| `api_key` | `keyId` | An API key |
| `agent` | `agentId` | A Platica agent |

To see which sections a version changed, compare it with the previous one in [Compare versions](/api-reference/agents/versions/compare).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `limit` isn't an integer from 1 to 100 |
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |

## Notes

- To read the next page, repeat the request with `pageToken` set to the `nextPageToken` you received.
- The list does not include each version’s configuration. To read it, use [Get a version](/api-reference/agents/versions/get); to see what changed between two, [Compare versions](/api-reference/agents/versions/compare).
