Skip to main content
DELETE
/
api
/
public
/
v1
/
webhooks
/
{webhookId}
curl -sS -X DELETE https://app.opentrain.ai/api/public/v1/webhooks/<WEBHOOK_ID> \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "webhook": {
    "id": "<WEBHOOK_ID>",
    "url": "https://example.com/hooks/opentrain",
    "eventTypes": ["proposal.received", "message.received", "approval.confirmed"],
    "status": "ACTIVE",
    "createdAt": "2026-06-12T10:00:00.000Z",
    "disabledAt": null,
    "disabledReason": null
  },
  "deleted": true
}
Deletes a webhook subscription. Deliveries stop immediately and the subscription’s delivery history is removed with it. Deletion is permanent — there is no undo. This is also the recovery path for two situations:
  • Lost secret: secrets are shown only once at creation. Delete the subscription and create a new one to get a fresh whsec_… secret (this is also how you rotate a secret).
  • Auto-disabled subscription: a DISABLED webhook cannot be re-enabled. Delete it, fix your endpoint, and create a replacement — then catch up on events missed while disabled with GET /updates, since new subscriptions have no backfill.
Requirements: webhooks:manage scope + the public_api_webhooks feature.

Request

webhookId
string
required
The webhook subscription ID.

Response

webhook
object
The subscription as it existed at deletion: {id, url, eventTypes, status, createdAt, disabledAt, disabledReason} — same shape as GET /webhooks/{id}.
deleted
boolean
Always true on success.

Errors

StatuscodeMeaning
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing webhooks:manage scope, or public_api_webhooks disabled
404NOT_FOUNDNo such webhook, or it belongs to another account (details: {resource: "webhooks", webhookId})
curl -sS -X DELETE https://app.opentrain.ai/api/public/v1/webhooks/<WEBHOOK_ID> \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "webhook": {
    "id": "<WEBHOOK_ID>",
    "url": "https://example.com/hooks/opentrain",
    "eventTypes": ["proposal.received", "message.received", "approval.confirmed"],
    "status": "ACTIVE",
    "createdAt": "2026-06-12T10:00:00.000Z",
    "disabledAt": null,
    "disabledReason": null
  },
  "deleted": true
}