curl --request POST \
--url https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "react",
"message": "meu pedido 12345 ainda não chegou, o que houve?",
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}
'import requests
url = "https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke"
payload = {
"role": "react",
"message": "meu pedido 12345 ainda não chegou, o que houve?",
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}
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({
role: 'react',
message: 'meu pedido 12345 ainda não chegou, o que houve?',
threadId: '6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d'
})
};
fetch('https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke', 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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke",
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([
'role' => 'react',
'message' => 'meu pedido 12345 ainda não chegou, o que houve?',
'threadId' => '6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d'
]),
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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke"
payload := strings.NewReader("{\n \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke")
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 \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\n}"
response = http.request(request)
puts response.read_body{
"reply": "Seu pedido 12345 saiu para entrega ontem e chega até amanhã.",
"messages": [
{}
],
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}Chat with one agent in a test conversation
Starts or continues a TEST CONVERSATION with ONE agent — a draft included, which is what this is for: chat with an agent you just created or edited before a human publishes it. Each call is one turn: you send what the customer would say, the agent answers. The first call opens a new conversation and returns its threadId; send that threadId back on the following calls to keep talking in the same conversation — the agent remembers everything already said in it, so you can test follow-up questions, corrections and multi-step flows the way a real customer would go through them. Omit threadId to start over from scratch. The agent runs isolated: only its own prompt, tools and knowledge, with NONE of the ClaudIA pipeline around it (no classification, no hand-off rules, no ticket, and nothing reaches a customer or an inbox) — to see what a customer would actually receive from the whole pipeline, use runPlayground. This call spends real model tokens on the tenant’s account. It blocks until the agent is done, which is seconds to a couple of minutes. id/role are the same pair getAssistant takes.
curl --request POST \
--url https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": "react",
"message": "meu pedido 12345 ainda não chegou, o que houve?",
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}
'import requests
url = "https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke"
payload = {
"role": "react",
"message": "meu pedido 12345 ainda não chegou, o que houve?",
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}
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({
role: 'react',
message: 'meu pedido 12345 ainda não chegou, o que houve?',
threadId: '6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d'
})
};
fetch('https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke', 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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke",
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([
'role' => 'react',
'message' => 'meu pedido 12345 ainda não chegou, o que houve?',
'threadId' => '6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d'
]),
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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke"
payload := strings.NewReader("{\n \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\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.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudhumans.com/claudia/v1/tenants/{tenant}/assistants/{id}/invoke")
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 \"role\": \"react\",\n \"message\": \"meu pedido 12345 ainda não chegou, o que houve?\",\n \"threadId\": \"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d\"\n}"
response = http.request(request)
puts response.read_body{
"reply": "Seu pedido 12345 saiu para entrega ontem e chega até amanhã.",
"messages": [
{}
],
"threadId": "6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "Forbidden: token holds no claim for the requested account"
}{
"error": "Forbidden: token holds no claim for the requested account"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Tenant whose agents you are managing. Discover the tenants your credentials cover with listMyClaudiaProjects. A tenant your credentials do not cover is indistinguishable from one that does not exist.
Assistant to operate on, as returned by listAssistants (assistant_id field).
Body
The message to send, and which deployment the agent lives in.
One turn of a test conversation with a single agent: the message to send, and the thread to continue when there is one.
Deployment the assistant lives in — the deployment_role listAssistants returns for it: supervisor, react, or qna for a knowledge-base Q&A agent (which runs on the react deployment). Any other value answers 400.
supervisor, react, qna "react"
What the customer says this turn, verbatim and in the customer's own language. One turn per call: to keep the conversation going, send the next message with the threadId you got back.
"meu pedido 12345 ainda não chegou, o que houve?"
Thread of the test conversation to continue. Pass the threadId from the previous response and the agent answers with everything already said in that conversation in mind — this is how you send several messages to the same agent in sequence. Omit it to start a new conversation.
"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"
Response
The turn finished and this is what the agent answered.
One turn of the test conversation: what the agent answered, the thread to continue it, and the whole history so far.
The text of the agent's last reply in this turn. Empty when the turn ended without an assistant message — read messages then.
"Seu pedido 12345 saiu para entrega ontem e chega até amanhã."
The whole test conversation so far, as the runtime stores it: every human, ai and tool message of the thread in order, earlier turns included, each with type and content. Free-form objects — read the keys rather than assuming a shape.
The test conversation this turn belongs to. Send it back as threadId on the next call to keep talking with the same history; a new one is created whenever you omit it.
"6c7b1f2e-3a4d-4f5b-8c9d-0e1f2a3b4c5d"