curl --request POST \
--url https://api.wondeya.com/v1/agents/{agentId}/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"locale": "es",
"conversationId": "<string>"
}
'import requests
url = "https://api.wondeya.com/v1/agents/{agentId}/chat"
payload = {
"message": "<string>",
"locale": "es",
"conversationId": "<string>"
}
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({message: '<string>', locale: 'es', conversationId: '<string>'})
};
fetch('https://api.wondeya.com/v1/agents/{agentId}/chat', 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.wondeya.com/v1/agents/{agentId}/chat",
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([
'message' => '<string>',
'locale' => 'es',
'conversationId' => '<string>'
]),
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.wondeya.com/v1/agents/{agentId}/chat"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\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.wondeya.com/v1/agents/{agentId}/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/agents/{agentId}/chat")
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 \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"reply": "<string>",
"components": [
{
"slot": "<string>",
"props": {}
}
],
"cached": true
}Chat with an agent (headless)
Runs one generative turn and spends one message credit atomically (D-16). JSON by default; send Accept: text/event-stream for SSE. Continue a conversation with conversationId. Idempotency-Key (JSON mode) makes a retry replay the first answer without spending a second credit.
curl --request POST \
--url https://api.wondeya.com/v1/agents/{agentId}/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"locale": "es",
"conversationId": "<string>"
}
'import requests
url = "https://api.wondeya.com/v1/agents/{agentId}/chat"
payload = {
"message": "<string>",
"locale": "es",
"conversationId": "<string>"
}
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({message: '<string>', locale: 'es', conversationId: '<string>'})
};
fetch('https://api.wondeya.com/v1/agents/{agentId}/chat', 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.wondeya.com/v1/agents/{agentId}/chat",
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([
'message' => '<string>',
'locale' => 'es',
'conversationId' => '<string>'
]),
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.wondeya.com/v1/agents/{agentId}/chat"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\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.wondeya.com/v1/agents/{agentId}/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/agents/{agentId}/chat")
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 \"message\": \"<string>\",\n \"locale\": \"es\",\n \"conversationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"reply": "<string>",
"components": [
{
"slot": "<string>",
"props": {}
}
],
"cached": true
}Authorizations
A workspace API key: wdy_live_… / wdy_test_…. Created at POST /workspaces/{tenantId}/keys and shown exactly once.
Path Parameters
Body
The visitor question the agent answers.
1 - 1000es, en Continue a conversation: pass the conversationId a previous turn returned. Omit to start a new one; the server owns the transcript.
Response
The server-owned conversation this turn is in.
The assistant’s text answer.
The generative-UI components the agent chose to render.
Show child attributes
Show child attributes
True when the turn was replayed from cache (spent no credit).