Create an agent
curl --request POST \
--url https://api.wondeya.com/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"description": "<string>",
"url": "<string>",
"path": {}
}
]
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": [
"<string>"
]
},
"content": {
"useWorkspaceKnowledge": true,
"useWorkspaceAssets": true
}
}
'import requests
url = "https://api.wondeya.com/v1/agents"
payload = {
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"description": "<string>",
"url": "<string>",
"path": {}
}
]
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": ["<string>"]
},
"content": {
"useWorkspaceKnowledge": True,
"useWorkspaceAssets": True
}
}
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({
name: '<string>',
identity: {
businessName: '<string>',
description: '<string>',
tone: '<string>',
actions: [{id: 'talk_to_team', description: '<string>'}],
links: [{id: 'menu', description: '<string>', url: '<string>', path: {}}]
},
answerPolicy: {contactLinkId: {}, forbiddenTopics: ['<string>']},
content: {useWorkspaceKnowledge: true, useWorkspaceAssets: true}
})
};
fetch('https://api.wondeya.com/v1/agents', 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",
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([
'name' => '<string>',
'identity' => [
'businessName' => '<string>',
'description' => '<string>',
'tone' => '<string>',
'actions' => [
[
'id' => 'talk_to_team',
'description' => '<string>'
]
],
'links' => [
[
'id' => 'menu',
'description' => '<string>',
'url' => '<string>',
'path' => [
]
]
]
],
'answerPolicy' => [
'contactLinkId' => [
],
'forbiddenTopics' => [
'<string>'
]
],
'content' => [
'useWorkspaceKnowledge' => true,
'useWorkspaceAssets' => true
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/agents")
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 \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"label": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"url": "<string>",
"kind": "<string>",
"path": {}
}
]
},
"content": {
"useWorkspaceKnowledge": true,
"useWorkspaceAssets": true
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": [
"<string>"
]
},
"defaultLocale": "es",
"locales": [
"es"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Agents
Create an agent
A new BRAIN, born neutral. Create one per business, never one per page: pages share an agent. An agent is the unit that COSTS (its own corpus and vectors); the plan limits them.
POST
/
v1
/
agents
Create an agent
curl --request POST \
--url https://api.wondeya.com/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"description": "<string>",
"url": "<string>",
"path": {}
}
]
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": [
"<string>"
]
},
"content": {
"useWorkspaceKnowledge": true,
"useWorkspaceAssets": true
}
}
'import requests
url = "https://api.wondeya.com/v1/agents"
payload = {
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"description": "<string>",
"url": "<string>",
"path": {}
}
]
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": ["<string>"]
},
"content": {
"useWorkspaceKnowledge": True,
"useWorkspaceAssets": True
}
}
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({
name: '<string>',
identity: {
businessName: '<string>',
description: '<string>',
tone: '<string>',
actions: [{id: 'talk_to_team', description: '<string>'}],
links: [{id: 'menu', description: '<string>', url: '<string>', path: {}}]
},
answerPolicy: {contactLinkId: {}, forbiddenTopics: ['<string>']},
content: {useWorkspaceKnowledge: true, useWorkspaceAssets: true}
})
};
fetch('https://api.wondeya.com/v1/agents', 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",
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([
'name' => '<string>',
'identity' => [
'businessName' => '<string>',
'description' => '<string>',
'tone' => '<string>',
'actions' => [
[
'id' => 'talk_to_team',
'description' => '<string>'
]
],
'links' => [
[
'id' => 'menu',
'description' => '<string>',
'url' => '<string>',
'path' => [
]
]
]
],
'answerPolicy' => [
'contactLinkId' => [
],
'forbiddenTopics' => [
'<string>'
]
],
'content' => [
'useWorkspaceKnowledge' => true,
'useWorkspaceAssets' => true
]
]),
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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/agents")
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 \"name\": \"<string>\",\n \"identity\": {\n \"businessName\": \"<string>\",\n \"description\": \"<string>\",\n \"tone\": \"<string>\",\n \"actions\": [\n {\n \"id\": \"talk_to_team\",\n \"description\": \"<string>\"\n }\n ],\n \"links\": [\n {\n \"id\": \"menu\",\n \"description\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": {}\n }\n ]\n },\n \"answerPolicy\": {\n \"contactLinkId\": {},\n \"forbiddenTopics\": [\n \"<string>\"\n ]\n },\n \"content\": {\n \"useWorkspaceKnowledge\": true,\n \"useWorkspaceAssets\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"identity": {
"businessName": "<string>",
"description": "<string>",
"tone": "<string>",
"actions": [
{
"id": "talk_to_team",
"description": "<string>"
}
],
"links": [
{
"id": "menu",
"label": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"url": "<string>",
"kind": "<string>",
"path": {}
}
]
},
"content": {
"useWorkspaceKnowledge": true,
"useWorkspaceAssets": true
},
"answerPolicy": {
"contactLinkId": {},
"forbiddenTopics": [
"<string>"
]
},
"defaultLocale": "es",
"locales": [
"es"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
A workspace API key: wdy_live_… / wdy_test_…. Created at POST /workspaces/{tenantId}/keys and shown exactly once.
Body
application/json
Response
The agent id. The only handle it has.
Internal label. Never an address (no slug).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The language the agent’s copy is authored in (D-44).
Available options:
es, en Every language the agent speaks.
Available options:
es, en