Authentication via messengers instead of SMS — no per-message costs. Every authenticated user becomes reachable for notifications by phone number through the same bots. The system picks the right messenger automatically; you control the priority.
Send notifications to users who logged in via your app. Use the per-application message_api_token from cabinet settings (header X-Authorization: token …).
Base URL
https://id.antirius.comPOST /api/v1/message/send
Content-Type: application/json
X-Authorization: token YOUR_MESSAGE_API_TOKEN
{
"recipient": "+79001234567",
"message": "Hello from API"
}HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"platform": "telegram",
"message_id": "123456",
"sent_at": "2026-04-17T10:00:00.000Z",
"correlation_id": "683f1a2b3c4d5e6f7a8b9c0d"
}Create auth session
POST /api/v1/auth/session
Content-Type: application/json
Origin: https://yoursite.com
{
"app_id": "YOUR_APP_ID",
"locale": "ru",
"return_url": "https://yoursite.com/callback"
}HTTP/1.1 200 OK
Content-Type: application/json
{
"success": true,
"session_id": "683f1a2b3c4d5e6f7a8b9c0d",
"expires_at": "2026-05-13T11:00:00.000Z",
"app_id": "YOUR_APP_ID",
"redirect_url": "https://yoursite.com/callback",
"display_order": ["telegram", "max", "whatsapp"],
"links": {
"telegram": "https://t.me/YourBot?start=683f1a2b...",
"max": "https://max.me/YourBot?start=683f1a2b...",
"whatsapp": "https://wa.me/1234567890?text=..."
},
"hosted_login_url": "https://id.antirius.com/login/YOUR_APP_ID"
}GET /api/v1/auth/session/{session_id} and GET /api/v1/widget/session/status accept type=status or type=full (default is full if omitted). issue_token=0 is a legacy alias for type=status.
| Field | Description |
|---|---|
| type=status | Returns status, messenger_opened, timestamps. No token, session not consumed. Unlimited polls. |
| type=full | On confirmed: returns token, user, app_id. First successful full response marks the session used (token_consumed on later full polls). |
Check session status only (no JWT)
GET /api/v1/auth/session/SESSION_ID?type=status
GET /api/v1/auth/session/SESSION_ID?type=status&poll=trueHTTP/1.1 200 OK
Content-Type: application/json
// type=status — ожидание в мессенджере
{
"status": "pending",
"poll_type": "status",
"messenger_opened": false,
"created_at": "2026-05-13T10:55:00.000Z",
"expires_at": "2026-05-13T11:00:00.000Z"
}
// type=status — пользователь открыл deeplink
{
"status": "pending",
"poll_type": "status",
"messenger_opened": true,
"messenger_opened_at": "2026-05-13T10:55:42.000Z"
}
// type=status — подтверждён (без JWT)
{
"status": "confirmed",
"poll_type": "status",
"confirmed_at": "2026-05-13T10:56:30.000Z"
}| Field | Description |
|---|---|
| status | "pending", "confirmed", "expired", or "cancelled" |
| poll_type | "status" |
| messenger_opened | true after the user opened the deeplink in a messenger |
| messenger_opened_at | ISO 8601, when set |
| token_consumed | true if a full request already consumed the session (informational only) |
Check session status (full — issues JWT)
GET /api/v1/auth/session/SESSION_ID?type=full
GET /api/v1/auth/session/SESSION_ID?type=status&poll=trueHTTP/1.1 200 OK
Content-Type: application/json
// type=full — первый запрос после confirmed (выдача JWT)
{
"status": "confirmed",
"poll_type": "full",
"confirmed_at": "2026-05-13T10:56:30.000Z",
"token": "eyJhbGciOiJSUzI1NiIs...",
"user": {
"_id": "507f1f77bcf86cd799439011",
"user_id": "123456789",
"type": "telegram",
"first_name": "John",
"last_name": "Doe",
"username": "johndoe",
"phone": "+79001234567"
},
"app_id": "YOUR_APP_ID",
"expires_at": "2026-05-13T11:55:00.000Z"
}| Field | Description |
|---|---|
| status | "confirmed" |
| token | Signed JWT (RS256) — see the JWT Token section below for payload and verification |
| user | User object (see fields below) |
| app_id | Application ID |
| confirmed_at | Confirmation time (ISO 8601) |
| expires_at | Token expiration time (ISO 8601) |
| Field | Description |
|---|---|
| _id | User ID (24 hex chars) |
| user_id | Messenger user ID |
| type | "telegram", "max" or "whatsapp" |
| first_name | First name (from messenger profile at the time of auth, not stored) |
| last_name | Last name (from messenger profile, may be null) |
| username | Username (from messenger profile, may be null) |
| phone | Phone number (e.g. "+79001234567") |
Use poll=true for long polling (server holds the connection up to 10 seconds). Prefer type=status for repeated polls; use type=full once when you need the JWT.
async function waitForAuth(sessionId) {
while (true) {
const res = await fetch(
`https://id.antirius.com/api/v1/auth/session/${sessionId}?type=status&poll=true`
);
const peek = await res.json();
if (peek.status === 'confirmed') {
const fullRes = await fetch(
`https://id.antirius.com/api/v1/auth/session/${sessionId}?type=full`
);
return fullRes.json(); // { token, user, app_id }
}
if (peek.status === 'expired' || peek.status === 'cancelled') {
throw new Error('Session ' + peek.status);
}
}
}HTTP/1.1 200 OK
Content-Type: application/json
// type=full — первый запрос после confirmed (выдача JWT)
{
"status": "confirmed",
"poll_type": "full",
"confirmed_at": "2026-05-13T10:56:30.000Z",
"token": "eyJhbGciOiJSUzI1NiIs...",
"user": {
"_id": "507f1f77bcf86cd799439011",
"user_id": "123456789",
"type": "telegram",
"first_name": "John",
"last_name": "Doe",
"username": "johndoe",
"phone": "+79001234567"
},
"app_id": "YOUR_APP_ID",
"expires_at": "2026-05-13T11:55:00.000Z"
}