Webhook settings
Update the webhook
PATCH /v1/webhook changes the URL, networks, status, notify mode, or tokens mode.
Overview
PATCH/v1/webhook
Changes one or more settings. Send only the fields you want to change.
Body
| Field | Required | Description |
|---|---|---|
| url | No | New HTTPS URL, up to 2048 characters. Clears the verified state, so send a test afterwards. |
| status | No | active or paused. |
| enabledChainIds | No | Full list of networks to listen on. Replaces the current list. Each must be on your plan and switched on for the project. |
| notify | No | both, confirmed, or unconfirmed. |
| tokens | No | all or verified. |
| name | No | Display name, 1 to 80 characters. |
| description | No | Notes for your team, up to 200 characters. |
Request
Request
curl -sS -X PATCH "https://webhooks.gray3.io/v1/webhook" \
-H "X-Gray-Project-Id: proj_your_project_id" \
-H "Authorization: Bearer gray_whk_your_webhook_key" \
-H "Content-Type: application/json" \
-d '{
"enabledChainIds": ["ethereum", "base", "arbitrum", "polygon"],
"notify": "confirmed",
"tokens": "verified"
}'Response
Returns the updated webhook, in the same shape as Get the webhook.
Pausing
Set status to paused to stop all messages. Messages that were already waiting to be sent or retried are held, and are sent right away when you set it back to active. Pausing does not use up their retry attempts.
Events that happen while the webhook is paused are not recorded or sent later. For short outages on your side, leave the webhook active and let retries cover the gap.
Errors
Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.
| Code | HTTP | When |
|---|---|---|
| invalid_argument | 400 | Empty body, unknown value, or a URL that is not public HTTPS |
| plan_feature_denied | 403 | A network in enabledChainIds is not available for webhooks on this project |
| not_found | 404 | The project has no webhook |
json
{
"error": {
"code": "invalid_argument",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}