curl --request POST \
--url https://api.ryvo.so/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://crm.acme.example/hooks/ryvo",
"events": [
"conversation.ended",
"analysis.ready"
],
"accept_per_event_billing": true
}
'import requests
url = "https://api.ryvo.so/v1/webhooks"
payload = {
"url": "https://crm.acme.example/hooks/ryvo",
"events": ["conversation.ended", "analysis.ready"],
"accept_per_event_billing": 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({
url: 'https://crm.acme.example/hooks/ryvo',
events: ['conversation.ended', 'analysis.ready'],
accept_per_event_billing: true
})
};
fetch('https://api.ryvo.so/v1/webhooks', 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.ryvo.so/v1/webhooks",
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([
'url' => 'https://crm.acme.example/hooks/ryvo',
'events' => [
'conversation.ended',
'analysis.ready'
],
'accept_per_event_billing' => 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.ryvo.so/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\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.ryvo.so/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ryvo.so/v1/webhooks")
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 \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "7f8e9d0c-1b2a-4c3d-8e4f-5a6b7c8d9e0f",
"url": "https://crm.acme.example/hooks/ryvo",
"events": [
"conversation.ended",
"analysis.ready"
],
"is_active": true,
"consecutive_failures": 0,
"auto_disabled_at": "2023-11-07T05:31:56Z",
"auto_disabled_reason": "<string>",
"previous_secret_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"signing_secret": "whsec_3f1c9a7e5b2d8f0a1c4e6b8d0f2a4c6e8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a"
}{
"error": "invalid_query",
"message": "limit must be an integer between 1 and 100.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Retry in 32s (see the Retry-After header).",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}Create a webhook endpoint
Registers an HTTPS endpoint for the events you list. The response is
the only place, together with rotate-secret, where the
signing_secret is returned in the clear: store it now. Up to 25
endpoints per account; the first 5 are included in every plan and
each event delivered to an additional endpoint costs credits, which
you accept with accept_per_event_billing: true. URLs must be unique
per account and cannot point to localhost, an IP literal or a
private network.
curl --request POST \
--url https://api.ryvo.so/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://crm.acme.example/hooks/ryvo",
"events": [
"conversation.ended",
"analysis.ready"
],
"accept_per_event_billing": true
}
'import requests
url = "https://api.ryvo.so/v1/webhooks"
payload = {
"url": "https://crm.acme.example/hooks/ryvo",
"events": ["conversation.ended", "analysis.ready"],
"accept_per_event_billing": 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({
url: 'https://crm.acme.example/hooks/ryvo',
events: ['conversation.ended', 'analysis.ready'],
accept_per_event_billing: true
})
};
fetch('https://api.ryvo.so/v1/webhooks', 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.ryvo.so/v1/webhooks",
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([
'url' => 'https://crm.acme.example/hooks/ryvo',
'events' => [
'conversation.ended',
'analysis.ready'
],
'accept_per_event_billing' => 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.ryvo.so/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\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.ryvo.so/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ryvo.so/v1/webhooks")
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 \"url\": \"https://crm.acme.example/hooks/ryvo\",\n \"events\": [\n \"conversation.ended\",\n \"analysis.ready\"\n ],\n \"accept_per_event_billing\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "7f8e9d0c-1b2a-4c3d-8e4f-5a6b7c8d9e0f",
"url": "https://crm.acme.example/hooks/ryvo",
"events": [
"conversation.ended",
"analysis.ready"
],
"is_active": true,
"consecutive_failures": 0,
"auto_disabled_at": "2023-11-07T05:31:56Z",
"auto_disabled_reason": "<string>",
"previous_secret_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"signing_secret": "whsec_3f1c9a7e5b2d8f0a1c4e6b8d0f2a4c6e8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a"
}{
"error": "invalid_query",
"message": "limit must be an integer between 1 and 100.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "unauthorized",
"message": "Invalid or revoked API key.",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Retry in 32s (see the Retry-After header).",
"request_id": "f0c0a9d2-8b1e-4d8a-9c2f-6e5b7a1d2c3b"
}Authorizations
A Bearer token. Create keys in the portal under Settings > API keys
(https://app.ryvo.so/developers). The token has the form
ryvo_live_<64 hex characters> and is shown once.
Header: Authorization: Bearer ryvo_live_...
Body
Must be https and public. Unique per account.
500"https://crm.acme.example/hooks/ryvo"
1conversation.started, conversation.ended, analysis.ready, call.initiated, call.completed, call.failed ["conversation.ended", "analysis.ready"]
Required from the sixth endpoint on, to accept the per-event charge.
Response
The endpoint, with its signing secret.
"7f8e9d0c-1b2a-4c3d-8e4f-5a6b7c8d9e0f"
"https://crm.acme.example/hooks/ryvo"
conversation.started, conversation.ended, analysis.ready, call.initiated, call.completed, call.failed ["conversation.ended", "analysis.ready"]
0
Set when Ryvo switched the endpoint off after repeated exhausted deliveries.
After a rotation, until when the previous secret still signs.
Returned only here and by rotate-secret. Store it.
"whsec_3f1c9a7e5b2d8f0a1c4e6b8d0f2a4c6e8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a"

