Skip to content

Webhook API reference

A signed POST to your URL for each event it names.

Base URL: https://api.withruntime.com. Authentication, idempotency and errors work the same way for every product.

Its states: active, deleted.

Updated .md

Endpoints#

Method Path Description
POST /v2/webhooks Create a webhook
GET /v2/webhooks List webhooks
DELETE /v2/webhooks/{id} Delete a webhook

Create a webhook#

POST /v2/webhooks

Makes a webhook, returning its signing secret this once.

Its action, for a key's grant: webhooks:create.

Body: a WebhookCreate.

Returns a Webhook.

Examples:

Terminalcurl -X POST "https://api.withruntime.com/v2/webhooks" \  -H "Authorization: Bearer $RUNTIME_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "url": "example" }'
TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.webhooks.create({ url: "example" });
Pythonfrom withruntime import Runtimeruntime = Runtime()  # RUNTIME_API_KEY from the environmentresult = runtime.webhooks.create(url="example")
rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.webhooks.create(url: "example")
Terminalruntime webhooks create --url example

List webhooks#

GET /v2/webhooks

Lists the org's, oldest first.

Its action, for a key's grant: webhooks:list.

Query:

Field Type Required Description
cursor string No Where the page starts: a page's next.
limit integer No The most items the page holds. At least 1. At most 200. Default: 50.

Returns a page: items, each a Webhook, and next, where the next page starts, none on the last.

In v1: GET /v1/webhooks.

Examples:

Terminalcurl -X GET "https://api.withruntime.com/v2/webhooks" \  -H "Authorization: Bearer $RUNTIME_API_KEY"
TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.webhooks.list();
Pythonfrom withruntime import Runtimeruntime = Runtime()  # RUNTIME_API_KEY from the environmentresult = runtime.webhooks.list()
rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.webhooks.list
Terminalruntime webhooks list

Delete a webhook#

DELETE /v2/webhooks/{id}

Deletes it: nothing more is sent to it.

Its action, for a key's grant: webhooks:delete.

Path: id.

Returns a Webhook.

Examples:

Terminalcurl -X DELETE "https://api.withruntime.com/v2/webhooks/WEBHOOK_ID" \  -H "Authorization: Bearer $RUNTIME_API_KEY"
TypeScriptimport { Runtime } from "withruntime";const runtime = new Runtime(); // RUNTIME_API_KEY from the environmentconst result = await runtime.webhooks.delete("WEBHOOK_ID");
Pythonfrom withruntime import Runtimeruntime = Runtime()  # RUNTIME_API_KEY from the environmentresult = runtime.webhooks.delete("WEBHOOK_ID")
rubyrequire "withruntime"kit = Withruntime::Generated::Kit.new # RUNTIME_API_KEY from the environmentresult = kit.webhooks.delete("WEBHOOK_ID")
Terminalruntime webhooks delete WEBHOOK_ID

Objects#

WebhookCreate

A webhook to make.

Field Type Required Description
url string Yes The https URL to send each event to.
events list of string No The events to send it, at most 32; ["*"] (every one) when omitted.

Webhook

A webhook: a signed POST to your URL for each event it names.

Field Type Required Description
id string Yes Its ID.
object one of webhook Yes Always webhook.
url string Yes The https URL each event is sent to; in a list, its origin alone (https://host/…).
events list of string Yes The events it is sent (sandbox.created); * for every one.
state one of active, deleted Yes active while it is sent to; deleted once deleted: a delete's answer.
createdAt string (RFC 3339) Yes When it was made.
secret string No Its signing secret (whsec_...): returned when it is made, and never again.
deletedAt string (RFC 3339) No When it was deleted: a delete's answer, its state deleted.
Try it on your own work.Signing up takes no card. Your first sandbox asks for one, and the trial starts then. Or paste the setup prompt into your agent.
Start your free trial