# Update a webhook endpoint

> Update a webhook endpoint. PATCH /v1/webhooks/{id} in the Raylight API.

### PATCH /v1/webhooks/{id}

**Update a webhook endpoint**

Auth: `Authorization: Bearer rl_live_...` with the `productions` scope.

Parameters:

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | uuid | yes | The endpoint id. |

Request body (application/json):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | url | no |  |
| `description` | string \| null | no |  |
| `events` | enum[] | no |  |
| `enabled` | boolean | no |  |

Responses:

| Status | Meaning |
| --- | --- |
| 200 | The updated endpoint. |
| 400 | Invalid request. |
| 401 | Missing, invalid or revoked key. |
| 403 | The key lacks the `productions` scope (code `api_key_missing_scope`), or its owner has view-only access to the workspace (code `forbidden`). |
| 404 | No such endpoint or workspace for this key (code `not_found`). |
| 429 | Rate limited, or a monthly cap reached. |
| 503 | Webhooks are not switched on for this server (code `disabled`). Every webhook route answers this while they are off. |

Response body (200):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoint` | object | yes |  |
| `endpoint.id` | uuid | yes |  |
| `endpoint.workspaceId` | uuid | yes |  |
| `endpoint.url` | url | yes |  |
| `endpoint.description` | string \| null | yes |  |
| `endpoint.events` | enum[] | yes |  |
| `endpoint.enabled` | boolean | yes |  |
| `endpoint.disabledReason` | string \| null | yes |  |
| `endpoint.consecutiveFailures` | integer | yes |  |
| `endpoint.lastAttemptAt` | datetime \| null | yes |  |
| `endpoint.lastSuccessAt` | datetime \| null | yes |  |
| `endpoint.previousSecretExpiresAt` | datetime \| null | yes |  |
| `endpoint.createdAt` | datetime | yes |  |
| `endpoint.updatedAt` | datetime | yes |  |

Example (curl):

```bash
curl -X PATCH https://api.raylight.app/v1/webhooks/$ID \
  -H "Authorization: Bearer $RAYLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": true }'
```

## More

- Previous: [Read a webhook endpoint](https://www.raylight.app/docs/reference/get-v1-webhooks-id.md)
- Next: [Delete a webhook endpoint](https://www.raylight.app/docs/reference/delete-v1-webhooks-id.md)
- All docs: https://www.raylight.app/llms.txt
- Everything in one file: https://www.raylight.app/llms-full.txt
- OpenAPI: https://api.raylight.app/v1/openapi.json
