API Documentation

REST API for notifications via Telegram and Max. Subscribers, OTP, broadcasts, forms, helpdesk.

Testing your integration

Before going live, test your integration. Zapnoty provides several tools: test keys, message preview and broadcast dry-run.

Test keys zn_test_

A project has two keys: live zn_live_ and test zn_test_. Requests with the test key go through the full API logic — for debugging, keep test subscribers (your own Telegram/Max) in the project and send only to them.

Message preview

POST /v1/send/preview renders the message (template, variables, signature) and returns the final text without sending. Useful to verify how vars are substituted and which format applies.

POST /v1/send/preview
{
"subscriber_id": "550e8400-...",
"template": "welcome",
"vars": { "name": "Anna" }
}
→ {
"rendered_text": "Hello, Anna!",
"format": null,
"text_length": 12,
"has_media": false,
"buttons_count": 0,
"entities_count": 0,
"template_key": "welcome"
}

Broadcast dry-run

The dry_run: true parameter in /v1/broadcast does not create a broadcast — it returns the audience size under the filters, an estimated credit charge and a sample rendered message. Use it to verify filters (tags, permissions) before a real send.

POST /v1/broadcast
{
"text": "...",
"tags_all": ["vip"],
"dry_run": true
}
→ { "would_send_to": 342, "estimated_credits": 342, "rendered_sample": "..." }

Testing webhooks

To test event delivery, temporarily point a webhook endpoint at a test receiver URL (webhook.site, ngrok on localhost). The X-Zapnoty-Signature is computed the same way — verify your HMAC validation. The webhook delivery log is available in the dashboard.

Related sections