curl --request POST \
--url https://api.neoagent.io/public-api/agents/{agent_id}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calls_per_minute_limit": 123,
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"runs_per_day_limit": 123
}
'import requests
url = "https://api.neoagent.io/public-api/agents/{agent_id}/webhook"
payload = {
"calls_per_minute_limit": 123,
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"runs_per_day_limit": 123
}
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({
calls_per_minute_limit: 123,
idempotency_key: {body_path: '<string>', header: '<string>'},
runs_per_day_limit: 123
})
};
fetch('https://api.neoagent.io/public-api/agents/{agent_id}/webhook', 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.neoagent.io/public-api/agents/{agent_id}/webhook",
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([
'calls_per_minute_limit' => 123,
'idempotency_key' => [
'body_path' => '<string>',
'header' => '<string>'
],
'runs_per_day_limit' => 123
]),
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.neoagent.io/public-api/agents/{agent_id}/webhook"
payload := strings.NewReader("{\n \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\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.neoagent.io/public-api/agents/{agent_id}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/agents/{agent_id}/webhook")
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 \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"agent_id": 123,
"calls_per_minute_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credits_per_run_estimate": {
"credits": 123,
"sampled_runs": 123
},
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"runs_per_day_limit": 123,
"url": "<string>",
"usage_last_24_hours": {
"calls": 123,
"duplicates": 123,
"refused": 123,
"runs_started": 123
},
"webhook_id": "<string>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timings_ms": {},
"pagination": {
"has_more": true,
"next_cursor": "<string>"
},
"warnings": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Add a webhook to an agent
Gives a Custom trigger agent its webhook and returns its URL. One webhook per agent: 409 agent_webhook_exists when it has one. idempotency_key names where a call carries its idempotency key, a header or a body_path (keys and array indexes only, such as event.id or items[0].id); a second call with a key the webhook has seen starts no run. calls_per_minute_limit (1 to 500, default 30) and runs_per_day_limit (1 to 20,000, default 500) set the limits; left out, the webhook gets the defaults. 400 validation_error on an agent that is not a Custom trigger agent, on a location that breaks that grammar, and on a limit out of range. Needs the rights to edit and to run the agent (agents:write and executions:write on an API key).
curl --request POST \
--url https://api.neoagent.io/public-api/agents/{agent_id}/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calls_per_minute_limit": 123,
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"runs_per_day_limit": 123
}
'import requests
url = "https://api.neoagent.io/public-api/agents/{agent_id}/webhook"
payload = {
"calls_per_minute_limit": 123,
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"runs_per_day_limit": 123
}
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({
calls_per_minute_limit: 123,
idempotency_key: {body_path: '<string>', header: '<string>'},
runs_per_day_limit: 123
})
};
fetch('https://api.neoagent.io/public-api/agents/{agent_id}/webhook', 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.neoagent.io/public-api/agents/{agent_id}/webhook",
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([
'calls_per_minute_limit' => 123,
'idempotency_key' => [
'body_path' => '<string>',
'header' => '<string>'
],
'runs_per_day_limit' => 123
]),
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.neoagent.io/public-api/agents/{agent_id}/webhook"
payload := strings.NewReader("{\n \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\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.neoagent.io/public-api/agents/{agent_id}/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neoagent.io/public-api/agents/{agent_id}/webhook")
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 \"calls_per_minute_limit\": 123,\n \"idempotency_key\": {\n \"body_path\": \"<string>\",\n \"header\": \"<string>\"\n },\n \"runs_per_day_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"agent_id": 123,
"calls_per_minute_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"credits_per_run_estimate": {
"credits": 123,
"sampled_runs": 123
},
"idempotency_key": {
"body_path": "<string>",
"header": "<string>"
},
"last_used_at": "2023-11-07T05:31:56Z",
"rotated_at": "2023-11-07T05:31:56Z",
"runs_per_day_limit": 123,
"url": "<string>",
"usage_last_24_hours": {
"calls": 123,
"duplicates": 123,
"refused": 123,
"runs_started": 123
},
"webhook_id": "<string>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timings_ms": {},
"pagination": {
"has_more": true,
"next_cursor": "<string>"
},
"warnings": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Authorization: Bearer <token> where <token> is either a neo_sk_<env>_<secret> API key (service account) or a Microsoft Entra ID access token (dashboard user). A key created with scopes reaches only the permission groups they name, and gets 403 insufficient_scope elsewhere; GET /public-api/scopes lists them.
