Webhook Endpoints
The 12 operations under webhook-endpoints, as typed calls on the generated REST client.
Available from @codespar/sdk 0.12.0; the version on npm is 0.16.18. When these docs build, the examples on this page are compiled against @codespar/sdk 0.16.18, the version this site installs: a call that does not type-check against it fails the build.
Every call below is cs.api reaching one operation of the OpenAPI document this page was generated from; the REST client overview explains request, response, the option bag and the errors. The values are placeholders shaped by the document.
import { } from "@codespar/sdk";
const = new ({ : .. });GET /v1/webhook-endpoints
List triggers
const = await ..("/v1/webhook-endpoints");Parameters, body and every documented response: GET /v1/webhook-endpoints in the HTTP reference.
POST /v1/webhook-endpoints
Subscribe a webhook to an event
const = await ..("/v1/webhook-endpoints", {
: {
: "Example",
: "string",
: "srv_0000000000000000",
: "https://example.com/hook",
: {
: [
{
: "amount_minor",
: "gt",
: 1000
}
]
},
: {
: "webhook"
}
}
});Parameters, body and every documented response: POST /v1/webhook-endpoints in the HTTP reference.
POST /v1/webhook-endpoints/deliveries/{delivery_id}/redeliver
Queue a delivery to be sent again
const = await ..("/v1/webhook-endpoints/deliveries/{delivery_id}/redeliver", {
: {
: "delivery_0000000000000000"
}
});Parameters, body and every documented response: POST /v1/webhook-endpoints/deliveries/{delivery_id}/redeliver in the HTTP reference.
POST /v1/webhook-endpoints/retry-pending
Drain the retry queue for this project
const = await ..("/v1/webhook-endpoints/retry-pending");Parameters, body and every documented response: POST /v1/webhook-endpoints/retry-pending in the HTTP reference.
GET /v1/webhook-endpoints/{id}
Read one webhook endpoint
const = await ..("/v1/webhook-endpoints/{id}", {
: {
: "webhookendpoint_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/webhook-endpoints/{id} in the HTTP reference.
PATCH /v1/webhook-endpoints/{id}
Update a webhook endpoint
const = await ..("/v1/webhook-endpoints/{id}", {
: {
: "webhookendpoint_0000000000000000"
},
: {
: "Example",
: "https://example.com/hook",
: "active",
: {
: [
{
: "amount_minor",
: "gt",
: 1000
}
]
},
: {
: "webhook"
}
}
});Parameters, body and every documented response: PATCH /v1/webhook-endpoints/{id} in the HTTP reference.
DELETE /v1/webhook-endpoints/{id}
Delete a webhook endpoint
const = await ..("/v1/webhook-endpoints/{id}", {
: {
: "webhookendpoint_0000000000000000"
}
});Parameters, body and every documented response: DELETE /v1/webhook-endpoints/{id} in the HTTP reference.
GET /v1/webhook-endpoints/{id}/deliveries
List recent delivery attempts
const = await ..("/v1/webhook-endpoints/{id}/deliveries", {
: {
: "webhookendpoint_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/webhook-endpoints/{id}/deliveries in the HTTP reference.
GET /v1/webhook-endpoints/{id}/deliveries/{delivery_id}
Inspect one delivery attempt
const = await ..("/v1/webhook-endpoints/{id}/deliveries/{delivery_id}", {
: {
: "webhookendpoint_0000000000000000",
: "delivery_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/webhook-endpoints/{id}/deliveries/{delivery_id} in the HTTP reference.
GET /v1/webhook-endpoints/{id}/dlq
List dead lettered deliveries
const = await ..("/v1/webhook-endpoints/{id}/dlq", {
: {
: "webhookendpoint_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/webhook-endpoints/{id}/dlq in the HTTP reference.
POST /v1/webhook-endpoints/{id}/rotate-secret
Mint a new signing secret for a webhook endpoint
const = await ..("/v1/webhook-endpoints/{id}/rotate-secret", {
: {
: "webhookendpoint_0000000000000000"
}
});Parameters, body and every documented response: POST /v1/webhook-endpoints/{id}/rotate-secret in the HTTP reference.
POST /v1/webhook-endpoints/{id}/test-fire
Deliver a synthetic event to a webhook endpoint
const = await ..("/v1/webhook-endpoints/{id}/test-fire", {
: {
: "webhookendpoint_0000000000000000"
},
: {
: "string",
: {}
}
});Parameters, body and every documented response: POST /v1/webhook-endpoints/{id}/test-fire in the HTTP reference.