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

# GET /v1/agents/{id}/routes/{routeId}/versions

> The version history of a route.

The versions of a route, newest first, each with the content it held. One is written on every save that changes the content.

## Endpoint

```
GET https://api.keebai.com/v1/agents/{id}/routes/{routeId}/versions
```

## Required scope

`agents:read`

## Path parameters

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | `ObjectId` of the agent. |
| `routeId` | `string` | `ObjectId` of the route. |

## Example request

```bash curl theme={"system"}
curl -X GET https://api.keebai.com/v1/agents/6650a1b2c3d4e5f6a7b8c9d0/routes/6652c0ffee11223344556688/versions \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

```json theme={"system"}
{
  "data": [
    {
      "version": 2,
      "title": "Book an appointment",
      "applies_when": "The customer asks for an appointment for a service.",
      "not_applies_when": "They only ask for the price, without wanting to book.",
      "steps": [
        {
          "instruction": "Ask which service and which day.",
          "actions": [],
          "steps": []
        },
        {
          "instruction": "Offer the available times.",
          "actions": [
            {
              "kind": "native",
              "target": "search_availability"
            }
          ],
          "steps": [
            {
              "instruction": "If none fits, offer the next day with availability.",
              "actions": [],
              "steps": []
            }
          ]
        }
      ],
      "cases": [
        {
          "condition": "There is no availability this week",
          "action": "Offer the waiting list.",
          "actions": [
            {
              "kind": "native",
              "target": "join_waitlist"
            }
          ]
        }
      ],
      "created_by": "ops@example.com",
      "restored_from": null,
      "created_at": "2026-11-11T15:20:03.000000"
    }
  ],
  "total": 1
}
```

### 400 Bad Request

`routeId` is not an `ObjectId`.

### 404 Not Found

No agent, scenario or route with those ids (`route_not_found`).

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `agents:read` scope.

### 502 Bad Gateway

The agent service is unreachable.

## Operational notes

* **Saving without changing the content does not add a version.**


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