---
name: rasel-api-integration
description: Integrate Rasel public messaging, OTP and inbound WhatsApp Web events in an existing server application. Use when a developer asks for Rasel authentication, sender discovery, conversation context, send requests, webhook handling or offline integration tests.
---

1. Identify the channel and task. Read https://raselsms.com/llms.txt and follow the specific Markdown guide. Use https://raselsms.com/api-docs/openapi.json to check the operation, version, security and request fields. Keep the full reference for unresolved questions.
2. Follow the project's existing server architecture. Store RASEL_API_KEY in the server environment or secret manager. Never put credentials in URLs, client bundles, pasted prompts, fixtures or logs.
3. Start with the account read operation for an explicitly authorised connectivity check. Choose permitted senders, official templates, bot subscribers and WhatsApp Web chats from the account's documented discovery operations. Use the returned context and identifiers. Check channel and template eligibility before generating a send.
4. Use the documented operation for the task. OTP verification uses the verification lifecycle. An accepted bulk job requires status polling. Use an idempotency key where the operation supports or requires it, retain it with the original payload for retries, and reconcile ambiguous outcomes before another send.
5. For inbound WhatsApp Web, implement a customer-owned HTTPS receiver. Read the webhook guide for credential checks, timeout, retries, delivery IDs and payload. Keep the webhook secret separate from the send key.
6. Test against local mocks with synthetic recipients. Cover success, missing/invalid key, invalid payload, replay and failure. Run existing contract tests. Ask before live sends, paid operations, template changes and account configuration. Report verified behaviour and any remaining channel-specific prerequisites.

## Task guides

- [SMS](https://raselsms.com/api-docs/markdown/guides/sms.md)
- [Official WhatsApp](https://raselsms.com/api-docs/markdown/guides/whatsapp-official.md)
- [WhatsApp Web](https://raselsms.com/api-docs/markdown/guides/whatsapp-web.md)
- [Telegram](https://raselsms.com/api-docs/markdown/guides/telegram.md)
- [Email](https://raselsms.com/api-docs/markdown/guides/email.md)
- [OTP](https://raselsms.com/api-docs/markdown/guides/otp.md)
- [Webhook receiver](https://raselsms.com/api-docs/markdown/guides/webhooks.md)
- [Error recovery](https://raselsms.com/api-docs/markdown/guides/errors.md)
