Use this method to get current webhook status

POST /getWebhookInfo

Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result object Required

      Contains information about the current status of a webhook.

      Hide result attributes Show result attributes object
      • url string Required

        Webhook URL, may be empty if webhook is not set up

      • has_custom_certificate boolean Required

        True, if a custom certificate was provided for webhook certificate checks

      • pending_update_count integer Required

        Number of updates awaiting delivery

      • ip_address string

        Optional. Currently used webhook IP address

      • last_error_date integer

        Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook

      • last_error_message string

        Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook

      • max_connections integer

        Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery

      • allowed_updates array[string]

        Optional. A list of update types the bot is subscribed to. Defaults to all update types

POST /getWebhookInfo
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getWebhookInfo
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "url": "string",
    "has_custom_certificate": true,
    "pending_update_count": 42,
    "ip_address": "string",
    "last_error_date": 42,
    "last_error_message": "string",
    "max_connections": 42,
    "allowed_updates": [
      "string"
    ]
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "url": "string",
    "has_custom_certificate": true,
    "pending_update_count": 42,
    "ip_address": "string",
    "last_error_date": 42,
    "last_error_message": "string",
    "max_connections": 42,
    "allowed_updates": [
      "string"
    ]
  }
}