> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# List agent versions

GET https://api.synthflow.ai/v2/assistants/{model_id}/versions

Lists the published versions of an agent, newest first. The first page (`offset` 0) always includes the active version on top of `limit`, so it can return up to `limit` + 1 versions. Later pages skip the active version, so increase `offset` by `limit` to read the next page.

Reference: https://docs.synthflow.ai/api-reference/platform-api/agents/list-agent-versions

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.synthflow.ai/v2` (Global, default)
- `https://api.us.synthflow.ai/v2` (United States)
- `https://api.eu.synthflow.ai/v2` (European Union)

## Request

### Path parameters

- `model_id` (string, required) — Agent ID. You can find it on the agent’s page in your dashboard.

### Query parameters

- `limit` (integer, optional, default: 20) — Versions returned per page, not counting the active version on the first page. Between 1 and 100.
- `offset` (integer, optional, default: 0) — Number of versions to skip, not counting the active version.

## Response

### 200

200

- `status` (string, optional) — Whether the request was successful.
- `response` (AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaResponse, optional)

## Errors

### 400 Bad Request Error

`limit` or `offset` is out of range.

- `detail` (AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaDetail, optional)

### 404 Not Found Error

404

- `detail` (AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaDetail, optional)

## Types

### AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaResponse

- `pagination` (pagination, optional) — `total_records` counts every published version, including the active one.
- `versions` (list of AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaResponseVersionsItems, optional)

### AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaDetail

- `status` (string, required)
- `description` (string, required)
- `request_id` (string, required)
- `category` (string, required)

### pagination

- `total_records` (integer, optional)
- `limit` (integer, optional)
- `offset` (integer, optional)

### AssistantsModelIdVersionsGetResponsesContentApplicationJsonSchemaResponseVersionsItems

- `version_id` (string, optional) — The ID of the version.
- `version_number` (integer, optional) — Sequential version number, starting at 1.
- `created_at` (datetime, optional) — When the version was published.
- `created_by` (string, optional) — Email of the user who published the version, or `system` for the version created with the agent.
- `is_active` (boolean, optional) — Whether new calls use this version.
- `description` (string, optional) — The version description entered when it was published.

## Examples

**Response**

```json
{
  "status": "ok",
  "response": {
    "pagination": {
      "total_records": 3,
      "limit": 20,
      "offset": 0
    },
    "versions": [
      {
        "version_id": "e484b989-14e9-49a9-a019-78df8443620c",
        "version_number": 3,
        "created_at": "2024-01-15T09:30:00Z",
        "created_by": "jane@example.com",
        "is_active": true,
        "description": "Switch to a faster voice"
      },
      {
        "version_id": "bcb40d4c-4cc1-44b4-9d7b-5d9ab752f5c2",
        "version_number": 2,
        "created_at": "2024-01-15T09:30:00Z",
        "created_by": "jane@example.com",
        "is_active": false,
        "description": "Update greeting"
      },
      {
        "version_id": "4ad61e5e-2f79-496a-b234-889d010fabc7",
        "version_number": 1,
        "created_at": "2024-01-15T09:30:00Z",
        "created_by": "system",
        "is_active": false,
        "description": "Initial version"
      }
    ]
  }
}
```

**SDK Code**

```python list-agent-versions_example
import requests

url = "https://api.synthflow.ai/v2/assistants/model_id/versions"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go list-agent-versions_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/assistants/model_id/versions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby list-agent-versions_example
require 'uri'
require 'net/http'

url = URI("https://api.synthflow.ai/v2/assistants/model_id/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java list-agent-versions_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.synthflow.ai/v2/assistants/model_id/versions")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp list-agent-versions_example
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/assistants/model_id/versions");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift list-agent-versions_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/assistants/model_id/versions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```