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

# Get Agent Version

> Returns the complete snapshot of a specific agent version, including all configuration fields at the time that version was saved. Requires the `agent:version:read` permission.

### **Code Examples**

<CodeGroup>
  ```http cURL theme={null}
  curl --request GET \
    --url 'https://api.tess.im/agents/8794/versions/2' \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```json Node.js theme={null}
  const axios = require('axios');

  const config = {
    method: 'get',
    url: 'https://api.tess.im/agents/8794/versions/2',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  };

  try {
    const response = await axios(config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.tess.im/agents/8794/versions/2"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.tess.im/agents/8794/versions/2",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer YOUR_API_KEY"
    ]
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "Error: " . $err;
  } else {
    echo $response;
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  HttpClient client = HttpClient.newHttpClient();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.tess.im/agents/8794/versions/2"))
      .header("Authorization", "Bearer YOUR_API_KEY")
      .GET()
      .build();

  HttpResponse<String> response = client.send(request,
      HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go theme={null}
  package main

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

  func main() {
      client := &http.Client{}
      req, err := http.NewRequest("GET", "https://api.tess.im/agents/8794/versions/2", nil)
      if err != nil {
          fmt.Println(err)
          return
      }

      req.Header.Add("Authorization", "Bearer YOUR_API_KEY")

      resp, err := client.Do(req)
      if err != nil {
          fmt.Println(err)
          return
      }
      defer resp.Body.Close()

      body, err := ioutil.ReadAll(resp.Body)
      if err != nil {
          fmt.Println(err)
          return
      }

      fmt.Println(string(body))
  }
  ```

  ```jsonnet .NET theme={null}
  using System;
  using System.Net.Http;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          using (var client = new HttpClient())
          {
              client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");

              try
              {
                  var response = await client.GetAsync("https://api.tess.im/agents/8794/versions/2");
                  response.EnsureSuccessStatusCode();
                  string responseBody = await response.Content.ReadAsStringAsync();
                  Console.WriteLine(responseBody);
              }
              catch(HttpRequestException e)
              {
                  Console.WriteLine("\nException Caught!");
                  Console.WriteLine("Message :{0} ", e.Message);
              }
          }
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'json'

  uri = URI('https://api.tess.im/agents/8794/versions/2')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Get.new(uri)
  request['Authorization'] = 'Bearer YOUR_API_KEY'

  response = http.request(request)
  puts response.read_body
  ```
</CodeGroup>

### **Headers**

<ParamField header="x-workspace-id" type="integer">
  ID of the workspace. If not provided, the user's selected workspace will be used.
</ParamField>

<Note>
  **Note:** This field will be required in a future release of the API. It is highly recommended to set it now to ensure compatibility with future updates.
</Note>

### **Path Parameters**

<ParamField path="id" type="integer" required>
  The agent ID
</ParamField>

<ParamField path="version_id" type="integer" required>
  The version ID to retrieve
</ParamField>

### **Response**

```json theme={null}
{
  "version": {
    "version_id": 7,
    "published_at": "2026-04-06T13:52:19+00:00",
    "published_by": "user@example.com",
    "rollback_from_version": 2,
    "snapshot": {
      "agent_name": "Customer Support Agent",
      "instructions": "You are a helpful customer support assistant.",
      "ask_user_questions": [
        {
          "name": "topic",
          "type": "text",
          "description": "What topic do you need help with?",
          "required": true,
          "tooltip": ""
        }
      ],
      "steps": [],
      "knowledge_base_files": [],
      "type": "chat",
      "subtype": "All LLM Models",
      "advanced_settings": {
        "model": "auto",
        "temperature": "1"
      },
      "visibility": "private"
    }
  }
}
```

### **Response Fields**

| **Field**                               | **Type**         | **Description**                                                             |
| :-------------------------------------- | :--------------- | :-------------------------------------------------------------------------- |
| version.version\_id                     | integer          | Unique sequential identifier for this version                               |
| version.published\_by                   | string           | Email of the user who saved this version                                    |
| version.published\_at                   | string (ISO8601) | Timestamp when this version was created                                     |
| version.rollback\_from\_version         | integer \| null  | If created by a rollback, the source `version_id`; otherwise `null`         |
| version.snapshot.agent\_name            | string           | Agent name at the time this version was saved                               |
| version.snapshot.instructions           | string           | System prompt / instructions at the time this version was saved             |
| version.snapshot.ask\_user\_questions   | array            | User input fields configured at the time this version was saved             |
| version.snapshot.steps                  | array            | Automation steps configured at the time this version was saved              |
| version.snapshot.knowledge\_base\_files | array            | Knowledge base files linked at the time this version was saved              |
| version.snapshot.type                   | string           | Agent type (e.g., `chat`)                                                   |
| version.snapshot.subtype                | string           | Agent subtype (e.g., `All LLM Models`)                                      |
| version.snapshot.advanced\_settings     | object           | Model and temperature settings at the time this version was saved           |
| version.snapshot.visibility             | string           | Agent visibility (`private` or `public`) at the time this version was saved |

### **Error Responses**

#### **Not Found (404)**

```json theme={null}
{
  "message": "Version not found."
}
```

#### **Forbidden (403)**

```json theme={null}
{
  "message": "You do not have permission to view agent versions."
}
```
