Skip to main content
PATCH
/
api
/
partner
/
v1
/
webhook-endpoints
/
{endpointId}
curl -sS -X PATCH https://app.opentrain.ai/api/partner/v1/webhook-endpoints/<ENDPOINT_ID> \
  -H "Authorization: Bearer $OT_PARTNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "ACTIVE"}'
{
  "webhookEndpoint": {
    "id": "<ENDPOINT_ID>",
    "url": "https://your-platform.example.com/webhooks/opentrain",
    "eventTypes": ["contract.started", "contract.ended"],
    "status": "ACTIVE",
    "createdAt": "2026-06-12T10:00:00.000Z",
    "consecutiveFailures": 0,
    "disabledAt": null,
    "disabledReason": null
  }
}
Updates a webhook endpoint. All body fields are optional — send only what you want to change. Setting status to ACTIVE re-enables an auto-disabled endpoint and resets its failure counter. Updating never changes the signing secret, and the secret is never returned. To rotate it, delete the endpoint and create a new one. Requirements: webhooks:manage scope.

Request

endpointId
string
required
The webhook endpoint ID.
url
string
New delivery URL. Must be HTTPS (http is allowed for localhost only).
eventTypes
string[]
Replacement list of event types — at least one.
status
string
ACTIVE or DISABLED. ACTIVE re-enables an auto-disabled endpoint and resets consecutiveFailures to 0; DISABLED pauses delivery.

Response

webhookEndpoint
object
The updated endpoint: {id, url, eventTypes, status, createdAt, consecutiveFailures, disabledAt, disabledReason} — same shape as GET /webhook-endpoints/{endpointId}.

Errors

StatuscodeMeaning
400BAD_REQUESTBody not valid JSON, invalid url, empty/unknown eventTypes, or invalid status
401UNAUTHORIZEDMissing, invalid, or revoked token
403FORBIDDENToken lacks webhooks:manage
404NOT_FOUNDNo endpoint with this ID on this install
curl -sS -X PATCH https://app.opentrain.ai/api/partner/v1/webhook-endpoints/<ENDPOINT_ID> \
  -H "Authorization: Bearer $OT_PARTNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "ACTIVE"}'
{
  "webhookEndpoint": {
    "id": "<ENDPOINT_ID>",
    "url": "https://your-platform.example.com/webhooks/opentrain",
    "eventTypes": ["contract.started", "contract.ended"],
    "status": "ACTIVE",
    "createdAt": "2026-06-12T10:00:00.000Z",
    "consecutiveFailures": 0,
    "disabledAt": null,
    "disabledReason": null
  }
}