Skip to content
Docs

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

FieldRequiredDescription
urlNoNew HTTPS URL, up to 2048 characters. Clears the verified state, so send a test afterwards.
statusNoactive or paused.
enabledChainIdsNoFull list of networks to listen on. Replaces the current list. Each must be on your plan and switched on for the project.
notifyNoboth, confirmed, or unconfirmed.
tokensNoall or verified.
nameNoDisplay name, 1 to 80 characters.
descriptionNoNotes 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.

CodeHTTPWhen
invalid_argument400Empty body, unknown value, or a URL that is not public HTTPS
plan_feature_denied403A network in enabledChainIds is not available for webhooks on this project
not_found404The project has no webhook
json
{
  "error": {
    "code": "invalid_argument",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}