auth_mode qrcode providers: QR Auth for Messaging Accounts
Learn how auth_mode qrcode providers work in messaging APIs: account creation, QR start and check polling, webhook-first setup, signature verification, and provider differences.
auth_mode qrcode providers: How QR Authentication Works for Messaging Accounts
When you connect a messaging channel through an API, the hardest part is often not sending a message but proving that you control the account. auth_mode: "qrcode" is the setting that tells a messaging platform to authenticate an account by having its owner scan a QR code, usually from the provider's own mobile app. This article explains how QR-based providers behave, what the setup sequence looks like, where implementations differ, and how to build a reliable receiver around the resulting events.
What auth_mode qrcode means
In a messaging API, an account represents one connected channel login. The auth_mode field declares how that login is authorized. Common values include QR code, verification code, session import, and Passkey. When auth_mode is qrcode, the platform generates QR material, the account owner scans it in the provider's app, and the platform records the authorization result.
This is a connection flow, not an end-user login flow. It authorizes a messaging account so the platform can send and receive messages on its behalf. It is distinct from OAuth or OpenID Connect app-login flows, which grant scoped access to a user's profile or data. If your goal is to receive direct messages from an existing inbox, QR authorization is usually the relevant path; if your goal is to use a provider's official business APIs, you likely need that provider's own app registration and review process instead.
Which providers use QR authentication
QR-based authorization is common on channels where the primary client is a mobile app and the account is tied to a phone or device session. In a unified messaging platform such as UnifyPort, TikTok, WhatsApp, and similar consumer-first channels use the standard QR account flow, while other channels may use verification codes, session material, or Passkey. The exact mix depends on the provider and can change, so always confirm against the provider guide for the channel you are connecting.
A useful distinction is between official business APIs and QR-authenticated inbox connections. Official business APIs are built around a business account, app review, and platform-native features. A QR-authenticated inbox connects an account that already receives customer messages and routes its inbound events into your own system. The two can coexist, but they are different integration surfaces with different access requirements.
The standard QR authorization sequence
Most QR flows follow the same five steps. The names below match the UnifyPort account API, but the pattern is broadly similar across platforms.
- Create the account with
providerset to the channel andauth_modeset to"qrcode". Keep the returned account ID. - Start QR authorization with
POST /v1/accounts/{account_id}/auth/qr/start. - Poll for QR state with
POST /v1/accounts/{account_id}/auth/qr/checkorGET /v1/accounts/{account_id}/authuntil QR material, success, or failure is reported. - Show the QR code to the account owner, who scans and approves it in the provider app.
- Confirm authorization by watching for auth and runtime events, then send a test message and verify an inbound event arrives.
Why polling is part of the design
Some providers return QR material immediately in the start response. Others do not. TikTok is a documented example: the initial start response may not contain a QR URL, so the check step is not an error handler but a required part of the flow. Build your UI to treat polling as normal, with a clear pending state, a timeout, and a retry path. Do not assume the first response contains something scannable.
Create the webhook before the QR screen
The safer order is to register your webhook endpoint before you start authorization. Authorization progress and later inbound messages are both delivered as events, so an endpoint that exists first gives you a durable record from the beginning. A typical account creation request looks like this:
{
"name": "TikTok Support Inbox",
"provider": "tiktok",
"region": "global",
"status": "active",
"auth_mode": "qrcode",
"capabilities": ["receive_message"],
"metadata": { "workflow": "support-intake" }
}
Then start the QR flow with an empty body and poll the check endpoint until the response carries renderable QR material or a terminal state.
Handling QR events and inbound messages safely
Once the account is authorized, inbound messages arrive as signed webhook deliveries. Two practices matter more than any other:
- Verify the signature before parsing. UnifyPort deliveries include
X-Device-TimestampandX-Device-Signature; the signature is an HMAC-SHA256 over the timestamp, a dot, and the raw request body. Verify against the raw body, not a re-serialized JSON object. - Store first, route second. Persist the event, then run classification, CRM enrichment, or human assignment. Return a 2xx only after the event is durably accepted.
A normalized message.received event carries a consistent envelope: id, type, provider, account_id, occurred_at, and data with conversation, sender, and message details. That consistency is the main payoff of a unified API: the same handler can process TikTok, WhatsApp, LINE, Zalo, Telegram, and X events without per-channel parsing. For a deeper look at how this fits into a support stack, see the guide on using UnifyPort with Chatwoot.
Comparing QR auth with other auth modes
| Auth mode | How it works | Best fit | Main trade-off |
|---|---|---|---|
| QR code | Account owner scans a code in the provider app | Consumer messaging channels tied to a mobile session | Requires a human with the device; QR material may need polling |
| Verification code | A code is sent to the account owner and entered in your UI | Channels that support code-based login | Depends on code delivery and expiry handling |
| Session import | Existing session material is supplied to the platform | Migrating an already-authorized session | Session material is sensitive and expires |
| Passkey | WebAuthn credential authorizes the account | Platforms that support passwordless auth | Requires compatible authenticators and enrollment |
Choose QR authorization when the account already exists in the provider app and a human can complete a scan once. Choose an official business API when you need platform-native business features, campaign attribution, or program-level guarantees. For a broader comparison of messaging platforms and their channel coverage, see UnifyPort vs Linq vs Sinch.
Operational pitfalls to plan for
- Re-authentication. Sessions expire or get revoked. Design a UI state for expired authorization and a path to restart the QR flow.
- At-least-once delivery. Webhooks can be retried. Use the event ID as an idempotency key so duplicate deliveries do not create duplicate tickets.
- Sensitive material. Treat QR payloads, session data, and signing secrets as secrets. Do not log them or paste production account IDs into shared channels.
- Provider variance. Support and availability can differ by account and region. Surface auth failures clearly rather than silently retrying.
- Scope confusion. Do not confuse a messaging-account QR flow with a provider's official app-login QR flow. They authorize different things.
Related reading
- UnifyPort vs 8x8 Developer Portal: Messaging API Comparison - Compare UnifyPort's unified messaging API with the 8x8 Developer Portal's CPaaS and XCaaS tools. See channel coverage, SDKs, and best-fit use cases.
Sources and further reading
- TikTok Business Messaging API or QR-Authenticated Inbox? A DM Decision Guide - TikTok now documents Business Messaging API capabilities for direct messages, but that path is different from connecting an existing TikTok inbox to a signed multi-platform webhook. Use this guide to choose the right route.
- Connect a TikTok Account to a Signed Webhook With QR Authorization - Set up TikTok inbound through UnifyPort: register a signed webhook first, create a TikTok account with QR authorization, poll for the QR state, and receive normalized message.received events.
- GitHub - eugenioenko/autentico: Autentico is a self-hosted OAuth2 / OIDC Identity Provider built with Go. It handles the full authentication lifecycle; login, MFA, passkeys, session management, token issuance, and administration. All in a single binary backed by SQLite. - Autentico is a self-hosted OAuth2 / OIDC Identity Provider built with Go. It handles the full authentication lifecycle; login, MFA, passkeys, session management, token issuance, and administration...
FAQ
What does auth_mode qrcode mean in a messaging API?
It declares that an account is authorized by having its owner scan a QR code, typically in the provider's mobile app. The platform generates QR material and records the authorization result.
Which providers use QR authentication?
QR authorization is common on consumer-first channels such as TikTok and WhatsApp. Other channels may use verification codes, session material, or Passkey. Check the provider guide for the channel you are connecting.
Why does the QR start response sometimes not include a QR URL?
Some providers return QR material asynchronously. The TikTok provider guide notes that the initial start response may not contain a QR URL, so you must poll the QR check endpoint until material or a terminal state appears.
Do I need a developer app for a QR-authenticated connection?
Not for the QR account flow itself. The connection uses the platform's account and QR authorization endpoints. If you need a provider's official app-login scopes or business APIs, that is a separate integration path.
How should I verify QR webhook deliveries?
Verify the HMAC-SHA256 signature over the timestamp and raw request body using your endpoint signing secret, then store the event before routing it. Return a 2xx only after durable acceptance.
Conclusion
auth_mode: "qrcode" is a small field with a large operational footprint. Treat QR authorization as a state machine with polling, timeouts, and re-authentication, register your webhook before you show the QR screen, and verify every delivery against the raw body. If you are connecting several channels, a unified event contract keeps the QR-specific details at the edge and lets your routing logic stay consistent across providers. For teams weighing platform options, the top CPaaS products comparison and the AI customer experience platform review offer useful decision context.
