# ChinqIT Verify (https://docs.sms.chinqit.com/en) Welcome to the ChinqIT Verify documentation. Send SMS messages and OTP codes using the REST API. Prices, comparisons and an overview of the service: [Chinqit Verify, SMS and OTP in Mauritania](https://www.chinqit.com/en/sms-service). Using Cursor, Claude or ChatGPT? See [Build with AI](https://docs.sms.chinqit.com/en/build-with-ai.mdx) for ready-to-copy prompts. Still on API v1? See the [deprecated API section](https://docs.sms.chinqit.com/en/deprecated-v1.mdx). ## Getting Started 1. [Create your account](https://dashboard.sms.chinqit.com/signup?utm_source=docs) in the ChinqIT Verify dashboard. A new account can create an API key right away and send OTPs. Normal messages unlock after your first top-up. 2. Create your API key in the dashboard: open **API keys** and choose **Create API key**. The full key is shown once, so copy it then. 3. Send your first SMS or OTP using the examples in [API Usage](https://docs.sms.chinqit.com/en/api-usage.mdx). 4. Refer to [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx) for full endpoint details. ## First steps A new account sees a short checklist on its dashboard home: 1. Confirm your phone with the 6-digit code we send you. New accounts may get free credit to try OTPs. 2. Create an API key. 3. Send a test OTP from the key's test window. 4. Enter the code you received to verify it. Until your first top-up, you can send OTPs only, and the free credit pays for them. # Connect your AI tool (https://docs.sms.chinqit.com/en/connect-ai-tools) Connect your AI tool once. It then creates your API key and webhook for you, instead of you copying them by hand. The server address is `https://dashboard.sms.chinqit.com/mcp`. Your tool opens a ChinqIT page where you click **Allow**. ## Set up your tool **Claude Code** ```bash claude mcp add --transport http chinqit https://dashboard.sms.chinqit.com/mcp ``` Then run `/mcp` in Claude Code and sign in. **Gemini CLI** ```bash gemini mcp add --transport http chinqit https://dashboard.sms.chinqit.com/mcp ``` Then run `/mcp auth chinqit` and sign in. **Codex CLI** Add this to your Codex `config.toml`: ```toml [mcp_servers.chinqit] url = "https://dashboard.sms.chinqit.com/mcp" ``` Then run: ```bash codex mcp login chinqit ``` **Cursor** [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=chinqit\&config=eyJ1cmwiOiJodHRwczovL2Rhc2hib2FyZC5zbXMuY2hpbnFpdC5jb20vbWNwIn0%3D), or add this to `.cursor/mcp.json`: ```json { "mcpServers": { "chinqit": { "url": "https://dashboard.sms.chinqit.com/mcp", "auth": { "CLIENT_ID": "cursor" } } } } ``` Keep the `auth` line: it logs Cursor in as `cursor`, ChinqIT's client for Cursor. Without it, Cursor's web agents can't log in. **VS Code** [Add to VS Code](vscode\:mcp/install?%7B%22name%22%3A%22chinqit%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fdashboard.sms.chinqit.com%2Fmcp%22%7D), or add this to `.vscode/mcp.json`: ```json { "servers": { "chinqit": { "type": "http", "url": "https://dashboard.sms.chinqit.com/mcp" } } } ``` **Claude (claude.ai)** Go to **Customize**, then **Connectors**. Click **+ Add**, then **Add custom connector**. Enter the name `chinqit` and the address above. **ChatGPT** On the web, open **Plugins** and click the plus button, then **Add custom MCP server**. Enter the name `chinqit`, the address above, and choose **OAuth**. No account yet? [Create one for free](https://dashboard.sms.chinqit.com/signup?utm_source=docs). ## For CI and scripts If you cannot sign in with a browser, create an **AI token** in **Settings**, then **AI tools**. Send it in this header: ```text Authorization: Bearer chq_pat_... ``` For example, with Claude Code: ```bash claude mcp add --transport http chinqit https://dashboard.sms.chinqit.com/mcp \ --header "Authorization: Bearer $CHINQIT_AI_TOKEN" ``` Keep the token in your secret store. Never commit it. AI tokens last 90 days. ## What it can and cannot do It can: * Read your account, usage, API keys, sender IDs, webhooks and recent messages. Phone numbers are masked, and message texts and codes are never shown. * Create API keys and webhooks (owners and admins). * Switch API keys off or on, give them a new secret, rename them, or change their channels (owners and admins). * Send and check a test code to your own phone or email, at the normal price (owners and admins). It cannot: * Top up your balance or move money. * Manage members. * Delete keys. * Use ChinqIT admin tools. It can do what you can do in the dashboard, never more. Members of an organisation connect with read-only access. ## Remove access Go to **Settings**, then **AI tools**, and click **Revoke**. It stops working immediately. Owners and admins can also revoke from the organisation page. Changing your password disconnects every AI tool and token. # API Reference (https://docs.sms.chinqit.com/en/api-v2) Reference for the current ChinqIT Verify API. Base path: **`https://sms.chinqit.com/api/v2`**. ## Authentication All requests require an API key in one of these headers: ``` X-API-Key: your-api-key-here ``` or ``` Authorization: Bearer your-api-key-here ``` API keys belong to your organisation and are created in the dashboard. [Create an account](https://dashboard.sms.chinqit.com/signup?utm_source=docs), then open **API keys** and choose **Create API key**. An owner or admin of the organisation creates keys; members can view them. A new account can create a key right away and send OTPs; normal messages unlock after its first top-up. The full API key is shown once, when it is created or regenerated. Store it securely; it cannot be shown again. In the dashboard, **Regenerate key** and **Deactivate** each ask for confirmation first: a regenerated key stops the old one working immediately, and requests with a deactivated key are rejected until you reactivate it. A test send from a key's details panel sends an OTP code by default and is charged to your balance like any other message. When you create or edit a key, its **WhatsApp** and **Email** switches decide whether it may send WhatsApp and email OTPs. Email delivery uses the shared ChinqIT sender; customer-owned sender domains are not yet available and the dashboard marks them as coming soon. **401 Unauthorized** (missing key): ```json { "success": false, "message": "API key is required. Please provide X-API-Key header or Authorization Bearer token." } ``` **403 Forbidden** (invalid or inactive key): ```json { "success": false, "message": "Invalid or inactive API key." } ``` **401 Unauthorized** (expired key): ```json { "success": false, "message": "API key expired." } ``` **403 Forbidden** (API key not assigned to a user account): ```json { "success": false, "message": "API key is not assigned to a user." } ``` **403 Forbidden** (sender ID expired — SMS send endpoints only): ```json { "success": false, "code": "SENDER_ID_EXPIRED", "message": "The API key sender ID has expired. Remove it or renew the sender ID before sending SMS." } ``` When a sender ID (header) bound to the key expires, the gateway blocks SMS traffic for that key instead of falling back to the default sender. Remove the expired header from the key in the dashboard or renew the header, then retry. WhatsApp sends are not affected. ## Base URL * **Production:** `https://sms.chinqit.com/api/v2` ## Phone number formats Rules depend on the endpoint and OTP channel. ### SMS (`POST /api/v2/notify`, `POST /api/v2/code` with `channel: "sms"`, `POST /api/v2/check` with `channel: "sms"`) Mauritania numbers only. Accepted inputs are normalized to `+222XXXXXXXX`: * **Canonical:** `+222XXXXXXXX` * **With country code:** `222XXXXXXXX` * **Local:** `XXXXXXXX` (must start with `2`, `3`, or `4`) ### WhatsApp OTP (`POST /api/v2/code` with `channel: "whatsapp"`) Uses international **E.164** format (e.g. `+12133734253`). The number must be valid for its country. **Supported countries:** **Mauritania (MR)** and **United States (US)**. Other countries return **400** with: `"WhatsApp OTP supports only Mauritania (MR) and United States (US) phone numbers."` Example US number: `+12133734253`. Use the same E.164 number (and `channel`) when calling `POST /api/v2/check`. Invalid formats return `400 Bad Request`. ## Rate limiting ### Throughput (notify, code, check, status GET) Per API key: **10 requests per second**. When exceeded, the API returns **429** with a `retryAfter` field (seconds) and a `Retry-After` header. Standard rate limits do not apply to bulk requests. A key can send **2 broadcasts per minute**; see [Broadcasts](https://docs.sms.chinqit.com/en/bulk-sms.mdx#rate-limits). ### OTP sending (POST /api/v2/code only) Per recipient (phone number or email) per API key. ChinqIT sets these limits on each API key: per minute, per hour and per day. If you leave them empty, the maximum applies: * **60 requests per minute** * **1,000 requests per hour** * **5,000 requests per day** When exceeded, the API returns **429** with `retryAfter` (seconds). ## Retries Send an `Idempotency-Key` header (for example a UUID) with `POST /notify` or `POST /code`, and reuse it when you retry the same request. A retry with the same key returns the first successful answer with the header `Idempotent-Replayed: true`, and nothing is sent or charged again. The same key with a different request returns **409**. A **503** with `code` `QUEUE_OUTCOME_UNKNOWN` means the message may still be sent. Check its status with `GET /api/v2/notify/:messageId` (the `messageId` is in the body) before you send it again. If it stays `pending`, wait: within about 10 minutes it is either sent or `failed`, and a `failed` message is never charged. A retry with the same `Idempotency-Key` returns **409** `IDEMPOTENCY_KEY_REUSED`: check the status instead, and send with a new key only if the message `failed`. *** ## POST /api/v2/notify Send an SMS message. **Request:** ```json { "message": "Hello, this is a test message", "phoneNumber": "+222XXXXXXXX" } ``` | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ----------------------------- | | `message` | string | Yes | SMS content | | `phoneNumber` | string | Yes | Recipient (Mauritania format) | **Response:** ```json { "success": true, "messageId": "550e8400-e29b-41d4-a716-446655440000", "queued": true, "cost": 0.10, "parts": 1, "pricePerMessage": 0.10, "encoding": "GSM-7", "length": 37 } ``` `cost`, `parts`, `pricePerMessage`, `encoding` and `length` are the expected charge. Messages are queued and processed asynchronously. Use `messageId` to track delivery. **Charging:** an SMS is charged when it is sent. If your balance is too low, it is not sent or charged, and its status becomes `failed`. **Errors:** `429` if the key reached its monthly limit, `503` if SMS is temporarily unavailable. A `503` with `code` `QUEUE_OUTCOME_UNKNOWN` carries the `messageId`: check its status before you retry (see [Retries](#retries)). **Example:** ```bash curl -X POST https://sms.chinqit.com/api/v2/notify \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+222XXXXXXXX", "message": "Hello"}' ``` *** ## POST /api/v2/code Request an OTP (send a verification code via SMS, WhatsApp or email). For email, see [Email OTP](https://docs.sms.chinqit.com/en/email-otp.mdx). **Request:** ```json { "phoneNumber": "+222XXXXXXXX", "hash": "ABC123XYZ45", "language": "en", "channel": "sms" } ``` | Parameter | Type | Required | Description | | ------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `phoneNumber` | string | Yes | Recipient: Mauritania format for `channel: "sms"`; E.164 for `channel: "whatsapp"` (MR or US) | | `hash` | string | No | 11-character SMS Retriever hash (SMS only). Ignored during the free trial. See [SMS Retriever Guide](https://docs.sms.chinqit.com/en/sms-retriever-guide.mdx). | | `domain` | string | No | Your website's hostname, e.g. `example.com` (SMS only). Adds a last line `@example.com #123456` so Chrome and Safari can fill in the code. Not with `hash`. Ignored during the free trial. | | `codeLength` | integer | No | Code length, 4 to 8 digits. Default 6. | | `expiresIn` | integer | No | Seconds the code stays valid, 60 to 600. Default 600. | | `maxAttempts` | integer | No | Wrong tries allowed for this code, 1 to 5. Default 3. | | `language` | string | No | `fr` (default), `en`, `ar` | | `channel` | string | No | `sms` (default), `whatsapp`, or `email` (see [Email OTP](https://docs.sms.chinqit.com/en/email-otp.mdx)) | **Response:** ```json { "success": true, "messageId": "550e8400-e29b-41d4-a716-446655440000", "expiresIn": 600, "cost": 0.10, "parts": 1, "pricePerMessage": 0.10, "encoding": "GSM-7", "length": 37 } ``` `cost`, `parts`, `pricePerMessage`, `encoding` and `length` are the expected charge. * By default: 6-digit code, valid 10 minutes (600 seconds), 3 verification attempts. **Charging:** * **SMS:** as for `POST /api/v2/notify`. * **`domain`:** its line is part of the SMS and is charged with it; an Arabic SMS may become 2 parts. * **WhatsApp and email:** charged when you send the request; a WhatsApp code costs one unit. A **402** means your balance is too low. * **New code for the same number:** if the earlier SMS code has not gone out yet, it is cancelled and not charged. **Errors (SMS):** `503` with `code` `QUEUE_OUTCOME_UNKNOWN` and the `messageId`: the code may still be sent. Check its status before you request another (see [Retries](#retries)). **402 Payment Required — Insufficient balance (WhatsApp and email):** ```json { "success": false, "message": "Insufficient balance", "messageId": "550e8400-e29b-41d4-a716-446655440000" } ``` **WhatsApp channel (`channel: "whatsapp"`):** * Your API key must have WhatsApp enabled; otherwise **403** with `"WhatsApp access is not enabled for this API key"`. * Phone must be valid E.164 for **MR** or **US** (see [Phone number formats](#phone-number-formats)); other countries return **400**. * **503** if WhatsApp delivery is temporarily unavailable. **Example:** ```bash curl -X POST https://sms.chinqit.com/api/v2/code \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+222XXXXXXXX", "language": "en"}' ``` *** ## POST /api/v2/check Verify an OTP code. **Request:** ```json { "phoneNumber": "+222XXXXXXXX", "otp": "123456", "channel": "sms" } ``` | Parameter | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------- | | `phoneNumber` | string | Yes | Same number and format used in `POST /api/v2/code` (Mauritania for SMS; E.164 MR/US for WhatsApp) | | `otp` | string | Yes | The code you received (4 to 8 digits) | | `channel` | string | No | `sms` (default), `whatsapp` or `email` — must match the channel used when sending | **Response (success):** ```json { "success": true, "message": "OTP verified successfully", "verified": true } ``` **Response (invalid):** ```json { "success": false, "message": "Invalid OTP", "retriesLeft": 2, "code": "OTP_INVALID" } ``` Check a code with the same API key that sent it. These answers carry a `code` you can branch on: | Status | `code` | Meaning | | ------ | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | 400 | `OTP_INVALID` | Wrong code. `retriesLeft` tries remain. | | 400 | `OTP_ATTEMPTS_EXHAUSTED` | No tries remain. Send a new code. | | 400 | `VALIDATION_FAILED` | The request is malformed, or the code has the wrong length. It costs no try. | | 404 | `OTP_NOT_FOUND` | No code to check: it was not sent with this API key, it expired, or it was already used. | | 429 | `OTP_VERIFY_LOCKED` | Too many wrong codes for this recipient. Try again after `retryAfter` seconds (also in the `Retry-After` header). | | 429 | `KEY_RATE_LIMIT` | Too many requests with this key. Wait `retryAfter` seconds. | **Example:** ```bash curl -X POST https://sms.chinqit.com/api/v2/check \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+222XXXXXXXX", "otp": "123456"}' ``` *** ## GET /api/v2/notify/:messageId Get delivery status for a message. **Response:** ```json { "success": true, "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "status": "sent", "billed": true, "sent": true, "phoneNumber": "+222XXXXXXXX", "type": "message", "origin": "internal_alert", "alertType": "low_balance", "smppMessageId": "abc123", "submittedAt": "2024-01-15T10:30:00.000Z", "dlrStatus": "DELIVRD", "dlrReceivedAt": "2024-01-15T10:30:05.000Z", "cost": 0.10, "parts": 1, "pricePerMessage": 0.10, "createdAt": "2024-01-15T10:29:55.000Z", "updatedAt": "2024-01-15T10:30:05.000Z" } } ``` `failed` means the message was not sent, for example because your balance was too low; it is not charged. `rejected` means the operator refused the number. | Field | Description | | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `status` | Message status: `pending`, `sent` (accepted by the operator or WhatsApp, not yet confirmed delivered), `delivered` (delivery confirmed), `undelivered` (accepted, then reported not delivered), `rejected`, or `failed` | | `billed` | Whether this message counted toward billing (the operator accepted the submit) | | `sent` | **Deprecated** — use `status` instead. Delivery status (`true`/`false`/`null` for pending) | | `origin` | Message origin: `api` (ordinary sends via the public API) or `internal_alert` (ChinqIT internal SMS alerts, e.g. low-balance and header-expiration notices). Historical rows may omit this field. | | `alertType` | Alert type when `origin` is `internal_alert` (e.g. `low_balance`, `header_expiring`, `header_expired`); absent otherwise | | `cost`, `parts`, `pricePerMessage` | Amount charged; `null` if the message was not charged | | `smppMessageId` | Provider-assigned message identifier (SMS) | | `submittedAt` | When the message was submitted to the provider | | `dlrStatus` | Delivery receipt status from provider | | `dlrReceivedAt` | When the delivery receipt was received | **404** if the message is not found or does not belong to your API key. **Example:** ```bash curl -H "X-API-Key: YOUR_API_KEY" \ "https://sms.chinqit.com/api/v2/notify/550e8400-e29b-41d4-a716-446655440000" ``` *** ## Broadcasts Send to up to 50,000 recipients per batch for single-part messages. Multi-part or max-length messages reduce capacity — the request body is capped at **20 MB** (`recipients × (encoded message bytes + ~40 bytes) ≤ 20 MB`). See the dedicated [Broadcasts](https://docs.sms.chinqit.com/en/bulk-sms.mdx) guide for: * `POST /api/v2/bulk/send` (returns **202 Accepted**) * `GET /api/v2/bulk/status/:batchId` *** ## Error format ```json { "success": false, "message": "Error description", "errors": [] } ``` **HTTP status codes:** | Code | Meaning | | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | 200 | Success | | 202 | Bulk batch accepted | | 400 | Validation error | | 400 `EMAIL_SUPPRESSED` | The email address bounced or reported spam. Nothing is charged. Use another address. | | 400 `IDEMPOTENCY_KEY_INVALID` | The `Idempotency-Key` header is empty or longer than 128 characters. | | 401 | Missing or expired API key | | 402 | Insufficient balance (WhatsApp, email, broadcasts) | | 403 | Invalid/inactive API key, key not assigned to a user, expired sender ID (SMS), or WhatsApp/email not enabled on the key | | 403 `TRIAL_PAUSED` | Free trial sending is paused. Top up to continue. | | 403 `TOP_UP_REQUIRED` | New accounts send OTPs only until their first top-up. | | 404 | Resource not found | | 409 `IDEMPOTENCY_KEY_REUSED` | The key was already used for another request. Send a new key. | | 409 `IDEMPOTENCY_IN_PROGRESS` | The first request with this key is still running. Retry with the same key after `Retry-After`. | | 429 `KEY_RATE_LIMIT` | Too many requests with this key. Wait `retryAfter` seconds. | | 429 `IP_RATE_LIMIT` | Too many requests from this address. Retry after `retryAfter` seconds. | | 429 `OTP_RECIPIENT_LIMIT` | Too many codes for this recipient. `window` (`minute`, `hour` or `day`) and `limit` say which limit. Retry after `retryAfter` seconds. | | 429 `OTP_VERIFY_LOCKED` | Too many wrong codes for this recipient. Retry after `retryAfter` seconds. | | 429 `MONTHLY_USAGE_LIMIT` | The key reached its monthly usage limit. `resetAt` says when it resets; `retryAfter` is the seconds until then. | | 429 `ACTIVE_BATCH_LIMIT` | Too many broadcasts in progress. Try again when one has finished. | | 429 `SCHEDULED_BATCH_LIMIT` | Too many scheduled broadcasts. Try again when one has been sent. | | 429 `TRIAL_LIMIT` | Free trial limit reached. Top up to send more. | | 500 | Internal server error | | 502 | Provider error (e.g. WhatsApp) | | 503 | Service temporarily unavailable (SMS or WhatsApp) | | 503 `QUEUE_OUTCOME_UNKNOWN` | The message may still be sent. Check `GET /api/v2/notify/:messageId` before you retry. | Billing failures for broadcast batches are documented in the [Broadcasts](https://docs.sms.chinqit.com/en/bulk-sms.mdx) guide. ## Deprecation Legacy unversioned endpoints (`/messages/send`, `/otp/send`, etc.) remain available but return dated `Deprecation` and `Sunset` headers and a `deprecation` object in the JSON body. Do not use them for new integrations. See [deprecated API section](https://docs.sms.chinqit.com/en/deprecated-v1.mdx). ## See also * [API Usage](https://docs.sms.chinqit.com/en/api-usage.mdx) * [Troubleshooting](https://docs.sms.chinqit.com/en/troubleshooting.mdx) * [SMS Retriever Guide](https://docs.sms.chinqit.com/en/sms-retriever-guide.mdx) **API v1 (deprecated):** [legacy section](https://docs.sms.chinqit.com/en/deprecated-v1.mdx) # API Usage Guide (https://docs.sms.chinqit.com/en/api-usage) This guide covers common flows with the **v2 API**. For full endpoint details, see the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx). ## Prerequisites * A ChinqIT Verify API key (`X-API-Key`). [Create an account](https://dashboard.sms.chinqit.com/signup?utm_source=docs), then create the key under **API keys** in the dashboard. A new account can create a key right away and send OTPs; normal messages unlock after its first top-up. * Base URL: `https://sms.chinqit.com/api/v2` ## Quick start 1. **Send an SMS** — [POST /api/v2/notify](https://docs.sms.chinqit.com/en/api-v2.mdx#post-apiv2notify) 2. **Send an OTP** — [POST /api/v2/code](https://docs.sms.chinqit.com/en/api-v2.mdx#post-apiv2code) 3. **Verify an OTP** — [POST /api/v2/check](https://docs.sms.chinqit.com/en/api-v2.mdx#post-apiv2check) 4. **Track delivery** — [GET /api/v2/notify/:messageId](https://docs.sms.chinqit.com/en/api-v2.mdx#get-apiv2notifymessageid) 5. **Broadcasts** — [POST /api/v2/bulk/send](https://docs.sms.chinqit.com/en/bulk-sms.mdx) and [GET /api/v2/bulk/status/:batchId](https://docs.sms.chinqit.com/en/bulk-sms.mdx) Each endpoint is documented with curl examples, parameters, and responses in the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx). ## OTP and SMS Retriever (Android) For Android OTP auto-fill, include the `hash` parameter in `POST /api/v2/code`. See the [SMS Retriever Guide](https://docs.sms.chinqit.com/en/sms-retriever-guide.mdx). Phone login: [Supabase](https://docs.sms.chinqit.com/en/supabase-phone-auth.mdx) and [Firebase](https://docs.sms.chinqit.com/en/firebase-phone-auth.mdx). ## Phone format and errors Mauritanian phone numbers must match the formats in the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx). For issues, see [Troubleshooting](https://docs.sms.chinqit.com/en/troubleshooting.mdx). ## Sender ID (alphanumeric sender name) Outgoing messages are sent under an alphanumeric **sender ID** — the name recipients see instead of a phone number. Sender IDs are letters and digits only (no spaces or special characters), for example `MyCompany`, `Store123`, or `Bank2024`. To use a custom sender ID, open **Sender IDs** in the dashboard and choose **Request sender ID**. **Save draft** stores the request without charging your wallet; **Save and pay** saves it, pays the monthly fee from your wallet, and submits it for review. If your wallet has insufficient funds, the saved draft remains editable. You can also pay for an existing draft from the **Requests** tab. A rejected request shows the reason in the same tab. Once the request is approved, the sender ID is active. Active sender IDs show the days left before expiry; renewal opens 5 days before expiry, and auto-renew charges one month's fee one day before expiry. A renewal is paid from your wallet and takes effect immediately, with no new review: the dashboard confirms it with the new expiry date. You get a reminder 5 days before expiry, the day before, and the day after if the sender ID has expired: by email to the owners and admins, and by SMS to the owner if the last top-up brought the balance to at least 30% above the critical level (130 MRU today). Until a sender ID is active, messages use the default `CHINQIT` sender. The request page shows the monthly fee. Review usually takes 2–4 working days. The fee is paid from a top-up, not from the welcome credit. *** **API v1 (deprecated):** archived docs in [deprecated API section](https://docs.sms.chinqit.com/en/deprecated-v1.mdx). # Email OTP (https://docs.sms.chinqit.com/en/email-otp) Send and verify one-time passwords by email through the v2 API. ## Before you start * Get an API key with email access enabled. * Set the base URL to `https://sms.chinqit.com/api/v2`. * Send `X-API-Key` or `Authorization: Bearer` with every request. ## Send an email OTP Call `POST /api/v2/code` with `channel: "email"` and the recipient's `email`. ```bash curl -X POST https://sms.chinqit.com/api/v2/code \ -H 'X-API-Key: your-api-key' \ -H 'Content-Type: application/json' \ -d '{ "email": "user@example.com", "channel": "email", "language": "en" }' ``` A successful response includes the message ID, the expiry, and the email price used for the send: ```json { "success": true, "messageId": "550e8400-e29b-41d4-a716-446655440000", "expiresIn": 600, "cost": 0.23, "pricePerMessage": 0.23 } ``` Email OTP responses do not include SMS fields such as `parts`, `encoding`, or `length`. ## Verify the code Call `POST /api/v2/check` with the same normalized email address, the code, and `channel: "email"`. ```bash curl -X POST https://sms.chinqit.com/api/v2/check \ -H 'X-API-Key: your-api-key' \ -H 'Content-Type: application/json' \ -d '{ "email": "user@example.com", "otp": "123456", "channel": "email" }' ``` ```json { "success": true, "message": "OTP verified successfully", "verified": true } ``` By default the code expires after ten minutes and works once. A wrong code returns `400` and leaves the remaining-attempt count in the response. The API allows three failed attempts by default before it invalidates the code. ## Sender and email template ChinqIT sends email OTPs from the shared sender `ChinqIT Verify `. The email shows your API key client's configured name when one exists. Replies go to `support@chinqit.com`. Client names are shown up to 20 characters. The `language` field accepts `fr`, `en`, or `ar` and defaults to `fr`. ChinqIT renders the subject, body, expiry notice, and security footer in that locale. Arabic email uses right-to-left layout. Each email tells the recipient when the code expires and that it should not be shared. ## Delivery status `GET /api/v2/notify/:messageId` returns `delivered` once the recipient's mail server accepts the email, and `undelivered` if it bounces. An address that bounces permanently or reports spam can no longer receive email OTPs. ## Tips for better delivery * Tell your users to check their spam folder if the first email does not arrive, and to mark it as not spam. * Check addresses for typos before you send. * If a send fails with `EMAIL_SUPPRESSED`, ask the user for another address. ## Pricing Email OTP uses per-type-global pricing. An administrator configures one global email price, which applies to every send. Sending is disabled until that price exists: without an active `email` pricing row, sends fail with `503 EMAIL_PRICING_NOT_CONFIGURED`. The response returns the amount as `cost` and `pricePerMessage`. Verification creates no additional charge. A send that fails is not charged. ## Verification webhook Subscribe to `otp.verified` to receive a notification after a successful verification. Email events include `email` in `data` instead of `phoneNumber`: ```json { "id": "evt_01j9z...", "type": "otp.verified", "createdAt": "2026-06-27T10:02:00.000Z", "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "email": "user@example.com", "verifiedAt": "2026-06-27T10:02:00.000Z" } } ``` See [Webhooks](https://docs.sms.chinqit.com/en/webhooks.mdx) for subscription and signature verification details. ## Errors | Status | When it occurs | What to do | | ------ | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | `400` | The email, channel, or code fails validation; the code is wrong; or the recipient exceeded verification attempts. | Send a valid email and code. Request a new code after too many failed attempts. | | `400` | The address bounced or reported spam (`errorCode`: `EMAIL_SUPPRESSED`). Nothing is sent or charged. | Ask the user for another email address. | | `401` | The request has no valid API key. | Send `X-API-Key` or a bearer token. | | `402` | The billing account has insufficient balance. | Add balance, then retry the send. | | `403` | The API key is invalid, inactive, unassigned, or lacks email access. | Turn on the key's **Email** switch under **API keys** in the dashboard. | | `404` | The code does not exist or has expired. | Send a new email OTP. | | `429` | The recipient or API key hit a rate limit, or the key reached its monthly usage limit. | Wait for the limit to clear, or contact ChinqIT support to raise the key's monthly limit. | | `502` | The email could not be sent (`errorCode`: `EMAIL_SEND_FAILED`). You are not charged. | Retry later. If it keeps happening, contact support with the `messageId`. | | `503` | The email service lacks its required configuration. | Contact ChinqIT Verify support. | For endpoint schemas and all response fields, see the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx). # SMS Retriever API Guide (https://docs.sms.chinqit.com/en/sms-retriever-guide) Learn how to implement Android's SMS Retriever API for automatic SMS consumption in Flutter, React Native, and Kotlin applications. ## Overview The Android SMS Retriever API allows your app to automatically read SMS messages that contain a specific 11-character hash string. This enables seamless OTP verification and other SMS-based authentication flows without requiring SMS read permissions. When you include a hash in your **OTP** request (**POST /api/v2/code**; legacy **POST /otp/send** is deprecated), the hash will be automatically appended to your OTP message on a new line, making it compatible with the SMS Retriever API. For a website, send `domain` on `POST /api/v2/code` instead: Chrome and Safari then fill in the code. ## How It Works 1. **Generate Hash**: Your app generates an 11-character hash based on your app's package name and signing certificate 2. **Send SMS**: Include the hash in your ChinqIT Verify API request 3. **Automatic Consumption**: Android automatically reads SMS messages containing your hash 4. **Receive SMS**: Your app receives the SMS content without user interaction ## Hash Format * **Length**: Exactly 11 characters * **Characters**: Alphanumeric (A-Z, a-z, 0-9) * **Example**: `ABC123XYZ45` * **Separator**: The hash is automatically added on a new line after your message **Example**: If you send `message: "Your code is: 123456"` with `hash: "ABC123XYZ45"`, the resulting SMS will be: ``` Your code is: 123456 ABC123XYZ45 ``` ## Implementation Guides ### Flutter #### Using `sms_autofill` Package 1. **Add dependency** to `pubspec.yaml`: ```yaml dependencies: sms_autofill: ^2.3.0 ``` 2. **Get the hash**: ```dart import 'package:sms_autofill/sms_autofill.dart'; class SmsRetrieverExample { Future getAppSignature() async { try { final signature = await SmsAutoFill().getAppSignature; return signature; } catch (e) { print('Error getting app signature: $e'); return null; } } } ``` 3. **Listen for SMS**: ```dart import 'package:sms_autofill/sms_autofill.dart'; class OtpVerificationScreen extends StatefulWidget { @override _OtpVerificationScreenState createState() => _OtpVerificationScreenState(); } class _OtpVerificationScreenState extends State { String? _code; final SmsAutoFill _autoFill = SmsAutoFill(); @override void initState() { super.initState(); _listenForSms(); } void _listenForSms() { _autoFill.listenForCode(); } @override Widget build(BuildContext context) { return PinFieldAutoFill( codeLength: 6, onCodeSubmitted: (code) { setState(() { _code = code; }); // Verify OTP with your backend _verifyOtp(code); }, ); } Future _verifyOtp(String code) async { // Send verification request to your backend final response = await http.post( Uri.parse('https://your-api.com/otp/verify'), body: jsonEncode({ 'phoneNumber': '+1234567890', 'otp': code, }), ); } @override void dispose() { _autoFill.unregisterListener(); super.dispose(); } } ``` 4. **Send SMS with hash**: ```dart import 'package:http/http.dart' as http; import 'dart:convert'; Future sendOtpWithHash(String phoneNumber) async { // Get the app signature (hash) final signature = await SmsAutoFill().getAppSignature; // Send SMS via ChinqIT Verify API final response = await http.post( Uri.parse('https://sms.chinqit.com/api/v2/notify'), headers: { 'Content-Type': 'application/json', 'X-API-Key': 'YOUR_API_KEY', }, body: jsonEncode({ 'phoneNumber': phoneNumber, 'message': 'Your verification code is: 123456', 'hash': signature, // Include the hash }), ); if (response.statusCode == 200) { print('SMS sent successfully'); } } ``` #### Using `sms_retriever` Package (Alternative) ```yaml dependencies: sms_retriever: ^1.0.0 ``` ```dart import 'package:sms_retriever/sms_retriever.dart'; Future getAppSignature() async { try { final signature = await SmsRetriever.getAppSignature(); return signature; } catch (e) { print('Error: $e'); return null; } } void listenForSms() { SmsRetriever.listenForSms().listen((sms) { // Extract OTP from SMS final otp = extractOtp(sms); // Verify OTP verifyOtp(otp); }); } String extractOtp(String sms) { // Extract the OTP code from the SMS final regex = RegExp(r'\b\d{4,8}\b'); final match = regex.firstMatch(sms); return match?.group(0) ?? ''; } ``` ### React Native #### Using `react-native-sms-retriever` 1. **Install package**: ```bash npm install react-native-sms-retriever # or yarn add react-native-sms-retriever ``` 2. **Link the package** (for older React Native versions): ```bash cd ios && pod install ``` 3. **Get the hash**: ```javascript import SmsRetriever from "react-native-sms-retriever"; class SmsRetrieverExample { async getAppSignature() { try { const hash = await SmsRetriever.getAppHash(); return hash; } catch (error) { console.error("Error getting app hash:", error); return null; } } } ``` 4. **Listen for SMS**: ```javascript import SmsRetriever from "react-native-sms-retriever"; import { useEffect, useState } from "react"; function OtpVerificationScreen() { const [otp, setOtp] = useState(""); useEffect(() => { // Start listening for SMS SmsRetriever.startSmsRetriever() .then(() => { console.log("SMS Retriever started"); }) .catch((error) => { console.error("Error starting SMS Retriever:", error); }); // Listen for SMS const subscription = SmsRetriever.addSmsListener((event) => { const message = event.message; // Extract OTP from message const extractedOtp = extractOtp(message); if (extractedOtp) { setOtp(extractedOtp); verifyOtp(extractedOtp); } }); return () => { // Cleanup subscription.remove(); SmsRetriever.removeSmsListener(); }; }, []); const extractOtp = (message) => { // Extract the OTP code const match = message.match(/\b\d{4,8}\b/); return match ? match[0] : null; }; const verifyOtp = async (code) => { try { const response = await fetch("https://your-api.com/otp/verify", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ phoneNumber: "+1234567890", otp: code, }), }); const data = await response.json(); if (data.verified) { console.log("OTP verified successfully"); } } catch (error) { console.error("Error verifying OTP:", error); } }; return ( Enter OTP: {otp} ); } ``` 5. **Send SMS with hash**: ```javascript import SmsRetriever from "react-native-sms-retriever"; async function sendOtpWithHash(phoneNumber) { try { // Get the app hash const hash = await SmsRetriever.getAppHash(); // Send SMS via ChinqIT Verify API const response = await fetch("https://sms.chinqit.com/api/v2/notify", { method: "POST", headers: { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY", }, body: JSON.stringify({ phoneNumber: phoneNumber, message: "Your verification code is: 123456", hash: hash, // Include the hash }), }); const data = await response.json(); if (data.success) { console.log("SMS sent successfully"); } } catch (error) { console.error("Error sending SMS:", error); } } ``` #### Using `react-native-otp-verify` (Alternative) ```bash npm install react-native-otp-verify ``` ```javascript import OtpVerify from "react-native-otp-verify"; // Get hash OtpVerify.getHash() .then((hash) => { console.log("Hash:", hash); }) .catch((error) => { console.error("Error:", error); }); // Listen for SMS OtpVerify.getOtp() .then((message) => { // Extract OTP from message const otp = extractOtp(message); verifyOtp(otp); }) .catch((error) => { console.error("Error:", error); }); ``` ### Kotlin (Native Android) #### Implementation Steps 1. **Add dependency** to `build.gradle.kts`: ```kotlin dependencies { implementation("com.google.android.gms:play-services-auth-api-phone:18.0.1") } ``` 2. **Get the hash**: ```kotlin import com.google.android.gms.auth.api.phone.SmsRetriever import com.google.android.gms.auth.api.phone.SmsRetrieverClient import com.google.android.gms.tasks.Task class SmsRetrieverHelper(private val context: Context) { fun getAppSignatureHash(callback: (String?) -> Unit) { val client: SmsRetrieverClient = SmsRetriever.getClient(context) val task: Task = client.smsRetrieverClient.startSmsRetriever() task.addOnSuccessListener { result -> // The hash is returned in the result // Note: This method doesn't directly return the hash // You need to use the SMS Retriever API differently callback(null) } task.addOnFailureListener { e -> callback(null) } } // Alternative: Get hash using reflection (for testing) fun getAppSignatureHashString(): String? { return try { val info = context.packageManager.getPackageInfo( context.packageName, PackageManager.GET_SIGNATURES ) val signatures = info.signatures if (signatures.isNotEmpty()) { val signature = signatures[0] val md = MessageDigest.getInstance("SHA-256") md.update(signature.toByteArray()) val hashBytes = md.digest() // Convert to base64 and take first 11 characters Base64.encodeToString(hashBytes, Base64.NO_WRAP) .substring(0, 11) .replace("+", "A") .replace("/", "B") .replace("=", "C") } else { null } } catch (e: Exception) { null } } } ``` 3. **Listen for SMS**: ```kotlin import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter import com.google.android.gms.auth.api.phone.SmsRetriever import com.google.android.gms.auth.api.phone.SmsRetrieverClient import com.google.android.gms.common.api.CommonStatusCodes import com.google.android.gms.common.api.Status class SmsRetrieverReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (SmsRetriever.SMS_RETRIEVED_ACTION == intent.action) { val extras = intent.extras val status = extras?.get(SmsRetriever.EXTRA_STATUS) as? Status when (status?.statusCode) { CommonStatusCodes.SUCCESS -> { // Get SMS message val message = extras.getString(SmsRetriever.EXTRA_SMS_MESSAGE) message?.let { // Extract OTP from message val otp = extractOtp(it) otp?.let { code -> // Verify OTP verifyOtp(code) } } } CommonStatusCodes.TIMEOUT -> { // Timeout waiting for SMS } } } } private fun extractOtp(message: String): String? { // Extract the OTP code val regex = Regex("\\b\\d{4,8}\\b") return regex.find(message)?.value } private fun verifyOtp(otp: String) { // Send verification request to your backend // Implementation depends on your networking library } } ``` 4. **Start SMS Retriever**: ```kotlin import com.google.android.gms.auth.api.phone.SmsRetriever import com.google.android.gms.auth.api.phone.SmsRetrieverClient class MainActivity : AppCompatActivity() { private lateinit var smsRetrieverReceiver: BroadcastReceiver override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Register SMS Retriever receiver smsRetrieverReceiver = SmsRetrieverReceiver() val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION) registerReceiver(smsRetrieverReceiver, intentFilter) // Start SMS Retriever startSmsRetriever() } private fun startSmsRetriever() { val client: SmsRetrieverClient = SmsRetriever.getClient(this) val task = client.startSmsRetriever() task.addOnSuccessListener { // SMS Retriever started successfully Log.d("SMS", "SMS Retriever started") } task.addOnFailureListener { e -> Log.e("SMS", "Failed to start SMS Retriever", e) } } override fun onDestroy() { super.onDestroy() unregisterReceiver(smsRetrieverReceiver) } } ``` 5. **Send SMS with hash**: ```kotlin import okhttp3.* import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody.Companion.toRequestBody import org.json.JSONObject class SmsService(private val context: Context) { private val client = OkHttpClient() suspend fun sendOtpWithHash(phoneNumber: String, message: String) { // Get hash val hash = getAppSignatureHashString() // Prepare request val json = JSONObject().apply { put("phoneNumber", phoneNumber) put("message", message) hash?.let { put("hash", it) } } val requestBody = json.toString() .toRequestBody("application/json".toMediaType()) val request = Request.Builder() .url("https://sms.chinqit.com/api/v2/notify") .post(requestBody) .addHeader("Content-Type", "application/json") .addHeader("X-API-Key", "YOUR_API_KEY") .build() try { val response = client.newCall(request).execute() if (response.isSuccessful) { Log.d("SMS", "SMS sent successfully") } } catch (e: Exception) { Log.e("SMS", "Error sending SMS", e) } } private fun getAppSignatureHashString(): String? { // Implementation from step 2 return SmsRetrieverHelper(context).getAppSignatureHashString() } } ``` ## Important Notes 1. **Hash Generation**: The hash is generated based on your app's package name and signing certificate. It will be different for debug and release builds. 2. **SMS Format**: The SMS must start with the hash string. Our API appends the hash to the end of your message, so ensure your message format works with this. 3. **Testing**: Use the [SMS Retriever API Playground](https://developers.google.com/identity/sms-retriever/verify) to test your hash generation. 4. **Permissions**: No SMS read permissions are required. The SMS Retriever API handles SMS reading automatically. 5. **Timeout**: The SMS Retriever API has a 5-minute timeout. If no SMS is received within this time, you'll need to restart the retriever. ## Troubleshooting ### Hash Not Working * Verify your hash is exactly 11 characters * Ensure you're using the correct signing certificate (debug vs release) * Check that the SMS format matches Android's requirements ### SMS Not Received * Verify the hash matches your app's signature * Ensure SMS Retriever is started before sending the SMS * Check that the SMS contains the hash string ### Timeout Issues * Restart SMS Retriever if timeout occurs * Implement retry logic for failed attempts * Consider fallback to manual OTP entry ## Additional Resources * [Android SMS Retriever API Documentation](https://developers.google.com/identity/sms-retriever) * [SMS Retriever API Playground](https://developers.google.com/identity/sms-retriever/verify) * [Flutter sms\_autofill Package](https://pub.dev/packages/sms_autofill) * [React Native SMS Retriever](https://github.com/Bruno-Furtado/react-native-sms-retriever) *** **Need help?** Check the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx) or [Troubleshooting Guide](https://docs.sms.chinqit.com/en/troubleshooting.mdx) for more information. # Supabase phone login with ChinqIT (https://docs.sms.chinqit.com/en/supabase-phone-auth) Send Supabase Auth login codes by SMS with ChinqIT, using one small function. ## Before you start * A ChinqIT API key, created under **API keys** in the [ChinqIT dashboard](https://dashboard.sms.chinqit.com). * The [Supabase CLI](https://supabase.com/docs/guides/local-development/cli/getting-started), linked to your project. ## Create the function ```bash supabase functions new chinqit-sms ``` Replace the content of `supabase/functions/chinqit-sms/index.ts` with this code: ```ts // Supabase "Send SMS" hook: checks the Supabase signature, then sends the // login code as an SMS through ChinqIT. // Env vars: CHINQIT_API_KEY, SEND_SMS_HOOK_SECRET, CHINQIT_SMS_LANGUAGE (fr, en or ar; default fr). import { Webhook } from "npm:standardwebhooks@1.0.0"; const TEXTS: Record string> = { fr: (otp) => `Votre code ChinqIT est ${otp}`, en: (otp) => `Your ChinqIT code is ${otp}`, ar: (otp) => `رمز ChinqIT الخاص بك هو ${otp}`, }; // Supabase only reads the error message when the hook answers 200, so refusals // go out as 200 with the real code inside. 429 and 503 stay real statuses so // Supabase retries. const reply = (status: number, message?: string) => { if (message) console.error(message); const retry = status === 429 || status === 503; return new Response(JSON.stringify(message ? { error: { http_code: status, message } } : {}), { status: message && !retry ? 200 : status, headers: { "Content-Type": "application/json", ...(retry && { "retry-after": "true" }) }, }); }; export async function handler(req: Request): Promise { const secret = Deno.env.get("SEND_SMS_HOOK_SECRET")!.replace(/^v1,/, "").replace(/^whsec_/, ""); const payload = await req.text(); let data: { user: { id: string; phone: string }; sms: { otp: string } }; try { data = new Webhook(secret).verify(payload, Object.fromEntries(req.headers)) as typeof data; } catch { return reply(401, "Invalid signature"); } const phone = data.user.phone.startsWith("+") ? data.user.phone : `+${data.user.phone}`; const text = TEXTS[Deno.env.get("CHINQIT_SMS_LANGUAGE") ?? "fr"] ?? TEXTS.fr; // Same key on Supabase retries (same user, code and hour): the SMS is sent once. const bytes = new TextEncoder().encode(`${data.user.id}:${data.sms.otp}:${Math.floor(Date.now() / 3_600_000)}`); const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)); const idempotencyKey = Array.from(digest, (b) => b.toString(16).padStart(2, "0")).join(""); try { const res = await fetch("https://sms.chinqit.com/api/v2/notify", { method: "POST", headers: { "x-api-key": Deno.env.get("CHINQIT_API_KEY")!, "Content-Type": "application/json", "Idempotency-Key": idempotencyKey, }, body: JSON.stringify({ phoneNumber: phone, message: text(data.sms.otp) }), signal: AbortSignal.timeout(4000), }); if (res.ok) return reply(200); const err = await res.json().catch(() => ({})); const code = err.code ?? err.errorCode; const message = err.message ?? "ChinqIT refused the message"; const status = code === "IDEMPOTENCY_IN_PROGRESS" ? 503 : res.status; return reply(status, code ? `${code}: ${message}` : message); } catch { return reply(503, "Could not reach ChinqIT, try again"); } } Deno.serve(handler); ``` ## Secrets ```bash supabase secrets set CHINQIT_API_KEY=your_api_key SEND_SMS_HOOK_SECRET=v1,whsec_xxx ``` You get `SEND_SMS_HOOK_SECRET` in the "Enable the hook" step. To change the SMS language, add `CHINQIT_SMS_LANGUAGE=fr`, `en` or `ar` (`fr` by default). ## Deploy ```bash supabase functions deploy chinqit-sms --no-verify-jwt ``` ## Enable the hook In **Authentication → Sign In / Providers**, enable **Phone**. 1. In Supabase, open **Authentication → Hooks → Send SMS hook** and choose **HTTPS**. 2. Enter the URL `https://.supabase.co/functions/v1/chinqit-sms`. 3. Generate the secret, save it as `SEND_SMS_HOOK_SECRET` with `supabase secrets set`, then redeploy the function. ## Rate limit In **Authentication → Rate Limits**, Supabase allows 30 SMS per hour by default. Raise it to match the number of logins you expect. ## Test ```js await supabase.auth.signInWithOtp({ phone: '+222XXXXXXXX' }) // After the SMS arrives await supabase.auth.verifyOtp({ phone: '+222XXXXXXXX', token: '123456', type: 'sms' }) ``` ## If it fails The error appears in the response of `signInWithOtp` and in the function logs (**Edge Functions → chinqit-sms → Logs**), as `CODE: message`. Then see [Troubleshooting](https://docs.sms.chinqit.com/en/troubleshooting.mdx). # Firebase phone login with ChinqIT (https://docs.sms.chinqit.com/en/firebase-phone-auth) With a small server, ChinqIT sends and checks the SMS code, then Firebase signs the user in. ## How it works 1. The app sends the phone number to your server, which asks ChinqIT for a code (`POST /api/v2/code`). 2. The user receives the SMS and enters the code in the app. 3. Your server checks the code with ChinqIT (`POST /api/v2/check`). 4. If the code is right, the server returns a Firebase token and the app signs the user in. ## Server Install `express` and `firebase-admin`, then set `CHINQIT_API_KEY` in the server environment. Send the number as `+222XXXXXXXX`. ```js import express from 'express' import admin from 'firebase-admin' admin.initializeApp() const app = express() app.use(express.json()) const API = 'https://sms.chinqit.com/api/v2' const call = (path, body) => fetch(`${API}/${path}`, { method: 'POST', headers: { 'X-API-Key': process.env.CHINQIT_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify(body), }) app.post('/login/send-code', async (req, res) => { const r = await call('code', { phoneNumber: req.body.phoneNumber, channel: 'sms', language: 'en' }) res.status(r.status).json(await r.json()) }) app.post('/login/verify', async (req, res) => { const { phoneNumber, otp } = req.body const r = await call('check', { phoneNumber, otp, channel: 'sms' }) const result = await r.json() if (!r.ok || !result.verified) return res.status(r.status).json(result) let user try { user = await admin.auth().getUserByPhoneNumber(phoneNumber) } catch (e) { if (e.code !== 'auth/user-not-found') throw e user = await admin.auth().createUser({ phoneNumber }) } res.json({ token: await admin.auth().createCustomToken(user.uid) }) }) app.listen(3000) ``` ## App (JavaScript) ```js import { getAuth, signInWithCustomToken } from 'firebase/auth' const { token } = await fetch('/login/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ phoneNumber: '+222XXXXXXXX', otp: '123456' }), }).then((r) => r.json()) await signInWithCustomToken(getAuth(), token) ``` ## App (Flutter) ```dart await FirebaseAuth.instance.signInWithCustomToken(token); ``` ## Android To fill in the code automatically, see the [SMS Retriever Guide](https://docs.sms.chinqit.com/en/sms-retriever-guide.mdx). # Broadcasts (Bulk SMS API) (https://docs.sms.chinqit.com/en/bulk-sms) Send SMS messages to multiple recipients in a single API call. For pricing and use cases, see the [Bulk SMS API in Mauritania](https://www.chinqit.com/en/bulk-sms-api). > **Note:** The dashboard feature is called **Broadcasts** (Diffusions / البث). The underlying API keeps the legacy `bulk` path for backwards compatibility — `bulk.completed` webhook events and `/api/v2/bulk/*` endpoints are unchanged. Authentication and base URL are documented in the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx#authentication). ## Composer (dashboard) The dashboard's broadcast composer uses a focused three-step flow: * **1 · Recipients** — upload an `.xlsx` or `.xls` spreadsheet or paste phone numbers. These are the two primary ways to start. A saved audience is available as a secondary shortcut. The recipients card shows the valid, invalid, and duplicate counts and a preview of the first rows (phone, the spreadsheet's other columns, and whether each number will be sent) before you continue. * **2 · Message** — choose the **Sender ID** (each API key sends under its sender ID; a key without one uses the platform default), then write one common message, which is used by default for every sendable recipient. If the spreadsheet includes a `message` column, open **Spreadsheet messages (advanced)** to opt into its read-only per-row messages. Personalization tokens can use other spreadsheet columns. A live phone preview, headed by the chosen sender ID, updates as you edit. * **3 · Review & send** — confirm the recipients and counts, the message and preview, estimated cost, current balance, balance after send, and timing. Sending now is the default; scheduling is a secondary option under **More options**. On steps 1 and 2 a cost summary sits beside the form on wide screens, and below it on phones: recipients, parts per message, price per part, cost, and the balance after the send. Parts per message shows a dash until there is a message to count, and price per part a dash while pricing is unavailable. If your balance does not cover the send, the summary shows the shortfall and a **Top up your balance** link. Saved audiences are stored per organisation (up to 50,000 recipients each) and can be reused across broadcasts. The public API is unchanged — see the API reference for `/api/v2/bulk/*`. ## Templates & personalization (dashboard) The composer can start from a saved template (⚡ Start from a template). Templates belong to the organisation: create them from a message you composed, or write one in the template manager, and organise them by category (reminder, announcement, promotion, other). On the **Templates** page, each card shows the template's category, its text with the `{variables}` highlighted, and when it was saved. Select **Use** on a card to open the composer with that template filled in. Use the card's menu (⋯) to edit or delete it; deleting asks for confirmation first. The new and edit forms show a live phone preview of the message; the character and SMS-part count is shown above the message box. Messages can include personalization tokens: any `{word}` in the message is replaced with the value of the matching column in your recipient file. For example, a `first_name` column lets you send "Hello `{first_name}`, your appointment is confirmed". Common tokens such as `{first_name}`, `{amount}`, or `{link}` can be inserted with one click. When a recipient row is missing a value, the token is left as-is in the sent message and the composer warns you before sending. ## Scheduling (dashboard) Scheduled broadcasts are a secondary dashboard option under **More options** — the public API always sends immediately. 1. In the composer, open **More options**, switch **When** from **Send now** to **Schedule**, and pick a date and time (between 1 minute and 30 days ahead). 2. The broadcast is **pre-charged at schedule time** — same cost and balance check as an immediate send — and enters the `scheduled` state. 3. At the chosen time it sends automatically; the live results screen shows it firing and completing. 4. Until it fires you can **cancel** it from the live results screen. Cancelling refunds the full pre-charge and marks the broadcast `failed` (reason `cancelled`) — see [Billing](#billing). ## Live results & history Once a broadcast starts, its detail page becomes a live results screen: * **Sent rate** — the share of valid recipients whose message was written to the operator (e.g. 97.4%). "Sent" means accepted by the operator, not that the recipient's handset confirmed receipt (SMPP delivery reports are not aggregated to broadcasts). * **Recipient grid** — one dot per valid recipient: dots fill in as messages go out, failed dots are red and stay in place as the broadcast runs, and queued dots are faint. Above 2,500 recipients each dot stands for a fixed group of recipients, and the legend says how many. * **Counters** — Sent / Queued / Failed / Invalid, color-coded and updated by 2-second polling while the broadcast runs. * **Sends per minute** — the current send rate, with a trend line of recent status polls. A finished broadcast shows its average. Both are derived client-side while the page is open. * **What we sent** — a preview of the message content, captured when the broadcast was created. * **Duration** — elapsed time while running, total time once finished. * **Recipients** — each recipient's phone, status, parts, cost, and error, filterable by status. * **Download CSV** — a `phone,status,error` report of every recipient, matching what the screen shows at download time. The header names the sender ID the broadcast uses. If a broadcast finishes while its page is open, a notification confirms how many recipients it was sent to. The history page ("Your broadcasts") shows four summary cards — broadcasts, messages sent, delivery rate, spent — scoped to the active filters and search, followed by a table of named broadcasts (name, template type, audience size, progress, cost, status, created date). Progress shows the messages sent out of the valid recipients, with the percentage; a scheduled broadcast shows its scheduled time there instead. The audience is the full uploaded list, with its invalid numbers counted underneath. The delivery rate covers completed broadcasts only, so one still sending does not lower it. Search matches the name or batch ID across all your broadcasts, not only the page on screen. Click a broadcast to open its live results. ## Admin monitoring (dashboard) The support team has a **Broadcasts** page in the admin that mirrors the client history metrics: * **Four summary cards** — broadcasts, messages sent, delivery rate, spent — scoped to the active filters (status and period) and the client search, and always consistent with the table. * **Period filter** — today, last 7 days, last 30 days, this month — applied to both the table and the cards (bounds computed in the server's timezone). * **Broadcasts table** — name (or batch ID), client, audience, progress, cost, status, created date. Progress shows the messages sent out of the valid recipients, with the percentage; a scheduled broadcast shows its scheduled fire time there. Search by name, batch ID, or client. The admin screen cannot open a broadcast's detail: live-results screens stay with the members of the owning organisation. ## Overview The Bulk SMS API allows you to send SMS messages to multiple recipients efficiently. Each recipient can have a custom message, or you can send the same message to all recipients. ## Send Bulk Messages **POST /api/v2/bulk/send** Send SMS messages to multiple recipients in a single request. ### Request Body | Parameter | Type | Required | Description | | ---------------------- | ------ | -------- | --------------------------------------- | | `recipients` | array | Yes | Array of recipient objects (max 50,000) | | `recipients[].phone` | string | Yes | Phone number in international format | | `recipients[].message` | string | Yes | Message text for this recipient | ### Example Request ```json { "recipients": [ { "phone": "+222XXXXXXXX", "message": "Hello John, your order is ready!" }, { "phone": "+222YYYYYYYY", "message": "Hello Sarah, your order is ready!" } ] } ``` ### Success Response (202 Accepted) ```json { "success": true, "message": "Bulk batch created successfully", "batchId": "550e8400-e29b-41d4-a716-446655440000", "totalValid": 2, "totalInvalid": 0, "cost": 0.04, "totalParts": 2, "pricePerMessage": 0.02, "status": "processing" } ``` ### Error Responses **400 Bad Request - Validation Error** ```json { "success": false, "message": "Validation failed", "errors": [ { "path": ["recipients"], "message": "Array must contain at least 1 element(s)" } ] } ``` **402 Payment Required - Insufficient Balance** ```json { "success": false, "message": "Insufficient balance", "details": { "requiredAmount": 0.04, "validRecipients": 2, "invalidRecipients": 0 } } ``` **409 Conflict - Broadcast Not Created** Rare. Nothing was sent or charged; send it again. ```json { "success": false, "message": "This broadcast could not be created; nothing was sent or charged. Send it again." } ``` **400 Bad Request - No Valid Recipients** ```json { "success": false, "message": "No valid recipients found", "invalidRecipients": [ { "phone": "invalid", "reason": "Invalid phone number format" } ] } ``` ## Get Batch Status **GET /api/v2/bulk/status/:batchId** Retrieve the status of a bulk send batch. ### URL Parameters | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------------------------- | | `batchId` | string | Yes | The batch ID returned from the send request | ### Example Response ```json { "success": true, "batch": { "batchId": "550e8400-e29b-41d4-a716-446655440000", "status": "processing", "totalMessages": 100, "validMessages": 98, "invalidCount": 2, "successfulCount": 45, "failedCount": 5, "totalCost": 1.96, "totalParts": 100, "progress": 51, "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:31:30.000Z", "messages": [ { "messageId": "msg-123", "phone": "+222XXXXXXXX", "status": "sent", "cost": 0.02, "parts": 1 }, { "messageId": "msg-124", "phone": "+222YYYYYYYY", "status": "failed", "error": "Invalid destination address" } ] } } ``` ### Status Values | Status | Description | | ------------ | --------------------------------------------------------------------------- | | `pending` | Batch created, awaiting processing | | `scheduled` | Batch created with a future `scheduledAt`; sends automatically at that time | | `processing` | Messages are being queued and sent | | `completed` | All messages sent successfully | | `partial` | Some messages succeeded, some failed | | `failed` | All messages failed | A `failed` batch may carry a `failureReason`: `cancelled`, `insufficient_balance` when your balance could not pay for it, or `creation_abandoned` when it could not be created (in both cases nothing was sent or charged). ### Message Status Values | Status | Description | | --------- | --------------------------- | | `pending` | Message awaiting processing | | `queued` | Message queued for sending | | `sent` | Message sent successfully | | `failed` | Message failed to send | ## Rate Limits * Maximum **50,000 recipients** per batch for messages of up to one SMS part (\~160 characters ASCII / \~70 characters UCS-2) * Standard per-second API rate limits do not apply to bulk endpoints (see [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx#rate-limiting)) * A key can send **2 broadcasts per minute**. More return **429** with `retryAfter` (seconds). * When the gateway is already receiving several large broadcasts, it returns **503** with a `Retry-After` header (seconds). Nothing was created or charged; send the same request again after that delay. * A **500** with `code` `QUEUE_OUTCOME_UNKNOWN` carries a `batchId`: the broadcast was created and paid, and it is still sent, once. Check `GET /api/v2/bulk/status/:batchId` instead of sending it again. * The request body must arrive within 5 seconds plus 2 seconds per MB (45 seconds for 20 MB). A slower upload is answered **408**; nothing was created or charged. * Messages are queued and processed asynchronously The request body is also capped at **20 MB**, so multi-part or max-length messages reduce the effective batch size. As a rule of thumb, the body must satisfy `recipients × (encoded message bytes + ~40 bytes of per-recipient JSON overhead) ≤ 20 MB`, i.e. roughly `recipients ≈ (20 MB − overhead) / (encoded message length + ~40 bytes)`: * 50,000 recipients with 160-character single-part ASCII messages fit comfortably (\~10 MB) * Max-length messages (up to 2,000 encoded bytes) fit only \~10,000 recipients ## Phone Number Format See [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx#phone-number-formats) (SMS / Mauritania) for accepted phone number formats. ## Billing You are charged for every message we submit to the operator. The operator bills us on **reception**, not on acceptance, so a message it receives and then refuses is still billed. * **Sent** — the operator accepted the submission. Charged. * **Rejected** — the operator refused the submission, for example because the number is not a valid destination. **Charged**, because the operator billed us for it. * **Failed** — we never submitted the message: our gateway could not reach the operator, or your balance was insufficient. **Not charged**, and any charge already taken is refunded. Cost is per message, based on its length and encoding: a longer body, or non-GSM-7 text such as Arabic or emoji, splits into more parts, and a multi-part SMS is charged per part. Funds for the whole batch are deducted upfront when the batch is created. Messages addressed to a number the operator rejected as invalid within the last hour are not resubmitted, and are **not charged**. ## Code Examples ### JavaScript/Node.js ```javascript const response = await fetch('https://sms.chinqit.com/api/v2/bulk/send', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key_here' }, body: JSON.stringify({ recipients: [ { phone: '+222XXXXXXXX', message: 'Hello!' }, { phone: '+222YYYYYYYY', message: 'Hi there!' } ] }) }); const result = await response.json(); console.log(result.batchId); ``` ### Python ```python import requests response = requests.post( 'https://sms.chinqit.com/api/v2/bulk/send', headers={ 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key_here' }, json={ 'recipients': [ {'phone': '+222XXXXXXXX', 'message': 'Hello!'}, {'phone': '+222YYYYYYYY', 'message': 'Hi there!'} ] } ) result = response.json() print(result['batchId']) ``` ### PHP ```php [ ['phone' => '+222XXXXXXXX', 'message' => 'Hello!'], ['phone' => '+222YYYYYYYY', 'message' => 'Hi there!'] ] ]; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-API-Key: your_api_key_here' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); echo $result['batchId']; ``` ### cURL ```bash curl -X POST https://sms.chinqit.com/api/v2/bulk/send \ -H "Content-Type: application/json" \ -H "X-API-Key: your_api_key_here" \ -d '{ "recipients": [ {"phone": "+222XXXXXXXX", "message": "Hello!"}, {"phone": "+222YYYYYYYY", "message": "Hi there!"} ] }' ``` ## Polling for Status After sending a batch, poll the status endpoint every 2-5 seconds until the batch completes: ```javascript const checkStatus = async (batchId) => { const response = await fetch(`https://sms.chinqit.com/api/v2/bulk/status/${batchId}`, { headers: { 'X-API-Key': 'your_api_key_here' } }); const result = await response.json(); if (['completed', 'failed', 'partial'].includes(result.batch.status)) { console.log('Batch complete!', result.batch); return result.batch; } // Continue polling console.log(`Progress: ${result.batch.progress}%`); setTimeout(() => checkStatus(batchId), 2000); }; ``` ## Error Codes | Code | Description | | --------------------- | ----------------------------------------------------- | | `NO_CREDIT` | Insufficient balance | | `TOP_UP_REQUIRED` | New accounts send OTPs only until their first top-up. | | `BILLING_FAILED` | Billing transaction failed | | `INVALID_DESTINATION` | Invalid phone number format | | `QUEUE_ERROR` | Failed to queue message | ## Best Practices 1. **Validate phone numbers** before sending to avoid unnecessary costs 2. **Poll for status** to track message delivery 3. **Handle partial failures** - some messages may succeed while others fail 4. **Batch size** - Keep batches under 10,000 for optimal performance 5. **Retry logic** - Failed messages are automatically retried up to 4 times # Webhooks (https://docs.sms.chinqit.com/en/webhooks) Receive real-time notifications for messaging events by registering HTTPS endpoints. Base path: **`https://sms.chinqit.com/api/v2`**. ## Overview Webhooks let you register public HTTPS endpoints that ChinqIT pushes notifications to whenever an event occurs. Each endpoint has its own signing secret and can subscribe to any combination of events. Authentication and the base URL are documented in the [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx#authentication). *** ## Event catalog All notifications use the following envelope: ```json { "id": "evt_01j9z...", "type": "message.sent", "createdAt": "2026-06-27T10:00:00.000Z", "data": { ... } } ``` | Event | Trigger | | ------------------ | ----------------------------------------------------------------------------------- | | `message.sent` | Single SMS or OTP-SMS accepted by the carrier (successful submission) | | `message.rejected` | Single SMS or OTP-SMS the operator received but refused — **you were charged** | | `message.failed` | Single SMS or OTP-SMS our gateway could not submit to the carrier — **not charged** | | `bulk.completed` | Bulk job finished, with success/failure counts | | `otp.verified` | End user entered the correct OTP code | > **Note:** End-to-end delivery confirmation is not available (no carrier delivery receipts). There is therefore no `delivered` event. `message.sent`, `message.rejected`, and `message.failed` reflect only the **submission** outcome to the carrier. > > **Note — hard cut:** `message.sent` means the operator received the message and you were billed for it. `message.rejected` fires when the operator refused it after receiving it — usually billed, so check `data.billed` (it is `false` in the rare case ChinqIT blocks a known-invalid number before submission, which never reaches the operator). `message.failed` means the message **never reached the operator** and was **not charged** (or refunded if it had already been charged). If your integration previously relied on `message.failed` to detect rejections, you must now also subscribe to `message.rejected` — as of this change, a rejection no longer fires `message.failed`. > > **Note:** Bulk recipients do not emit per-message events. Only `bulk.completed` is emitted when the batch finishes processing. ### `message.sent` ```json { "id": "evt_01j9z...", "type": "message.sent", "createdAt": "2026-06-27T10:00:00.000Z", "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "phoneNumber": "+222XXXXXXXX", "senderId": "CHINQIT", "channel": "sms", "type": "message", "submittedAt": "2026-06-27T10:00:00.000Z" } } ``` ### `message.rejected` ```json { "id": "evt_01j9z...", "type": "message.rejected", "createdAt": "2026-06-27T10:00:03.000Z", "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "phoneNumber": "+222XXXXXXXX", "senderId": "CHINQIT", "channel": "sms", "type": "message", "billed": true } } ``` `data.billed` is authoritative: it is `true` when the operator received and refused the message (you were charged), and `false` in the rare case ChinqIT blocks a known-invalid number before submission (never reached the operator, not charged). ### `message.failed` ```json { "id": "evt_01j9z...", "type": "message.failed", "createdAt": "2026-06-27T10:00:05.000Z", "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "phoneNumber": "+222XXXXXXXX", "senderId": "CHINQIT", "channel": "sms", "type": "message", "failureReason": "The API key sender ID has expired. Remove it or renew the sender ID before sending SMS." } } ``` ### `bulk.completed` ```json { "id": "evt_01j9z...", "type": "bulk.completed", "createdAt": "2026-06-27T10:05:00.000Z", "data": { "batchId": "batch_01j9z...", "status": "completed", "totalMessages": 1000, "successfulCount": 985, "failedCount": 12, "invalidCount": 3, "totalCost": 9.85 } } ``` ### `otp.verified` For email OTPs, the payload contains `email` instead of `phoneNumber`. ```json { "id": "evt_01j9z...", "type": "otp.verified", "createdAt": "2026-06-27T10:02:00.000Z", "data": { "messageId": "550e8400-e29b-41d4-a716-446655440000", "phoneNumber": "+222XXXXXXXX", "verifiedAt": "2026-06-27T10:02:00.000Z" } } ``` *** ## Security ### HTTPS required All webhook endpoints must use HTTPS. HTTP URLs are rejected. ### Verifying the `X-Chinqit-Signature` header Every delivery includes the following headers: | Header | Description | | --------------------- | --------------------------------------------------------------- | | `X-Chinqit-Signature` | `t=,v1=` — timestamp and HMAC-SHA256 signature | | `X-Chinqit-Timestamp` | Unix timestamp in seconds (same value as `t=` in the signature) | | `X-Chinqit-Delivery` | Unique delivery-attempt identifier (idempotency key) | **Verification recipe:** ``` signature = HMAC_SHA256(secret, "${t}.${rawBody}") ``` 1. Extract `t` and all `v1` values from the `X-Chinqit-Signature` header. 2. Compute `HMAC_SHA256(secret, t + "." + rawBody)` using the raw (unparsed) request body. 3. Compare the result (hex) against each `v1` value. Accept if at least one matches. 4. Reject the request if `X-Chinqit-Timestamp` is outside your tolerance window (e.g. ±5 minutes) to protect against replay attacks. **Example (Node.js):** ```js import { createHmac, timingSafeEqual } from 'node:crypto'; function verifySignature(secret, rawBody, sigHeader, tsHeader, toleranceSec = 300) { const now = Math.floor(Date.now() / 1000); const ts = parseInt(tsHeader, 10); if (Math.abs(now - ts) > toleranceSec) return false; const parts = sigHeader.split(','); const t = parts.find(p => p.startsWith('t=')).slice(2); const v1s = parts.filter(p => p.startsWith('v1=')).map(p => p.slice(3)); const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex'); return v1s.some(v => { try { return timingSafeEqual(Buffer.from(v, 'hex'), Buffer.from(expected, 'hex')); } catch { return false; } }); } ``` ### Idempotency The `X-Chinqit-Delivery` header contains a stable identifier for the delivery — the **same value is reused across every retry attempt**. Treat it as an idempotency key to deduplicate events you receive more than once. *** ## Reliability ### Retries and exponential backoff On failure (non-2xx response or timeout), ChinqIT automatically retries delivery up to **8 times** using exponential backoff — retries are spaced progressively (1 min, 5 min, 30 min, 2 h, 5 h, 10 h, up to 24 h apart), spanning roughly 1.5–2 days in total. ### Auto-disable An endpoint is automatically disabled after **20 consecutive failures**. An alert is sent to your service administrator. You can re-enable the endpoint via the management API. ### Secret rotation with overlap window When you rotate a secret (`POST .../rotate-secret`), the old secret continues to sign deliveries for a **24-hour overlap window**. During this window, deliveries include two `v1=` values in the signature header — one signed with the old secret, one with the new. Accept if either one is valid. *** ## Management API All routes require the `X-API-Key` header. | Method | Endpoint | Description | | -------- | ------------------------------------- | --------------------------------------------------------------------- | | `POST` | `/api/v2/webhooks` | Create a webhook endpoint | | `GET` | `/api/v2/webhooks` | List the organisation's endpoints | | `GET` | `/api/v2/webhooks/{id}` | Get an endpoint | | `PATCH` | `/api/v2/webhooks/{id}` | Update an endpoint | | `DELETE` | `/api/v2/webhooks/{id}` | Delete an endpoint | | `POST` | `/api/v2/webhooks/{id}/rotate-secret` | Rotate the signing secret | | `POST` | `/api/v2/webhooks/{id}/reveal-secret` | Reveal the current signing secret (admin or owner, available anytime) | | `POST` | `/api/v2/webhooks/{id}/test` | Send a test delivery | | `GET` | `/api/v2/webhooks/{id}/deliveries` | View delivery history | **Create an endpoint (example):** ```bash curl -X POST https://sms.chinqit.com/api/v2/webhooks \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/chinqit", "events": ["message.sent", "message.failed", "otp.verified"] }' ``` **Request body fields:** * `url` *(required)* — the public HTTPS endpoint to deliver events to. * `events` *(required)* — array of event types to subscribe to. * `apiKeyIds` *(optional)* — restrict this endpoint to events triggered by specific API keys ("apps"). Omit or pass `[]` to receive events from **all** of your API keys. When set, only events from the listed keys are delivered to this endpoint. **Response:** ```json { "success": true, "webhook": { "_id": "665f1a2b3c4d5e6f7a8b9c0d", "userId": "6953a1b2c3d4e5f6a7b8c9d0", "url": "https://example.com/webhooks/chinqit", "events": ["message.sent", "message.failed", "otp.verified"], "status": "enabled", "secretPrefix": "whsec_ab12c…", "consecutiveFailures": 0, "createdAt": "2026-06-27T10:00:00.000Z", "updatedAt": "2026-06-27T10:00:00.000Z" }, "secret": "whsec_4f3c8e21a9b0c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2" } ``` > **Important:** The full `secret` (prefix `whsec_`) is only returned here at creation time and from `/rotate-secret` and `/reveal-secret`. Every other response exposes only `secretPrefix`. Store the full secret securely immediately. **Delivery history (pagination):** `GET /api/v2/webhooks/{id}/deliveries` accepts two query parameters: * `limit` *(optional)* — deliveries per page, from 1 to 200 (50 by default). * `cursor` *(optional)* — the opaque cursor from a previous response. The response adds `nextCursor`. It is `null` on the last page. To walk the whole history, send `nextCursor` as the `cursor` of the next request until you get `null`. The cursor is opaque: do not interpret it or build one yourself. ```bash # First page: the most recent deliveries curl "https://sms.chinqit.com/api/v2/webhooks/WEBHOOK_ID/deliveries?limit=50" \ -H "X-API-Key: YOUR_API_KEY" # Next page curl "https://sms.chinqit.com/api/v2/webhooks/WEBHOOK_ID/deliveries?limit=50&cursor=CURSOR_FROM_PREVIOUS_RESPONSE" \ -H "X-API-Key: YOUR_API_KEY" ``` ```json { "success": true, "deliveries": [{ "_id": "665f1a2b3c4d5e6f7a8b9c0e", "status": "succeeded", "eventType": "message.sent" }], "nextCursor": "WyIyMDI2LTA2LTI3VDEwOjAwOjAwLjAwMFoiLCI2NjVmMWEyYjNjNGQ1ZTZmN2E4YjljMGUiXQ" } ``` > An invalid `cursor` returns a `400`. Ignoring `nextCursor` is perfectly valid: the first page is identical to the one before this pagination was added. ### Managing endpoints in the dashboard On the **Webhooks** page of the dashboard, each endpoint appears as a card. Open an endpoint's menu (⋯) to edit it, send a test event, rotate its secret, disable or re-enable it, or delete it. Select the card to open its details panel: the signing secret, a table of recent deliveries (outcome, event, response code, duration, time) with a **Send test event** button, and an example payload for an event the endpoint receives. The panel's footer has **Edit** and **Rotate secret**; delete an endpoint from its card menu. Rotating asks for confirmation and keeps the current secret valid for the 24-hour overlap window. The full signing secret is shown once, when you create an endpoint or rotate its secret, so copy it at that point. The details panel keeps the secret masked and reveals it on request. An endpoint that ChinqIT disabled after repeated failures shows a warning on its card and in its details panel, with how many deliveries failed in a row and when the last one failed. Fix your server, then choose **Re-enable** from the card menu. *** ## See also * [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx) * [API Usage](https://docs.sms.chinqit.com/en/api-usage.mdx) # Analytics Dashboard (https://docs.sms.chinqit.com/en/analytics-dashboard) The analytics dashboard, opened from **Analytics** in the sidebar, gives you a time-ranged view of your messaging activity and spend. Both the admin dashboard (`/admin/analytics`) and the client dashboard (`/client/analytics`) use the same interface, scoped to the appropriate data: admins see platform-wide figures, clients see only their own API-key traffic. ## Time range selector Three preset ranges are available: **7 days**, **30 days**, and **90 days**. Selecting a range reloads all charts and stat cards. Buckets are daily for 7- and 30-day ranges, and weekly for 90 days. ## Stat cards Four cards appear at the top of the dashboard. | Card | What it shows | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | **Messages** | Messages sent in the period, across all channels (OTP, SMS, WhatsApp). | | **Delivery rate** | Delivered ÷ (delivered + platform failures), with its two counts ("3 delivered / 4 eligible"). Rejected numbers and pending messages are left out. | | **OTPs verified** | Share of the OTPs sent that were verified ("1 verified / 1 sent"). A dash when no OTP was sent. | | **Spent** | What your messages cost, net of refunds. The admin view shows **Message revenue** instead. | Internal SMS alerts (low-balance and header-expiration notices sent by the gateway) are ordinary SMS messages owned by the ChinqIT client key: they count as SMS usage and spend, attributed to the ChinqIT client in admin views. ## Delivery The four outcomes — delivered, failed, rejected and pending — with their totals for the period, above a daily (or weekly) stacked chart in the same colours as Home. ## Spending over time A chart of what you spent each day (or week), net of refunds, beside the list of **Funds added**: the money paid into the wallet (B-Pay top-ups and operator credits). Gifts such as the welcome credit and referral rewards are not counted, so the total matches what Payments collected. In the admin view the chart shows revenue, and both figures cover **all clients**. ## Messages by category A horizontal stacked-bar breakdown shows, for each channel (`otp`, `sms`, `whatsapp`), how many messages were delivered versus failed. The total message count for each channel appears on the right. Only channels with at least one message in the period are listed. ## Message flow A **Sankey diagram** visualises how messages move through the system. Flows go from left to right in two stages: **channel** (OTP / SMS / WhatsApp) → **outcome** (delivered / pending / failed / rejected). The width of each band is proportional to message volume; hover a band to see its count. Why messages failed is shown in the failure category split below, not as a third stage. ## Why messages fail When there are failed messages, a color-coded split bar and legend show why, broken into five categories: | Category | Meaning | Color | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------ | | **System** | A platform or gateway error caused the failure — the message never reached the carrier. These failures reduce your success rate. | Red | | **Recipient** | The destination number was unreachable, rejected the message, or is invalid. The fault is on the recipient side, not the platform. | Amber | | **Account** | The failure was caused by an account-level problem — for example, insufficient balance or an inactive API key. | Blue | | **Content** | The message was rejected because of its content — for example, a blocked sender header or a message body that violated carrier rules. | Purple | | **Unknown** | The failure could not be classified into one of the above categories. | Gray | Each category shows its share as a percentage and an absolute count. Recipient failures carry the note "Not your fault — numbers were wrong or unreachable.", and system failures "Refunded automatically." ## Export **Export** downloads the period as a CSV (`analytics-7d.csv`, `analytics-30d.csv` or `analytics-90d.csv`), one row per day or week with delivered, failed, pending, spend and funds added. A notification confirms the file name. ## API endpoint The dashboard calls one internal Next.js API route: ``` GET /api/analytics/summary?range=7|30|90 ``` Authentication is session-based (standard dashboard login). The `range` parameter accepts `7`, `30`, or `90`; any other value defaults to `30`. The response shape: ```json { "range": { "days": 30, "from": "...", "to": "...", "bucket": "day" }, "cards": { "messages": 1240, "successRate": 97, "moneySpent": 62.40, "moneyToppedUp": 100.00, "otpVerifiedRate": 84 }, "money": [ { "date": "2026-05-30", "spend": 2.10, "topup": 0 } ], "volume": [ { "date": "2026-05-30", "delivered": 40, "failed": 1, "pending": 0 } ], "otp": [ { "date": "2026-05-30", "sent": 30, "verified": 25 } ], "byCategory": [ { "category": "otp", "total": 900, "delivered": 880, "failed": 20 }, { "category": "sms", "total": 340, "delivered": 330, "failed": 10 } ], "failures": { "total": 30, "byCategory": [ { "category": "system", "count": 5, "pct": 17 }, { "category": "recipient", "count": 25, "pct": 83 } ] } } ``` `volume` and `otp` are dense: one entry per day (or week) in the range, zero-filled. `otp` counts the OTPs sent and verified in each bucket; the client home draws its OTPs verified trend from it. The old `/api/analytics/verify/*` endpoints (latency percentiles, by-country, by-operator, by-line-type, per-message drilldown) have been removed. Use `GET /api/analytics/summary` for all analytics needs. # Organisations and members (https://docs.sms.chinqit.com/en/organisations) An **organisation** is a shared workspace for your team. API keys, sender IDs, the balance, and sends belong to the organisation, not to one person. Every account also has a **personal organisation**, created with the account: it is your private space. Open **Manage organisations** from the selector at the top of the sidebar. ## Create an organisation Any approved client can create an organisation from the **Organisations** page. You become its owner and can invite people afterwards. ## Switch organisation The selector under your workspace name shows the active organisation and your role in it. Choose another organisation to make it active: every page (keys, sender IDs, sends, balance) then shows that organisation. ## Roles | Role | What it can do | | ---------- | ---------------------------------------------------------------------------------------------------------------------- | | **Owner** | Everything, including changing the role of another owner or an admin. An organisation always keeps at least one owner. | | **Admin** | Invite people, manage members, create and edit keys, run sends and top-ups. | | **Member** | Use the organisation's keys and sender IDs, and view the balance and history. | Actions that need an admin or owner are not offered to a member. ## Low balance When an organisation's balance runs out, its API keys are paused and you are alerted at most once a day: * **Owners and admins** (who can top up) get a dashboard notification and an email. * **Owners** also get an SMS. * **Members** are not alerted. You are also warned the same way, once, when the balance drops below the critical level (100 MRU today). That warning is sent only if the last top-up brought the balance to at least 30% above the critical level (130 MRU today), and so is the SMS above. No alert is sent to someone who turned notifications off. Opening the notification switches the dashboard to that organisation and shows its balance. Top up the organisation to resume. ## Invite people From the organisation page, open **Invitations** (owners and admins only). 1. Enter the person's email address and choose their role: **admin** or **member**. The owner role is never granted by invitation. 2. Send the invitation. The person receives an email with a link. 3. Pending invitations appear in the list with their expiry date. An invitation link expires after **7 days** and works once. The person must sign in with **the same email address** as the invitation to accept it. ## Manage members The members list shows each person's role. * An **owner** can change any member's role and remove anyone. * An **admin** can make a member an admin, or turn an admin back into a member, and can remove a member. An admin cannot change or remove another admin or an owner. Removing a member deletes nothing: keys, sender IDs, templates, and sends stay with the organisation. The person only loses access. ## Leave an organisation Any member can leave an organisation from its page. The last owner of an organisation cannot leave: make another person an owner first. # Troubleshooting Guide (https://docs.sms.chinqit.com/en/troubleshooting) Common issues and solutions when integrating with the ChinqIT Verify API. **Note:** Prefer the API v2 endpoints (`POST /api/v2/notify`, `POST /api/v2/code`, `POST /api/v2/check`, `GET /api/v2/notify/:messageId`). The legacy v1 endpoints are deprecated and include a `deprecation` object and `Deprecation: true` header in responses. **Server errors:** a server error answer (5xx) may include a `ref`. If it does, send it to support so we can find your request. ## 🔍 General Troubleshooting Steps 1. **Verify API Key**: Ensure your API key is correct and active 2. **Check Request Format**: Verify your request body matches the API specification 3. **Review Error Messages**: Check the error response for specific details 4. **Test Connectivity**: Ensure your application can reach `https://sms.chinqit.com` (v2: `https://sms.chinqit.com/api/v2/notify` for send) ## 🔐 Authentication Issues ### 401 Unauthorized - Missing API Key **Symptoms:** * 401 status code * "API key is required" error message **Solutions:** 1. **Verify Header Name** ```bash # Must be exactly: X-API-Key (case-sensitive) curl -H "X-API-Key: your-key" https://sms.chinqit.com/api/v2/notify ``` 2. **Check Header Format** ```javascript // Correct headers: { 'X-API-Key': 'your-api-key' } // Incorrect - missing hyphen headers: { 'X_API_Key': 'your-api-key' } ``` 3. **Verify API Key is Included** * Check that your API key is being sent in every request * Ensure no middleware is stripping the header ### 403 Forbidden - Invalid API Key **Symptoms:** * 403 status code * "Invalid API key" error message **Solutions:** 1. **Verify API Key** * Open **API keys** in the dashboard and check that the key is active; choose **Activate** if it was deactivated * Check for typos or extra spaces in your API key * Ensure you're using the correct API key for your environment 2. **Check API Key Format** ```bash # Ensure no extra spaces or characters # Correct: "abc123xyz" # Incorrect: " abc123xyz " or "abc123xyz\n" ``` 3. **Regenerate API Key** * If your API key has been compromised, choose **Regenerate key** on it under **API keys** in the dashboard (the old key stops working immediately), or create a new key there ## 📝 Validation Errors ### 400 Bad Request - Validation Error **Symptoms:** * 400 status code * "Validation failed" message with error details **Common Validation Errors:** **Missing Required Field:** ```json { "success": false, "message": "Validation failed", "errors": [ { "path": ["phoneNumber"], "message": "Required" } ] } ``` **Invalid Phone Number Format:** ```json { "success": false, "message": "Validation failed", "errors": [ { "path": ["phoneNumber"], "message": "Invalid phone number format" } ] } ``` **Solutions:** 1. **Verify Request Body** ```json // Correct format for sending SMS { "phoneNumber": "+1234567890", "message": "Your message here" } // Correct format for sending OTP { "phoneNumber": "+1234567890", "language": "en", "channel": "sms" } ``` 2. **Check Phone Number Format** * Must include country code with `+` prefix * Examples: `+1234567890`, `+33123456789` * No spaces or special characters except `+` 3. **Verify Message Content** * Message must be at least 1 character * OTP must be 4 to 8 digits (6 by default) 4. **Check Channel Value** * For OTP: `channel` must be `"sms"` or `"whatsapp"` (lowercase) * Defaults to `"sms"` if omitted ## 📊 Rate Limiting ### 429 Too Many Requests **Symptoms:** * 429 status code * "Rate limit exceeded" error message **Rate Limits:** * OTP sending: the per-minute, per-hour and per-day limits ChinqIT sets on each API key (per recipient). Without a custom limit, the maximum applies: 60 per minute, 1,000 per hour, 5,000 per day. **Solutions:** 1. **Implement Exponential Backoff** ```javascript async function sendOTPWithRetry( phoneNumber, language, channel, maxRetries = 3, ) { for (let i = 0; i < maxRetries; i++) { try { return await client.sendOTP(phoneNumber, language, channel); } catch (error) { if (error.status === 429 && i < maxRetries - 1) { // Wait with exponential backoff const waitTime = Math.pow(2, i) * 1000; // 1s, 2s, 4s await new Promise((resolve) => setTimeout(resolve, waitTime)); continue; } throw error; } } } ``` 2. **Respect Rate Limits** * Track your request frequency * Implement client-side rate limiting * Wait before retrying after 429 errors 3. **Use Different Phone Numbers** * Rate limits are per phone number * If testing, use different phone numbers to avoid hitting limits ## 💳 Insufficient Balance ### 402 Payment Required **Symptoms:** * HTTP 402 status code * Error message `"Insufficient balance"` * `messageId` field present in the response Only WhatsApp, email and broadcast requests return **402**. An SMS your balance cannot cover is not sent, not charged, and shows `failed`. **Solutions:** 1. **Check your account balance** * Log in to the ChinqIT Verify dashboard * Open **Wallet** in the menu to review your balance and transaction history 2. **Top up your account** * Open **Wallet** and select **Top up**, then enter the amount (50 to 100,000 MRU) * Pay in the Bankily app with the merchant code and the amount shown on the checkout; the guide shows each screen * Back in the dashboard, enter your Bankily phone number and the B-Pay passcode Bankily shows, then confirm * If an earlier top-up is still in progress, the checkout says so first: **Resume verification** continues that same payment, and **Start over** (offered only while it is unpaid) cancels it so you can enter a new amount * If Bankily confirms the payment later, use **Recheck** on the top-up's row in the Wallet transactions (or **Recheck with bank** in its details) to credit it * If Bankily never took the money, open the failed top-up and choose **Try again** to start a new top-up; its details show the bank's status as Success, Failed or Pending 3. **Retry after top-up** * API keys are reactivated automatically after a successful **BPAY payment** or **admin balance credit** (not after referral rewards or SMS refunds) * Only the keys switched off because the balance ran out come back on. On the **API keys** page they show **Paused · no balance**, and their menu offers **Top up to resume**. A key you deactivated yourself shows **Inactive** and stays off until you activate it, and so does a key switched off with a disabled account * If you still receive **403** `"Invalid or inactive API key"`, wait up to 60 seconds for cache propagation (ensure the dashboard shares Redis with the SMS gateway) or contact support 4. **Contact support** * If the issue persists after a top-up, contact ChinqIT Verify support * Provide your account identifier and transaction details ### Free trial * **403** `TOP_UP_REQUIRED`: new accounts send OTPs only until their first top-up. Top up once to send other messages. * **429** `TRIAL_LIMIT`: free trial limit reached. Top up to send more. * **403** `TRIAL_PAUSED`: free trial sending is paused. Top up to continue. ### 503 Service Unavailable - Sending temporarily unavailable **Symptoms:** * HTTP 503 status code on a send (SMS, OTP, WhatsApp OTP or bulk) * `errorCode` field set to `PRICING_NOT_CONFIGURED` * Message `"Sending is temporarily unavailable. Please try again later or contact support."` **What it means:** ChinqIT Verify refused the message before sending it, because the price for that message type is temporarily unavailable. Nothing was sent and nothing was charged. **Solutions:** 1. Retry after a few minutes; our team is alerted automatically. 2. If it continues, contact ChinqIT Verify support with the time of the request. ### Finding a message in the Message log The **Message log** opens on the last 7 days. To search or export older messages, choose **All time** in the period control (or set **Custom dates**). **Clear all** removes every filter and returns the log to the last 7 days. **Export** includes every message that matches the current filters and period. The search takes a phone number or a message ID. Click a row to open its details: the origin (**API** or **Broadcast**), the cost, and a timeline of what happened to the message. A failed message says why in one sentence and what to do next: for example, that the operator refused the number and you should check it with your customer, or that your balance was too low, with a **Top up** button. Quote the message ID shown at the top of the details when you contact support. ### BPay top-up still processing A submitted top-up stays locked while its bank outcome is uncertain. Keep the top-up dialog open for automatic checks, or use **Recheck**. These checks do not submit another payment. If they stop without a conclusive result, contact support with the operation ID; do not pay a second time for the same attempt. Only bank confirmation can authorize automated wallet credit. A timeout or screenshot is not that confirmation. Only an unsubmitted draft can be cancelled: it does not yet have a Bankily phone number, and cancellation is not a bank failure. A payment held for manual review must be investigated by support. ### Rejected and failed messages A **rejected** message reached the operator, which refused it — most often because the recipient number is not a valid destination. The operator bills us for every submission it receives, so a rejected message **is charged**. Its cost appears normally in the dashboard and in the CSV export. A **failed** message never reached the operator. Our gateway could not submit it, or your balance was insufficient. It is **not charged**; any charge already taken is refunded, shown as a struck-through cost with a **Refunded** badge, and exported as `Refunded=Yes`. If you see a run of rejected messages, check the recipient numbers. A high rejection rate is almost always a stale contact list rather than a platform fault. ### Invalid recipients are not refunded Invalid-destination rejections (`ESME_RINVDSTADR`) are billed rather than refunded, like any other rejection: the operator charges us for every submission it receives, including the ones it rejects, so we pass that cost on. These messages show `status: rejected` with **Refunded** set to `No`. If the same number is rejected again within the hour, the message is **not** resubmitted and **not** charged — you pay at most once per hour for a dead number. Verification codes (OTP) are always submitted and never suppressed. ## 📱 WhatsApp Channel Issues ### 502 Bad Gateway - WhatsApp Provider Error **Symptoms:** * 502 status code * "WhatsApp OTP send failed" error message * `errorCode`: `WHATSAPP_SEND_FAILED` **Solutions:** 1. **Check Phone Number Format** * WhatsApp requires phone numbers in E.164 format with country code * Example: `+1234567890` (not `1234567890`) 2. **Implement Fallback to SMS** ```javascript async function sendOTPWithFallback(phoneNumber, language) { try { // Try WhatsApp first return await client.sendOTP(phoneNumber, language, "whatsapp"); } catch (error) { if (error.status === 502) { // Fallback to SMS if WhatsApp fails console.log("WhatsApp failed, falling back to SMS"); return await client.sendOTP(phoneNumber, language, "sms"); } throw error; } } ``` 3. **Handle Provider Errors Gracefully** * WhatsApp provider errors are temporary * Implement retry logic with SMS fallback * Log errors for monitoring 4. **Verify WhatsApp Service Availability** * Contact ChinqIT Verify support if WhatsApp channel is consistently failing * Check if WhatsApp service is temporarily unavailable ## ✉️ Email Channel Issues ### 400 Bad Request - EMAIL\_SUPPRESSED **Symptoms:** * 400 status code * `errorCode`: `EMAIL_SUPPRESSED` The address bounced earlier or its owner reported spam, so we no longer send to it. Nothing is sent and you are not charged. **Solutions:** * Ask the user for another email address. * Check the address for typos before you send. ## 🔄 Common Integration Issues ### Messages Not Being Sent **Symptoms:** * Request succeeds but message not received * No error but no delivery confirmation **Solutions:** 1. **Verify Phone Number** * Ensure phone number is correct and active * Check country code is correct * Verify recipient can receive SMS 2. **Check Message Content** * Ensure message is not empty * Verify special characters are properly encoded * Check message length (standard SMS limits apply) 3. **Handle Asynchronous Processing** * Messages are queued and processed asynchronously * API returns immediately after queuing * Delivery may take a few seconds to minutes ### OTP Verification Failing **Symptoms:** * OTP sent successfully but verification fails * "Invalid OTP" or "OTP not found" errors **Solutions:** 1. **Check OTP Expiration** * OTPs expire after 10 minutes by default * Ensure user enters OTP promptly * Request new OTP if expired 2. **Verify OTP Format** * OTP must be 4 to 8 digits (6 by default) * No spaces or special characters * Example: `"123456"` (not `"123 456"` or `"123-456"`) 3. **Check Retry Limit** * Maximum 3 verification attempts per OTP by default * After the last failed attempt, OTP is invalidated * Request new OTP if retry limit exceeded 4. **Match Channel** * If OTP was sent via WhatsApp, verify with `channel: "whatsapp"` * If OTP was sent via SMS, verify with `channel: "sms"` (or omit, defaults to SMS) 5. **Handle Case Sensitivity** * Phone number must match exactly (including `+` prefix) * Ensure phone number format is consistent between send and verify ## 🌐 Network Issues ### Connection Timeout **Symptoms:** * Request times out * Network errors **Solutions:** 1. **Check Internet Connection** * Verify your application has internet access * Test connectivity to `https://sms.chinqit.com` 2. **Implement Timeout Handling** ```javascript const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout try { const response = await fetch("https://sms.chinqit.com/api/v2/notify", { signal: controller.signal, // ... other options }); clearTimeout(timeoutId); } catch (error) { if (error.name === "AbortError") { console.error("Request timeout"); } } ``` 3. **Retry Logic** * Implement retry logic for transient network errors * Use exponential backoff * Don't retry on 4xx errors (client errors) ### SSL/TLS Errors **Symptoms:** * SSL certificate errors * TLS handshake failures **Solutions:** 1. **Verify HTTPS** * Always use `https://sms.chinqit.com` (not `http://`) * Ensure your environment supports TLS 1.2+ 2. **Check Certificate** * Ensure system clock is correct * Update CA certificates if needed * Contact ChinqIT Verify if certificate issues persist ## 🐛 Debugging Tips ### Enable Request Logging **JavaScript:** ```javascript async function sendMessage(phoneNumber, message) { console.log("Sending message:", { phoneNumber, message }); try { const response = await fetch("https://sms.chinqit.com/api/v2/notify", { method: "POST", headers: { "Content-Type": "application/json", "X-API-Key": process.env.API_KEY, }, body: JSON.stringify({ phoneNumber, message }), }); console.log("Response status:", response.status); const data = await response.json(); console.log("Response data:", data); return data; } catch (error) { console.error("Error:", error); throw error; } } ``` **Python:** ```python import requests import logging logging.basicConfig(level=logging.DEBUG) def send_message(phone_number, message): url = 'https://sms.chinqit.com/api/v2/notify' headers = { 'Content-Type': 'application/json', 'X-API-Key': os.getenv('API_KEY') } data = { 'phoneNumber': phone_number, 'message': message } logging.debug(f'Sending request: {data}') response = requests.post(url, json=data, headers=headers) logging.debug(f'Response status: {response.status_code}') logging.debug(f'Response data: {response.json()}') return response.json() ``` ### Test API Connectivity ```bash # Test basic connectivity curl -X POST https://sms.chinqit.com/api/v2/notify \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phoneNumber": "+1234567890", "message": "Test"}' ``` ## 🆘 Still Having Issues? 1. **Check Documentation:** * [API Reference](https://docs.sms.chinqit.com/en/api-v2.mdx) - Current API | [API v1 Reference (Deprecated)](https://docs.sms.chinqit.com/en/api-reference.mdx) - Legacy endpoints * [API Usage Guide](https://docs.sms.chinqit.com/en/api-usage.mdx) - Code samples and examples 2. **Review Error Responses:** * Check the `message` field for specific error details * Review `errors` array for validation issues * Note the HTTP status code 3. **Common Solutions:** * Verify API key is correct and active * Check request format matches API specification * Ensure phone numbers are in E.164 format * Implement proper error handling and retry logic * Contact ChinqIT Verify support for persistent issues *** **Need more help?** Contact ChinqIT Verify support with: * Your API key (masked) * Error message and status code * Request details (without sensitive data) * Steps to reproduce the issue # Support tickets and notifications (https://docs.sms.chinqit.com/en/support) Get help from the ChinqIT Verify team, follow your requests, and stay informed about service announcements. ## Contact channels * **Support tickets**: **Help & support → Open a ticket** in the dashboard. * **WhatsApp**: [+222 38 08 93 36](https://wa.me/22238089336). ## Open a support ticket Pick a category (Billing, Technical, Account, Sender ID, Other), give a clear subject, and describe the problem. Support replies in the same conversation. You get a notification as soon as a reply is published, and the ticket status follows the progress of your case. ## Follow your tickets Each ticket shows its status (Open, In progress, Waiting on you, Resolved, Closed), the number of messages in the conversation and the time of the last activity. Use the filters or the search box to find a request faster. Opening a ticket shows the conversation first, then its details (status, category, opening date, last update) and the WhatsApp shortcut for urgent questions. If the status becomes **Waiting on you**, support is waiting for information from you: reply directly in the conversation to resume processing. ## Notifications Every support reply and every status change on your tickets generates a notification. The **Notifications** page in your client area gathers them, marks unread items and lets you mark them as read. Service announcements from the ChinqIT team (planned maintenance, new features) reach every active client in the same inbox, in your language when a translation is provided. They stay available until they expire, 30 days after publication at the latest. Notifications and account emails are written in your account's language: the one you signed up in, or the one you choose in **Settings → Preferences**. # Service Level Agreement (https://docs.sms.chinqit.com/en/sla) ChinqIT Verify is committed to the availability commitment below. ## The commitment The ChinqIT Verify platform targets **≥99.9% monthly availability**, measured at the public Messaging API — the interface your systems call. When the API is reachable and responding, the platform counts as available. ## How availability is measured Availability is measured by independent external monitors running outside our infrastructure. We do not measure our own availability. ## Exclusions The following never count against availability: * Scheduled maintenance announced at least 48 hours in advance on the [status page](https://status.chinqit.com) * Force majeure events * Customer- or carrier-side conditions: invalid or nonexistent recipient numbers, phones switched off, subscriber absent, or carrier faults. Individual messages rejected for recipient reasons do not constitute unavailability. ## Reporting * Live status: [status.chinqit.com](https://status.chinqit.com) * Measured monthly uptime and incident history are published on the status page. This page is a published operational commitment, not a contractual penalty SLA.