Create Webhook
curl --request POST \
--url https://api.prod.usesimple.ai/api/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"event_types": [],
"description": "<string>",
"disabled": false,
"rate_limit": 123
}
'import requests
url = "https://api.prod.usesimple.ai/api/v1/webhooks"
payload = {
"url": "<string>",
"event_types": [],
"description": "<string>",
"disabled": False,
"rate_limit": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
event_types: [],
description: '<string>',
disabled: false,
rate_limit: 123
})
};
fetch('https://api.prod.usesimple.ai/api/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.prod.usesimple.ai/api/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' => '<string>',
'event_types' => [
],
'description' => '<string>',
'disabled' => false,
'rate_limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.prod.usesimple.ai/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.prod.usesimple.ai/api/v1/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.usesimple.ai/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"endpoint_id": "<string>",
"url": "<string>",
"event_types": [],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabled": true
}{
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Webhooks
Create Webhook
Create a new webhook endpoint for receiving event notifications. Requires a valid API key.
POST
/
webhooks
Create Webhook
curl --request POST \
--url https://api.prod.usesimple.ai/api/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"event_types": [],
"description": "<string>",
"disabled": false,
"rate_limit": 123
}
'import requests
url = "https://api.prod.usesimple.ai/api/v1/webhooks"
payload = {
"url": "<string>",
"event_types": [],
"description": "<string>",
"disabled": False,
"rate_limit": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
event_types: [],
description: '<string>',
disabled: false,
rate_limit: 123
})
};
fetch('https://api.prod.usesimple.ai/api/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.prod.usesimple.ai/api/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' => '<string>',
'event_types' => [
],
'description' => '<string>',
'disabled' => false,
'rate_limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.prod.usesimple.ai/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.prod.usesimple.ai/api/v1/webhooks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prod.usesimple.ai/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"event_types\": [],\n \"description\": \"<string>\",\n \"disabled\": false,\n \"rate_limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"endpoint_id": "<string>",
"url": "<string>",
"event_types": [],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabled": true
}{
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
The URL where webhook events will be sent
The types of events to subscribe to. If not specified, all event types will be included.
Available options:
call.started, call.completed, transcript.updated Optional description for the webhook endpoint
Whether the webhook is initially disabled
Optional rate limit for the webhook (requests per minute)
Response
Webhook Created Successfully
Unique identifier for the webhook endpoint
The URL where webhook events will be sent
The types of events the webhook is subscribed to
Available options:
call.started, call.completed, transcript.updated When the webhook endpoint was created
Description of the webhook endpoint
Whether the webhook is disabled
Was this page helpful?
⌘I