SDK reference · Node SDK
prov.webhooks.delete
prov.webhooks.delete in Node SDK.
Signature
prov.webhooks.delete(id: string): Promise<{ deleted: boolean; endpointId: string }>Parameters
idstringRequired
Request fields
idstringpathRequired- The object's ID.
Returns
Promise<{ deleted: boolean; endpointId: string }> The deleted object.
HTTP operation
DELETE /v1/webhook_endpoints/{id}: Delete a webhook endpoint
Errors
Example
const step1 = 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"
]
}),
})).json();
const endpointId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/webhook_endpoints/${endpointId}`, {
method: "DELETE",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = 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"
]
}).json()
endpoint_id = step1["id"]
data = httpx.delete(f"{api}/v1/webhook_endpoints/{endpoint_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()