curl --request POST \
--url https://scribe-api.telepatia.ai/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"scribe_session.created",
"scribe_session.completed",
"scribe_session.error"
],
"name": "Scribe prod webhook",
"url": "https://example.com/webhooks/scribe"
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/webhooks"
payload = {
"events": ["scribe_session.created", "scribe_session.completed", "scribe_session.error"],
"name": "Scribe prod webhook",
"url": "https://example.com/webhooks/scribe"
}
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({
events: ['scribe_session.created', 'scribe_session.completed', 'scribe_session.error'],
name: 'Scribe prod webhook',
url: 'https://example.com/webhooks/scribe'
})
};
fetch('https://scribe-api.telepatia.ai/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://scribe-api.telepatia.ai/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([
'events' => [
'scribe_session.created',
'scribe_session.completed',
'scribe_session.error'
],
'name' => 'Scribe prod webhook',
'url' => 'https://example.com/webhooks/scribe'
]),
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"
payload := strings.NewReader("{\n \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\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://scribe-api.telepatia.ai/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/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 \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"scribe_session.created"
],
"isActive": true,
"signingSecret": "<string>",
"name": "<string>",
"event": "scribe_session.created",
"signingSecretPrefix": "<string>",
"signingSecretVersion": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}Crear una suscripción de webhook
Registra un webhook para recibir notificaciones de eventos. La respuesta incluye el signingSecret (se muestra una sola vez), que se usa para verificar el encabezado X-Scribe-Api-Signature.
curl --request POST \
--url https://scribe-api.telepatia.ai/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"scribe_session.created",
"scribe_session.completed",
"scribe_session.error"
],
"name": "Scribe prod webhook",
"url": "https://example.com/webhooks/scribe"
}
'import requests
url = "https://scribe-api.telepatia.ai/v1/webhooks"
payload = {
"events": ["scribe_session.created", "scribe_session.completed", "scribe_session.error"],
"name": "Scribe prod webhook",
"url": "https://example.com/webhooks/scribe"
}
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({
events: ['scribe_session.created', 'scribe_session.completed', 'scribe_session.error'],
name: 'Scribe prod webhook',
url: 'https://example.com/webhooks/scribe'
})
};
fetch('https://scribe-api.telepatia.ai/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://scribe-api.telepatia.ai/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([
'events' => [
'scribe_session.created',
'scribe_session.completed',
'scribe_session.error'
],
'name' => 'Scribe prod webhook',
'url' => 'https://example.com/webhooks/scribe'
]),
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"
payload := strings.NewReader("{\n \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\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://scribe-api.telepatia.ai/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe-api.telepatia.ai/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 \"events\": [\n \"scribe_session.created\",\n \"scribe_session.completed\",\n \"scribe_session.error\"\n ],\n \"name\": \"Scribe prod webhook\",\n \"url\": \"https://example.com/webhooks/scribe\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"scribe_session.created"
],
"isActive": true,
"signingSecret": "<string>",
"name": "<string>",
"event": "scribe_session.created",
"signingSecretPrefix": "<string>",
"signingSecretVersion": 123,
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}Cuerpo
Tipos de evento a los que suscribirse (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, se guarda como una lista events 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
Respuesta de creación: lleva el secreto de firma en texto plano, que se muestra una sola vez.
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