Create an agent
curl --request POST \
--url https://whatsrb.com/api/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": {
"name": "<string>",
"system_prompt": "<string>",
"business_account_id": "<string>",
"description": "<string>",
"active": true,
"auto_run_inbound": false,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": [
"support.refund.process",
"support.ticket.create",
"operations.task.create"
]
}
}
'import requests
url = "https://whatsrb.com/api/v1/agents"
payload = { "agent": {
"name": "<string>",
"system_prompt": "<string>",
"business_account_id": "<string>",
"description": "<string>",
"active": True,
"auto_run_inbound": False,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": ["support.refund.process", "support.ticket.create", "operations.task.create"]
} }
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({
agent: {
name: '<string>',
system_prompt: '<string>',
business_account_id: '<string>',
description: '<string>',
active: true,
auto_run_inbound: false,
debounce_seconds: 10,
context_ttl_minutes: 60,
inbound_config: {
trigger_on: 'all',
min_message_length: 0,
max_messages_per_hour: 0,
ignore_patterns: []
},
allowed_actions: ['support.refund.process', 'support.ticket.create', 'operations.task.create']
}
})
};
fetch('https://whatsrb.com/api/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://whatsrb.com/api/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([
'agent' => [
'name' => '<string>',
'system_prompt' => '<string>',
'business_account_id' => '<string>',
'description' => '<string>',
'active' => true,
'auto_run_inbound' => false,
'debounce_seconds' => 10,
'context_ttl_minutes' => 60,
'inbound_config' => [
'trigger_on' => 'all',
'min_message_length' => 0,
'max_messages_per_hour' => 0,
'ignore_patterns' => [
]
],
'allowed_actions' => [
'support.refund.process',
'support.ticket.create',
'operations.task.create'
]
]
]),
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://whatsrb.com/api/v1/agents"
payload := strings.NewReader("{\n \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\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://whatsrb.com/api/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsrb.com/api/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 \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "agt_abc123",
"business_account_id": "ba_abc123",
"name": "<string>",
"description": "<string>",
"model": "gpt-4o-mini",
"temperature": 0.3,
"max_tokens": 1024,
"active": true,
"auto_run_inbound": true,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": [
"support.refund.process",
"support.ticket.create"
],
"payload_schema": [],
"confirmation_mode": "auto",
"confirmation_timeout_minutes": 30,
"tools": [
{
"key": "<string>",
"name": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid or missing API key"
}{
"error": "Validation failed",
"details": {
"to": [
"can't be blank"
]
}
}Agents
Create an agent
POST
/
agents
Create an agent
curl --request POST \
--url https://whatsrb.com/api/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": {
"name": "<string>",
"system_prompt": "<string>",
"business_account_id": "<string>",
"description": "<string>",
"active": true,
"auto_run_inbound": false,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": [
"support.refund.process",
"support.ticket.create",
"operations.task.create"
]
}
}
'import requests
url = "https://whatsrb.com/api/v1/agents"
payload = { "agent": {
"name": "<string>",
"system_prompt": "<string>",
"business_account_id": "<string>",
"description": "<string>",
"active": True,
"auto_run_inbound": False,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": ["support.refund.process", "support.ticket.create", "operations.task.create"]
} }
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({
agent: {
name: '<string>',
system_prompt: '<string>',
business_account_id: '<string>',
description: '<string>',
active: true,
auto_run_inbound: false,
debounce_seconds: 10,
context_ttl_minutes: 60,
inbound_config: {
trigger_on: 'all',
min_message_length: 0,
max_messages_per_hour: 0,
ignore_patterns: []
},
allowed_actions: ['support.refund.process', 'support.ticket.create', 'operations.task.create']
}
})
};
fetch('https://whatsrb.com/api/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://whatsrb.com/api/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([
'agent' => [
'name' => '<string>',
'system_prompt' => '<string>',
'business_account_id' => '<string>',
'description' => '<string>',
'active' => true,
'auto_run_inbound' => false,
'debounce_seconds' => 10,
'context_ttl_minutes' => 60,
'inbound_config' => [
'trigger_on' => 'all',
'min_message_length' => 0,
'max_messages_per_hour' => 0,
'ignore_patterns' => [
]
],
'allowed_actions' => [
'support.refund.process',
'support.ticket.create',
'operations.task.create'
]
]
]),
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://whatsrb.com/api/v1/agents"
payload := strings.NewReader("{\n \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\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://whatsrb.com/api/v1/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://whatsrb.com/api/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 \"agent\": {\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"business_account_id\": \"<string>\",\n \"description\": \"<string>\",\n \"active\": true,\n \"auto_run_inbound\": false,\n \"debounce_seconds\": 10,\n \"context_ttl_minutes\": 60,\n \"inbound_config\": {\n \"trigger_on\": \"all\",\n \"min_message_length\": 0,\n \"max_messages_per_hour\": 0,\n \"ignore_patterns\": []\n },\n \"allowed_actions\": [\n \"support.refund.process\",\n \"support.ticket.create\",\n \"operations.task.create\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "agt_abc123",
"business_account_id": "ba_abc123",
"name": "<string>",
"description": "<string>",
"model": "gpt-4o-mini",
"temperature": 0.3,
"max_tokens": 1024,
"active": true,
"auto_run_inbound": true,
"debounce_seconds": 10,
"context_ttl_minutes": 60,
"inbound_config": {
"trigger_on": "all",
"min_message_length": 0,
"max_messages_per_hour": 0,
"ignore_patterns": []
},
"allowed_actions": [
"support.refund.process",
"support.ticket.create"
],
"payload_schema": [],
"confirmation_mode": "auto",
"confirmation_timeout_minutes": 30,
"tools": [
{
"key": "<string>",
"name": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid or missing API key"
}{
"error": "Validation failed",
"details": {
"to": [
"can't be blank"
]
}
}
