Webhook Endpoints API
Written by hand because these routes are not in
openapi.yamlyet. Concepts are on Webhooks, the event list and signature code on Webhook events and signatures.
All routes use the same Bearer key. Endpoints and events belong to the project and the mode of the key.
| Call | What it does |
|---|---|
GET /api/v1/webhooks |
List endpoints. |
POST /api/v1/webhooks |
Create {url, events, description?, enabled?}. events is ["*"] or a list of types. Answers 201 with the secret, shown once. Up to 20 for each project and mode. |
GET /api/v1/webhooks/{id} |
Read one. |
PATCH /api/v1/webhooks/{id} |
Change url, events, description or enabled. |
DELETE /api/v1/webhooks/{id} |
Delete. |
POST /api/v1/webhooks/{id}/test |
Send a webhook.test now. Answers with the delivery. No retries. |
POST /api/v1/webhooks/{id}/roll-secret |
New secret, returned once. The old one stops working at once. |
GET /api/v1/webhooks/{id}/deliveries |
The attempt log. Filter with ?state=pending, delivered or failed. |
GET /api/v1/events |
Events, newest first. Filter with ?type=. |
GET /api/v1/events/{id} |
One event. |
POST /api/v1/events/{id}/redeliver |
Queue a fresh delivery. Body {endpoint?} (202). |
Lists use limit and starting_after like the rest of the API. An address that is not public https answers 400 bad_callback_url.
Create an endpoint#
curl "https://meet.respiresoft.com/api/v1/webhooks" \
-H "Authorization: Bearer $MEET_API_KEY" -H "Content-Type: application/json" \
-d '{"url": "https://app.acme.com/meet-webhook", "events": ["session.ended", "recording.ready"], "description": "Acme backend"}'import { Meet } from "@respiresoft/meet";
const meet = new Meet({ apiKey: process.env.MEET_API_KEY });
const endpoint = await meet.webhooks.create({
url: "https://app.acme.com/meet-webhook",
events: ["session.ended", "recording.ready"],
});
console.log(endpoint.id, endpoint.secret); // store the secret nowSend a test and read the attempts#
curl -X POST "https://meet.respiresoft.com/api/v1/webhooks/$ENDPOINT_ID/test" -H "Authorization: Bearer $MEET_API_KEY"
curl "https://meet.respiresoft.com/api/v1/webhooks/$ENDPOINT_ID/deliveries?state=failed" -H "Authorization: Bearer $MEET_API_KEY"await meet.webhooks.test(endpoint.id);
for await (const d of meet.webhooks.deliveries(endpoint.id, { state: "failed" })) console.log(d);Roll the secret and redeliver#
const rolled = await meet.webhooks.rollSecret(endpoint.id); // rolled.secret is the new one
await meet.webhooks.redeliver("<event id>", endpoint.id); // endpoint is optional