Connect a phone by QR code in Channels and activate a plan.
In Developer access, create a public phone API key. Copy it once and store it securely. Creating another key revokes the previous one; the provider connection is unaffected.
Send a request with x-api-key. Use an assistant key only for /chat.
Numbers use international digits (8–15 digits), optionally with a leading +. JSON endpoints require Content-Type: application/json; media uses multipart/form-data and accepts JPEG, PNG, WebP or MP4 up to 10 MiB.
Rate limits: 60 v1 requests per minute per API key (or IP without a key). OTP issue is additionally limited to five requests per number per 10 minutes and 30 per device per hour. Campaign messages consume quota when each recipient is sent.
Message states are pending, accepted, sent, delivered, read, failed or unknown. Providers may skip intermediate states; status never moves backward. An unknown outcome may still be delivered.
Supply Idempotency-Key on sends, OTP issue, campaigns, and chat. Repeating the same payload returns the original result for 24 hours. A changed payload or pending request returns 409. A timeout can mean the provider accepted the send: do not automatically retry with a new key.
OTP is a device-and-number-bound, single-use code valid for five minutes with at most five verification attempts. It does not log users into SmarticBot.
Customer webhooks
Available for paid phone plans. Enable a webhook URL in phone settings, then create a signing secret in Developer access. Each delivery includes X-Webhook-ID, X-Webhook-Timestamp, X-Webhook-Key-Version and X-Webhook-Signature. Verify the hex HMAC-SHA256 signature over timestamp + "." + the exact raw JSON body. Deduplicate by event ID. Retries preserve the body and signing version.
Events include device_status_updated and message_status_updated. Provider callbacks are private; there is no public status-update endpoint.
Responses, limits & migration
Success has success=true and a data object. Errors have success=false with code, message, and details. Validation uses 422; bad keys 401; exhausted assistant credits 402; inactive plans 403; disconnected devices or idempotency conflicts 409; rate or quota limits 429; provider rejection 502; uncertain outcomes 503.
Legacy keys tied to provider identities are accepted for no more than 30 days after migration and can be revoked sooner. Create separate public keys now. The old public device/message status-update endpoints are removed. Campaign recipients are now a JSON array and scheduled_at must include a timezone offset. request_id is not used.
Operational health is available separately at /api/health; it is not a customer-authenticated v1 endpoint.
Send a turn to an assistant using an assistant key
POST/api/v1/chat
Each assistant has its own API key. The key in x-api-key selects that assistant. Reuse session_id for follow-up turns: the last 10 successful turns from this assistant and session in the previous 30 days are sent as context. Use a new value for a new conversation; send turns for one session sequentially. Prior context consumes input tokens and may increase credits used. A phone key cannot call this endpoint.
Request fields
Field
Type
Required
session_id
string · max 128
Yes
message
string · max 4096
Yes
Possible HTTP statuses
200401402403409422503
Response data fields
Field
Type
Required
reply
string
Yes
tokens
integer
Yes
credits_used
integer
Yes
Request
curl -X POST https://smarticbot.com/api/v1/chat \
-H 'x-api-key: YOUR_PUBLIC_ASSISTANT_KEY' \
-H 'Content-Type: application/json' \
-d '{
"session_id": "customer-42",
"message": "What are your opening hours?"
}'
Success response
{
"success": true,
"data": {
"reply": "We are open 9–5.",
"tokens": 120,
"credits_used": 2
}
}