GET /v1/routines/hooks/{hook_id}
Some providers verify a webhook URL with a GET before they send events: Meta sends `hub.mode`, `hub.verify_token` and `hub.challenge`, Dropbox sends `challenge`. A webhook trigger with `challenge` set answers that request: when the `token_param` query parameter equals the verify token (the `api_key` of the trigger's `token_connection`, read from the vault), or when the trigger sets no token, the value of the `param` query parameter comes back as text/plain with `200`. It starts no run, also while the routine is paused. A missing or wrong token, or a trigger without `challenge`, answers 401 `webhook_signature_invalid`; a challenge value that is not 1-1024 characters of `A-Z a-z 0-9 . _ ~ : + / = -` answers 400; a vault that cannot be reached answers 503. Events still arrive as POSTs to the same URL and are verified with the trigger's `verify` scheme. The hook is looked up first, as for deliveries: an unknown ID answers 404 `hook_not_found`, and every other answer carries `x-b3os-hook-known: 1`.

Path Parameters

hook_id string required path
The hook ID (`hk_…`).
Example: "hk_01m5t3r2qwz23751t0x74bhahz"

Query Parameters

params object optional query
The trigger's `challenge.param` and `challenge.token_param` (for example `hub.challenge` and `hub.verify_token`); other parameters are ignored.
Example: {"hub.mode":"subscribe","hub.verify_token":"7d1f0c2a9b8e4f63a5d2c1b0e9f8a7d6","hub.challenge":"1158201444"}

Responses

200 The challenge value, echoed.
text/plain
string
400 The request failed validation (`invalid_request`, `invalid_url`).
401 Verification failed (`webhook_signature_invalid`).
404 No such hook (`hook_not_found`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
503 The hook exists but the delivery cannot be taken now (`capacity_unavailable`: the node or the routine's organization is at its run or run-data limits; `product_unavailable`: the vault that holds the verify secret is down; `hook_attestation_unverifiable`: an edge replay signed with a key this node does not trust). The edge keeps the delivery and retries after `Retry-After`.
curl -X GET 'https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz', {  method: 'GET',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz', headers=headers)print(response.json())
200 Response
"1158201444"
Ask a question... ⌘I