Skip to content

Public API v2

Available from the Plus plan

Public API v2 is available to users on the Plus and Pro plans.

Public API v2 provides programmatic access to Hotline's core features for integration with CRM systems, internal services, analytics, and automation tools.

Up-to-date interactive documentation, the complete set of methods, data models, and request examples are available in the Hotline API Scalar interface.

The Scalar interface lets you:

  • browse current methods and request and response models
  • authorize with Instance-Id and Instance-Token
  • run test requests from your browser
  • view request examples for Shell, Python, and Node.js

Use a test instance to verify methods, and do not run modifying or bulk operations on a production instance without checking the parameters first.

Open Hotline API v2

Core capabilities

API methods are grouped by Hotline's main objects and workflows:

  • Instance — retrieve instance and related Telegram profile information; start, stop, and restart an instance
  • Dialog — search and retrieve dialogs, create new dialogs, and change their status
  • Message — send messages to dialogs and the backend group, and retrieve message information
  • Say — create, view, rename, and delete quick replies, and send quick replies to dialogs
  • Mark — manage marks, their parameters, and dialog assignments
  • Sending — manage templates, sendings, recipients, sending lifecycle, and reports
  • Export — start data exports, check their status, and download completed reports

The method set is continuously evolving. When designing an integration, always refer to the current API documentation.

Address and authorization

Public API v2 base address:

https://api.production.hotline.tg/api/v2/

All API requests use HTTP Basic:

HTTP Basic field Hotline instance data
Username Instance-Id
Password Instance-Token

Open the required instance in the setup bot @hotlinetg_bot. In its details:

  • Instance ID is used as Instance-Id
  • API key is used as Instance-Token

Example request for instance information:

curl --user "$INSTANCE_ID:$INSTANCE_TOKEN" \
  https://api.production.hotline.tg/api/v2/instance

Keep Instance-Token secret

Do not publish Instance-Token in code, logs, or public repositories. Store it in environment variables or a secret store.

After resetting the API key in the setup bot, the previous token stops working. Update the credentials in all integrations for that instance.