SDK reference · Node SDK
prov.webhooks.create
prov.webhooks.create in Node SDK. Create an endpoint; the response includes the one-time secret.
Signature
prov.webhooks.create(params: CreateWebhookParams): Promise<WebhookEndpoint>Parameters
paramsCreateWebhookParamsRequired
Request fields
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
urlstringRequired- A URL.
event_typesarray of strings- The event types, or
*for all. api_versionstring- The API version deliveries are rendered at, such as
2026-11-30. Defaults to the version this request uses.
Returns
Promise<WebhookEndpoint> The endpoint, with its secret. The secret is shown only once.
HTTP operation
POST /v1/webhook_endpoints: Create a webhook endpoint
Errors
- authentication_required
- invalid_json
- parameter_invalid
- parameter_missing
- rate_limit_exceeded
- usage_limit_reached
Example
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/webhook_endpoints`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"url": "http://localhost:4242/webhooks",
"event_types": [
"mandate.approval.approved",
"mandate.assessment.denied"
]
}),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/webhook_endpoints", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"url": "http://localhost:4242/webhooks",
"event_types": [
"mandate.approval.approved",
"mandate.assessment.denied"
]
}).json()