> ## 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.

# Rollback Digital Employee

> Restores a digital employee to a previous version.

### **Code Examples**

```http cURL theme={null}
curl --request POST \
  --url 'https://api.tess.im/digital-employees/123/rollback' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: 10' \
  --data '{"version": 6}'
```

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

const config = {
  method: 'post',
  url: 'https://api.tess.im/digital-employees/123/rollback',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
    'x-workspace-id': '10'
  },
  data: {
    version: 6
  }
};

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/digital-employees/123/rollback"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
    "x-workspace-id": "10"
}
payload = {
    "version": 6
}

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

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

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.tess.im/digital-employees/123/rollback",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode(["version" => 6]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_API_KEY",
    "Content-Type: application/json",
    "x-workspace-id: 10"
  ]
]);

$response = curl_exec($curl);
curl_close($curl);
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/digital-employees/123/rollback"))
    .header("Authorization", "Bearer YOUR_API_KEY")
    .header("Content-Type", "application/json")
    .header("x-workspace-id", "10")
    .POST(HttpRequest.BodyPublishers.ofString("{\"version\": 6}"))
    .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"
    "strings"
)

func main() {
    client := &http.Client{}
    body := strings.NewReader(`{"version": 6}`)
    req, _ := http.NewRequest("POST", "https://api.tess.im/digital-employees/123/rollback", body)
    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("x-workspace-id", "10")
    resp, _ := client.Do(req)
    defer resp.Body.Close()
    respBody, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(respBody))
}
```

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

using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
client.DefaultRequestHeaders.Add("x-workspace-id", "10");

var content = new StringContent(
    "{\"version\": 6}",
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.tess.im/digital-employees/123/rollback",
    content
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

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

uri = URI('https://api.tess.im/digital-employees/123/rollback')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request['x-workspace-id'] = '10'
request.body = { version: 6 }.to_json

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

### **Headers**

> [!NOTE]
>
> Pass your API key as a Bearer token in the `Authorization` header: `Authorization: Bearer YOUR_API_KEY`.

**x-workspace-id** `integer`

ID of the workspace. If not provided, the user's selected workspace will be used.

### **Path Parameters**

**employeeId** `integer` *required*

ID of the digital employee to roll back.

### **Body Parameters**

**version** `integer` *required*

The version number to restore. Must be `>= 1`. Use [Get Rollback Options](https://docs.tess.im/en/de-rollback-options.md) to see the list of available versions.

### **Response**

```json theme={null}
{
  "success": true,
  "restored_from_version": 6,
  "new_current_version": 9,
  "message": "Rollback completed successfully.",
  "employee": {}
}
```


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