Reparent Digital Employee
curl --request POST \
--url https://api.tess.im/digital-employees/{employeeId}/reparent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_employee_id": 123
}
'import requests
url = "https://api.tess.im/digital-employees/{employeeId}/reparent"
payload = { "parent_employee_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({parent_employee_id: 123})
};
fetch('https://api.tess.im/digital-employees/{employeeId}/reparent', 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/{employeeId}/reparent",
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([
'parent_employee_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/{employeeId}/reparent"
payload := strings.NewReader("{\n \"parent_employee_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{employeeId}/reparent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_employee_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/{employeeId}/reparent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent_employee_id\": 123\n}"
response = http.request(request)
puts response.read_bodyDigital Employees
Reparent Digital Employee
Assigns a new parent employee, making this employee a child of another.
POST
/
digital-employees
/
{employeeId}
/
reparent
Reparent Digital Employee
curl --request POST \
--url https://api.tess.im/digital-employees/{employeeId}/reparent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_employee_id": 123
}
'import requests
url = "https://api.tess.im/digital-employees/{employeeId}/reparent"
payload = { "parent_employee_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({parent_employee_id: 123})
};
fetch('https://api.tess.im/digital-employees/{employeeId}/reparent', 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/{employeeId}/reparent",
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([
'parent_employee_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/{employeeId}/reparent"
payload := strings.NewReader("{\n \"parent_employee_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{employeeId}/reparent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_employee_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/{employeeId}/reparent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"parent_employee_id\": 123\n}"
response = http.request(request)
puts response.read_bodyCode Examples
curl --request POST \
--url 'https://api.tess.im/digital-employees/123/reparent' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: 10' \
--data '{"parent_employee_id": 100}'
const axios = require('axios');
const config = {
method: 'post',
url: 'https://api.tess.im/digital-employees/123/reparent',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'x-workspace-id': '10'
},
data: {
parent_employee_id: 100
}
};
try {
const response = await axios(config);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
url = "https://api.tess.im/digital-employees/123/reparent"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"x-workspace-id": "10"
}
payload = {
"parent_employee_id": 100
}
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/123/reparent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(["parent_employee_id" => 100]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json",
"x-workspace-id: 10"
]
]);
$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;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.tess.im/digital-employees/123/reparent"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.header("x-workspace-id", "10")
.POST(HttpRequest.BodyPublishers.ofString("{\"parent_employee_id\": 100}"))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
body := strings.NewReader(`{"parent_employee_id": 100}`)
req, _ := http.NewRequest("POST", "https://api.tess.im/digital-employees/123/reparent", 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))
}
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(
"{\"parent_employee_id\": 100}",
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync(
"https://api.tess.im/digital-employees/123/reparent",
content
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://api.tess.im/digital-employees/123/reparent')
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 = { parent_employee_id: 100 }.to_json
response = http.request(request)
puts response.read_body
Headers
Pass your API key as a Bearer token in the
Authorization header: Authorization: Bearer YOUR_API_KEY.integer
ID of the workspace. If not provided, the user’s selected workspace will be used.
Path Parameters
integer
required
ID of the digital employee to reassign to a new parent.
Body Parameters
integer
required
ID of the new parent digital employee. The parent must exist in the same workspace.
Response
{
"data": {
"id": 123,
"name": "Finance Ops",
"parent_employee_id": 100,
"workspace_id": 10
}
}
Use Detach to remove a parent relationship without setting a new one.
⌘I