> ## Documentation Index
> Fetch the complete documentation index at: https://opentrain.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Webhook Endpoint

> Change a webhook endpoint's URL, event types, or status. Setting status to ACTIVE re-enables an auto-disabled endpoint and resets its failure counter.

Updates a [webhook endpoint](/docs/developers/annotation-platforms/webhooks). All body fields are optional — send only what you want to change. Setting `status` to `ACTIVE` re-enables an [auto-disabled](/docs/developers/annotation-platforms/webhooks#auto-disable-and-recovery) endpoint and resets its failure counter.

Updating never changes the signing secret, and the secret is never returned. To rotate it, [delete](/docs/developers/annotation-platforms/api-reference/webhook-endpoints/delete) the endpoint and [create](/docs/developers/annotation-platforms/api-reference/webhook-endpoints/create) a new one.

**Requirements:** `webhooks:manage` scope.

## Request

<ParamField path="endpointId" type="string" required>
  The webhook endpoint ID.
</ParamField>

<ParamField body="url" type="string">
  New delivery URL. Must be HTTPS (`http` is allowed for localhost only).
</ParamField>

<ParamField body="eventTypes" type="string[]">
  Replacement list of [event types](/docs/developers/annotation-platforms/lifecycle-events) — at least one.
</ParamField>

<ParamField body="status" type="string">
  `ACTIVE` or `DISABLED`. `ACTIVE` re-enables an auto-disabled endpoint and resets `consecutiveFailures` to `0`; `DISABLED` pauses delivery.
</ParamField>

## Response

<ResponseField name="webhookEndpoint" type="object">
  The updated endpoint: `{id, url, eventTypes, status, createdAt, consecutiveFailures, disabledAt, disabledReason}` — same shape as [`GET /webhook-endpoints/{endpointId}`](/docs/developers/annotation-platforms/api-reference/webhook-endpoints/get).
</ResponseField>

## Errors

| Status | `code`         | Meaning                                                                             |
| ------ | -------------- | ----------------------------------------------------------------------------------- |
| `400`  | `BAD_REQUEST`  | Body not valid JSON, invalid `url`, empty/unknown `eventTypes`, or invalid `status` |
| `401`  | `UNAUTHORIZED` | Missing, invalid, or revoked token                                                  |
| `403`  | `FORBIDDEN`    | Token lacks `webhooks:manage`                                                       |
| `404`  | `NOT_FOUND`    | No endpoint with this ID on this install                                            |

<RequestExample>
  ```bash curl theme={null}
  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"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "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
    }
  }
  ```
</ResponseExample>
