JavaScript
import Avido from 'avido';
const client = new Avido({
apiKey: process.env['AVIDO_API_KEY'], // This is the default and can be omitted
applicationID: process.env['AVIDO_APPLICATION_ID'], // This is the default and can be omitted
});
const response = await client.validateWebhook.validate({
body: {
applicationId: '456e7890-e89b-12d3-a456-426614174000',
prompt: 'I lost my card, please block it.',
testId: '123e4567-e89b-12d3-a456-426614174000',
},
signature: 'abc123signature',
});
console.log(response.valid);import os
from avido import Avido
client = Avido(
api_key=os.environ.get("AVIDO_API_KEY"), # This is the default and can be omitted
application_id=os.environ.get("AVIDO_APPLICATION_ID"), # This is the default and can be omitted
)
response = client.validate_webhook.validate(
body={
"application_id": "456e7890-e89b-12d3-a456-426614174000",
"prompt": "I lost my card, please block it.",
"test_id": "123e4567-e89b-12d3-a456-426614174000",
},
signature="abc123signature",
)
print(response.valid)curl --request POST \
--url https://api.avidoai.com/v0/validate-webhook \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"signature": "abc123signature",
"body": {
"applicationId": "456e7890-e89b-12d3-a456-426614174000",
"prompt": "I lost my card, please block it.",
"testId": "123e4567-e89b-12d3-a456-426614174000",
"metadata": {
"customerId": "1",
"priority": "high"
}
},
"timestamp": "2024-01-01T00:00:00.000Z"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avidoai.com/v0/validate-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([
'signature' => 'abc123signature',
'body' => [
'applicationId' => '456e7890-e89b-12d3-a456-426614174000',
'prompt' => 'I lost my card, please block it.',
'testId' => '123e4567-e89b-12d3-a456-426614174000',
'metadata' => [
'customerId' => '1',
'priority' => 'high'
]
],
'timestamp' => '2024-01-01T00:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$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.avidoai.com/v0/validate-webhook"
payload := strings.NewReader("{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
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.avidoai.com/v0/validate-webhook")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/validate-webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Webhook
Validate an incoming webhook request
Checks the body (including timestamp and signature) against the configured webhook secret. Returns { valid: true } if the signature is valid.
POST
/
v0
/
validate-webhook
JavaScript
import Avido from 'avido';
const client = new Avido({
apiKey: process.env['AVIDO_API_KEY'], // This is the default and can be omitted
applicationID: process.env['AVIDO_APPLICATION_ID'], // This is the default and can be omitted
});
const response = await client.validateWebhook.validate({
body: {
applicationId: '456e7890-e89b-12d3-a456-426614174000',
prompt: 'I lost my card, please block it.',
testId: '123e4567-e89b-12d3-a456-426614174000',
},
signature: 'abc123signature',
});
console.log(response.valid);import os
from avido import Avido
client = Avido(
api_key=os.environ.get("AVIDO_API_KEY"), # This is the default and can be omitted
application_id=os.environ.get("AVIDO_APPLICATION_ID"), # This is the default and can be omitted
)
response = client.validate_webhook.validate(
body={
"application_id": "456e7890-e89b-12d3-a456-426614174000",
"prompt": "I lost my card, please block it.",
"test_id": "123e4567-e89b-12d3-a456-426614174000",
},
signature="abc123signature",
)
print(response.valid)curl --request POST \
--url https://api.avidoai.com/v0/validate-webhook \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"signature": "abc123signature",
"body": {
"applicationId": "456e7890-e89b-12d3-a456-426614174000",
"prompt": "I lost my card, please block it.",
"testId": "123e4567-e89b-12d3-a456-426614174000",
"metadata": {
"customerId": "1",
"priority": "high"
}
},
"timestamp": "2024-01-01T00:00:00.000Z"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.avidoai.com/v0/validate-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([
'signature' => 'abc123signature',
'body' => [
'applicationId' => '456e7890-e89b-12d3-a456-426614174000',
'prompt' => 'I lost my card, please block it.',
'testId' => '123e4567-e89b-12d3-a456-426614174000',
'metadata' => [
'customerId' => '1',
'priority' => 'high'
]
],
'timestamp' => '2024-01-01T00:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$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.avidoai.com/v0/validate-webhook"
payload := strings.NewReader("{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
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.avidoai.com/v0/validate-webhook")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/validate-webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"abc123signature\",\n \"body\": {\n \"applicationId\": \"456e7890-e89b-12d3-a456-426614174000\",\n \"prompt\": \"I lost my card, please block it.\",\n \"testId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"metadata\": {\n \"customerId\": \"1\",\n \"priority\": \"high\"\n }\n },\n \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Authorizations
Your unique Avido API key
Your unique Avido Application ID
Body
application/json
Raw JSON payload sent by an external webhook, including signature and timestamp. HMAC verification is used for security.
HMAC signature for the request body.
Example:
"abc123signature"
The payload received from Avido. Use this in signature verification.
Show child attributes
Show child attributes
Timestamp for the request. Accepts unix milliseconds (string/number) and ISO date strings.
Example:
"2024-01-01T00:00:00.000Z"
Response
Webhook is valid
Response object indicating whether the webhook was valid.
Indicates if the webhook payload was successfully validated.
Example:
true
⌘I