Insights · Developer account

setBotWebhook

Set a webhook on behalf of a bot owner

This method authenticates with your developer account. The easiest way to call it is the dashboard, which signs the request for you. Direct calls need a dashboard session cookie.

Owner-scoped version of setWebhook for the dashboard/in-app UI: registers an HTTPS webhook URL for one env (upsert on bot_id,env). Unlike the token method it takes no allowed_updates/max_connections and has no drop_pending_updates option. Setting a URL clears is_disabled and previous error state.

Request

curl https://api.sprintelex.com/setBotWebhook \
  # authenticated with your dashboard session \
  -H "Content-Type: application/json" \
  -d '{"bot_id":"<bot-id>","url":"https://example.com/sprintex-webhook"}'

Parameters

NameTypeRequiredRules
bot_idstringYes-
envstringNo (default 'live')must be 'live' or 'test'
urlstringYessame SSRF gate as setWebhook: valid URL, https-only, no credentials, no private/loopback IP or local hostname, hostname must not DNS-resolve private
secret_tokenstringNooptional; at most 256 characters

Response

{ ok: true, result: true }

Rate limit: none in code

Errors

StatusErrorWhen
400bot_id is requiredmissing bot_id
400env must be 'live' or 'test'env not live/test
404bot not foundno such bot, not owned by caller, or deleted
400url is requiredmissing url
400url is not a valid URL | webhook url must be https | webhook url must not contain credentials | webhook url must not target a private or loopback IP | webhook url must not target a local hostname | webhook host resolves to a private or loopback IPwhichever SSRF check failed (exact string from _shared/webhook.ts)
400secret_token must be at most 256 characterssecret_token longer than 256
500could not save webhookDB upsert failed