Prévia de Agendamento
curl --request POST \
--url https://api.tess.im/digital-employees/schedule-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"heartbeat_cron": "<string>",
"heartbeat_schedule_json": {},
"execution_timezone": "<string>"
}
'import requests
url = "https://api.tess.im/digital-employees/schedule-preview"
payload = {
"heartbeat_cron": "<string>",
"heartbeat_schedule_json": {},
"execution_timezone": "<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({
heartbeat_cron: '<string>',
heartbeat_schedule_json: {},
execution_timezone: '<string>'
})
};
fetch('https://api.tess.im/digital-employees/schedule-preview', 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/schedule-preview",
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([
'heartbeat_cron' => '<string>',
'heartbeat_schedule_json' => [
],
'execution_timezone' => '<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/schedule-preview"
payload := strings.NewReader("{\n \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<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/schedule-preview")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/schedule-preview")
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 \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyDigital Employees
Prévia de Agendamento
Valida uma definição de agendamento e retorna as próximas ocorrências previstas.
POST
/
digital-employees
/
schedule-preview
Prévia de Agendamento
curl --request POST \
--url https://api.tess.im/digital-employees/schedule-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"heartbeat_cron": "<string>",
"heartbeat_schedule_json": {},
"execution_timezone": "<string>"
}
'import requests
url = "https://api.tess.im/digital-employees/schedule-preview"
payload = {
"heartbeat_cron": "<string>",
"heartbeat_schedule_json": {},
"execution_timezone": "<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({
heartbeat_cron: '<string>',
heartbeat_schedule_json: {},
execution_timezone: '<string>'
})
};
fetch('https://api.tess.im/digital-employees/schedule-preview', 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/schedule-preview",
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([
'heartbeat_cron' => '<string>',
'heartbeat_schedule_json' => [
],
'execution_timezone' => '<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/schedule-preview"
payload := strings.NewReader("{\n \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<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/schedule-preview")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tess.im/digital-employees/schedule-preview")
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 \"heartbeat_cron\": \"<string>\",\n \"heartbeat_schedule_json\": {},\n \"execution_timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyExemplos de Código
curl --request POST \
--url 'https://api.tess.im/digital-employees/schedule-preview' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: YOUR_WORKSPACE_ID' \
--data '{
"heartbeat_cron": "0 9 * * 1-5",
"execution_timezone": "America/Sao_Paulo"
}'
const axios = require('axios');
const data = {
"heartbeat_cron": "0 9 * * 1-5",
"execution_timezone": "America/Sao_Paulo"
};
const config = {
method: 'post',
url: 'https://api.tess.im/digital-employees/schedule-preview',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
'x-workspace-id': 'YOUR_WORKSPACE_ID'
},
data: data
};
try {
const response = await axios(config);
console.log(response.data);
} catch (error) {
console.error(error);
}
import requests
import json
url = "https://api.tess.im/digital-employees/schedule-preview"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"x-workspace-id": "YOUR_WORKSPACE_ID"
}
data = {
"heartbeat_cron": "0 9 * * 1-5",
"execution_timezone": "America/Sao_Paulo"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
<?php
$curl = curl_init();
$data = [
"heartbeat_cron" => "0 9 * * 1-5",
"execution_timezone" => "America/Sao_Paulo"
];
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tess.im/digital-employees/schedule-preview",
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($data),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json",
"x-workspace-id: YOUR_WORKSPACE_ID"
]
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Error: " . $err;
} else {
echo $response;
}
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Map;
public class Main {
public static void main(String[] args) throws Exception {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> data = Map.of(
"heartbeat_cron", "0 9 * * 1-5",
"execution_timezone", "America/Sao_Paulo"
);
String jsonPayload = mapper.writeValueAsString(data);
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.tess.im/digital-employees/schedule-preview"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.header("x-workspace-id", "YOUR_WORKSPACE_ID")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
package main
import (
"fmt"
"strings"
"io/ioutil"
"net/http"
)
func main() {
payload := `{
"heartbeat_cron": "0 9 * * 1-5",
"execution_timezone": "America/Sao_Paulo"
}`
client := &http.Client{}
req, err := http.NewRequest("POST", "https://api.tess.im/digital-employees/schedule-preview", strings.NewReader(payload))
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
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))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
var data = new
{
heartbeat_cron = "0 9 * * 1-5",
execution_timezone = "America/Sao_Paulo"
};
var jsonPayload = JsonConvert.SerializeObject(data);
var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
try
{
var response = await client.PostAsync(
"https://api.tess.im/digital-employees/schedule-preview",
content
);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine("\nException Caught!");
Console.WriteLine("Message :{0} ", e.Message);
}
}
}
}
require 'uri'
require 'net/http'
require 'json'
uri = URI('https://api.tess.im/digital-employees/schedule-preview')
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'] = 'YOUR_WORKSPACE_ID'
request.body = {
"heartbeat_cron": "0 9 * * 1-5",
"execution_timezone": "America/Sao_Paulo"
}.to_json
response = http.request(request)
puts response.read_body
Cabeçalhos
A autenticação é realizada via o cabeçalho
Authorization: Bearer YOUR_API_KEY.integer
obrigatório
ID do workspace. Obrigatório em todos os endpoints da API de Digital Employees.
Parâmetros do Corpo
Ao menos um entre
heartbeat_cron ou heartbeat_schedule_json deve ser fornecido no corpo da requisição.string
Expressão cron que define o agendamento (ex.:
0 9 * * 1-5 para dias úteis às 9h). Ao menos um entre heartbeat_cron ou heartbeat_schedule_json deve ser fornecido.object
Objeto de configuração do construtor de agendamento. Alternativa ao
heartbeat_cron. Ao menos um entre heartbeat_cron ou heartbeat_schedule_json deve ser fornecido.string
Fuso horário para avaliação do agendamento (ex.:
America/Sao_Paulo). Padrão: UTC se não informado.Resposta
{
"data": {
"effective_cron": "0 9 * * 1-5",
"next_occurrences": [
"2026-06-30T09:00:00-03:00",
"2026-07-01T09:00:00-03:00",
"2026-07-02T09:00:00-03:00"
]
}
}
⌘I