Python
import requests
webhook_id = "your-webhook-id"
response = requests.post(
f"https://api.roe-ai.com/webhooks/{webhook_id}/agents/",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={"agent_ids": ["agent-id-1", "agent-id-2"]}
)
linked = response.json()
print(f"Linked {len(linked)} agents")const webhookId = "your-webhook-id";
const response = await fetch(
`https://api.roe-ai.com/webhooks/${webhookId}/agents/`,
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
agent_ids: ["agent-id-1", "agent-id-2"]
})
}
);
const linked = await response.json();
console.log(linked);
curl -X POST "https://api.roe-ai.com/webhooks/YOUR_WEBHOOK_ID/agents/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_ids": ["AGENT_ID_1", "AGENT_ID_2"]}'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.roe-ai.com/webhooks/{webhook_id}/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.roe-ai.com/webhooks/{webhook_id}/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_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.roe-ai.com/webhooks/{webhook_id}/agents/"
payload := strings.NewReader("{\n \"agent_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.roe-ai.com/webhooks/{webhook_id}/agents/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roe-ai.com/webhooks/{webhook_id}/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_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"agent_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Webhooks
Link Agents to Webhook
List agents linked to a webhook, or link new agents.
GET: List all agents linked to this webhook POST: Link one or more agents to this webhook
POST
/
webhooks
/
{webhook_id}
/
agents
/
Python
import requests
webhook_id = "your-webhook-id"
response = requests.post(
f"https://api.roe-ai.com/webhooks/{webhook_id}/agents/",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={"agent_ids": ["agent-id-1", "agent-id-2"]}
)
linked = response.json()
print(f"Linked {len(linked)} agents")const webhookId = "your-webhook-id";
const response = await fetch(
`https://api.roe-ai.com/webhooks/${webhookId}/agents/`,
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
agent_ids: ["agent-id-1", "agent-id-2"]
})
}
);
const linked = await response.json();
console.log(linked);
curl -X POST "https://api.roe-ai.com/webhooks/YOUR_WEBHOOK_ID/agents/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_ids": ["AGENT_ID_1", "AGENT_ID_2"]}'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.roe-ai.com/webhooks/{webhook_id}/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.roe-ai.com/webhooks/{webhook_id}/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_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.roe-ai.com/webhooks/{webhook_id}/agents/"
payload := strings.NewReader("{\n \"agent_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.roe-ai.com/webhooks/{webhook_id}/agents/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roe-ai.com/webhooks/{webhook_id}/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_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"agent_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Organization ID. This is required for access control. It can be provided via query or request body depending on the endpoint.
Body
application/json
Serializer for batch linking multiple agents to a webhook.
List of agent IDs to link to this webhook
Minimum array length:
1Response
201 - application/json
Serializer for batch linking multiple agents to a webhook.
List of agent IDs to link to this webhook
Minimum array length:
1⌘I