Import Template Pack
curl --request POST \
--url https://api.tess.im/digital-employees/template-packs/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"pack": {},
"target_agent_id": 123,
"collision_strategy": "<string>"
}
'import requests
url = "https://api.tess.im/digital-employees/template-packs/import"
payload = {
"pack": {},
"target_agent_id": 123,
"collision_strategy": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({pack: {}, target_agent_id: 123, collision_strategy: '<string>'})
};
fetch('https://api.tess.im/digital-employees/template-packs/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/digital-employees/template-packs/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pack' => [
],
'target_agent_id' => 123,
'collision_strategy' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/digital-employees/template-packs/import"
payload := strings.NewReader("{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tess.im/digital-employees/template-packs/import")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/template-packs/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyDigital Employees
Import Template Pack
Imports a template pack, creating or updating a digital employee from the pack configuration.
POST
/
digital-employees
/
template-packs
/
import
Import Template Pack
curl --request POST \
--url https://api.tess.im/digital-employees/template-packs/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"pack": {},
"target_agent_id": 123,
"collision_strategy": "<string>"
}
'import requests
url = "https://api.tess.im/digital-employees/template-packs/import"
payload = {
"pack": {},
"target_agent_id": 123,
"collision_strategy": "<string>"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({pack: {}, target_agent_id: 123, collision_strategy: '<string>'})
};
fetch('https://api.tess.im/digital-employees/template-packs/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/digital-employees/template-packs/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pack' => [
],
'target_agent_id' => 123,
'collision_strategy' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tess.im/digital-employees/template-packs/import"
payload := strings.NewReader("{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tess.im/digital-employees/template-packs/import")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/template-packs/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pack\": {},\n \"target_agent_id\": 123,\n \"collision_strategy\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyImport a template pack to create or update a digital employee. If no
target_agent_id is provided, a new host agent is created automatically to receive the imported employee.
Run Preview Template Import first to validate the pack and check for conflicts before executing the import.
Code Examples
curl --request POST \
--url 'https://api.tess.im/digital-employees/template-packs/import' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'x-workspace-id: YOUR_WORKSPACE_ID' \
--header 'Content-Type: application/json' \
--data '{
"target_agent_id": 99,
"collision_strategy": "rename",
"pack": {}
}'
const axios = require('axios');
const config = {
method: 'post',
url: 'https://api.tess.im/digital-employees/template-packs/import',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'x-workspace-id': 'YOUR_WORKSPACE_ID',
'Content-Type': 'application/json'
},
data: {
target_agent_id: 99,
collision_strategy: 'rename',
pack: {}
}
};
try {
const response = await axios(config);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
url = "https://api.tess.im/digital-employees/template-packs/import"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"x-workspace-id": "YOUR_WORKSPACE_ID",
"Content-Type": "application/json"
}
payload = {
"target_agent_id": 99,
"collision_strategy": "rename",
"pack": {}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/digital-employees/template-packs/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_agent_id' => 99,
'collision_strategy' => 'rename',
'pack' => (object)[]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"x-workspace-id: YOUR_WORKSPACE_ID",
"Content-Type: application/json"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String body = """
{
"target_agent_id": 99,
"collision_strategy": "rename",
"pack": {}
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.tess.im/digital-employees/template-packs/import"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("x-workspace-id", "YOUR_WORKSPACE_ID")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"target_agent_id": 99,
"collision_strategy": "rename",
"pack": {}
}`)
client := &http.Client{}
req, _ := http.NewRequest("POST",
"https://api.tess.im/digital-employees/template-packs/import",
payload)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
req.Header.Add("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
using System.Net.Http;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
var payload = new {
target_agent_id = 99,
collision_strategy = "rename",
pack = new {}
};
var content = new StringContent(
JsonSerializer.Serialize(payload),
Encoding.UTF8,
"application/json");
var response = await client.PostAsync(
"https://api.tess.im/digital-employees/template-packs/import",
content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://api.tess.im/digital-employees/template-packs/import')
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['x-workspace-id'] = 'YOUR_WORKSPACE_ID'
request['Content-Type'] = 'application/json'
request.body = {
target_agent_id: 99,
collision_strategy: 'rename',
pack: {}
}.to_json
response = http.request(request)
puts response.read_body
Headers
Include your API key in the
Authorization header as a Bearer token on every request.integer
required
ID of the workspace. Required for all Digital Employees API requests.
Request Body
object
required
The template pack payload obtained from Export Template Pack.
integer
ID of the agent to import into. If omitted, a new host agent is created automatically.
string
How to handle naming conflicts with existing employees. Options:
skip— keep existing employees, skip conflicting imports (default)rename— auto-rename imported employees to avoid conflictsoverwrite— replace existing employees with imported configuration
Response
Returns the import result object describing the employees created, updated, or skipped.{
"data": {
"employees_created": [],
"employees_updated": [],
"employees_skipped": []
}
}
Errors
422withreason: digital_employee_template_import_blocked— the pack contains blocking issues that prevent import. Inspect theblocking_issuesarray in the response for details.422— invalid pack structure or missing required fields.
⌘I