spicrawlspicrawlDocs
Webhooks

Change a webhook endpoint

Send only the fields to change: `url`, `name`, `events`, `format` or `enabled`.

Requires scope: webhooks

PATCH
/v1/webhooks/{webhookID}

Send only the fields to change: url, name, events, format or enabled. Any other field is a 400. The signing secret does not change here; use rotate-secret.

Setting enabled to true also clears disabled_reason and resets consecutive_failures to 0. An endpoint is disabled automatically after 100 consecutive failed deliveries; re-enable it only once the receiver is fixed.

Authorization

bearerAuth
AuthorizationBearer <token>

Authorization: Bearer <key>. Read the key from the SPICRAWL_API_KEY environment variable; never hard-code or log it. spicrawl_test_… keys can never spend live credits. Scopes: scrape, batch, sessions (granted by default), browser and read (granted deliberately), and partner (only on a partner account's key). A missing scope is 403 ERR::AUTH::INSUFFICIENT_SCOPE naming the scope.

In: header

Path Parameters

webhookID*string

The endpoint id returned by POST /v1/webhooks. An id of another organization answers 404.

Length1 <= length <= 64

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body of PATCH /v1/webhooks/{webhookID}. Send at least one field. Unknown fields are a 400.

Properties1 <= properties

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PATCH "https://example.com/v1/webhooks/string" \  -H "Content-Type: application/json" \  -d '{    "enabled": true  }'
{  "id": "0190f3a2-7c1e-7d4b-9a2f-3b8e5c6d7e80",  "name": "string",  "url": "http://example.com",  "events": [    "batch.completed"  ],  "format": "json",  "enabled": true,  "disabled_reason": "string",  "consecutive_failures": 0,  "last_success_at": "2019-08-24T14:15:22Z",  "last_failure_at": "2019-08-24T14:15:22Z",  "secret_version": 1,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}