curl --request PATCH \
--url https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"scribe_session.completed",
"scribe_session.error"
],
"isActive": true
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}"
payload = {
"events": ["scribe_session.completed", "scribe_session.error"],
"isActive": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: ['scribe_session.completed', 'scribe_session.error'], isActive: true})
};
fetch('https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}', 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://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'scribe_session.completed',
'scribe_session.error'
],
'isActive' => 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://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"scribe_session.created"
],
"isActive": true,
"name": "<string>",
"event": "scribe_session.created",
"signingSecretPrefix": "<string>",
"signingSecretVersion": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}Actualizar una suscripción de webhook
Modifica la url, el tipo de evento o el indicador de actividad de una suscripción de webhook.
curl --request PATCH \
--url https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"scribe_session.completed",
"scribe_session.error"
],
"isActive": true
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}"
payload = {
"events": ["scribe_session.completed", "scribe_session.error"],
"isActive": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({events: ['scribe_session.completed', 'scribe_session.error'], isActive: true})
};
fetch('https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}', 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://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'scribe_session.completed',
'scribe_session.error'
],
'isActive' => 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://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}"
payload := strings.NewReader("{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/v1/webhooks/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"scribe_session.created"
],
"isActive": true,
"name": "<string>",
"event": "scribe_session.created",
"signingSecretPrefix": "<string>",
"signingSecretVersion": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}Cuerpo
Reemplaza los tipos de evento suscritos (al menos uno). Se prefiere sobre event.
Tipos de evento de webhook expuestos a los clientes de la API.
Refleja el enum SynapseWebhookEventType del datalayer (camelCase), pero se presenta a los clientes como strings snake_case separados por puntos (más cerca de la convención de Stripe y más fáciles de buscar en los logs).
scribe_session.created, scribe_session.completed, scribe_session.error, scribe_session.updated, scribe_session.cancelled, scribe_session.deleted, appointment.fulfilled, appointment.cancelled Obsoleto: un solo tipo de evento. Usa events. Si se define y se omite events, reemplaza la suscripción por una lista de un elemento.
scribe_session.created, scribe_session.completed, scribe_session.error, scribe_session.updated, scribe_session.cancelled, scribe_session.deleted, appointment.fulfilled, appointment.cancelled Respuesta
Respuesta exitosa
Una suscripción de webhook.
Tipos de evento de webhook expuestos a los clientes de la API.
Refleja el enum SynapseWebhookEventType del datalayer (camelCase), pero se presenta a los clientes como strings snake_case separados por puntos (más cerca de la convención de Stripe y más fáciles de buscar en los logs).
scribe_session.created, scribe_session.completed, scribe_session.error, scribe_session.updated, scribe_session.cancelled, scribe_session.deleted, appointment.fulfilled, appointment.cancelled Obsoleto: el primer evento suscrito (events[0]). Usa events.
scribe_session.created, scribe_session.completed, scribe_session.error, scribe_session.updated, scribe_session.cancelled, scribe_session.deleted, appointment.fulfilled, appointment.cancelled