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();

Was this page helpful? Send us feedback

LLM? Read llms.txt.