WebChat App

WebChat is the included browser app and direct WebChat channel. It gives the AI phone agent one place to send and receive: direct WebChat messages, plus phone-routed SMS, WhatsApp, Telegram, email, and local notify through the user’s connected phone.

Open The App

Open the sender app from the site:

In the app settings, set:
1) Server URL = the hosted relay URL shown on Setup QR / portal
2) API Key = CLIENT_API_KEY
3) Phone ID = your PHONE_ID

WebChat Messaging Endpoints

These endpoints power the direct WebChat channel. They require the same auth header as the send API: Authorization: Bearer CLIENT_API_KEY.

Send WebChat message
POST /api/v1/messages
Poll incoming
POST /api/v1/webchat/poll
Presence (online list)
POST /api/v1/webchat/presence
Mark read
POST /api/v1/webchat/read
Receipt status
POST /api/v1/webchat/receipt-status
Keep your credentials private. If you suspect compromise, rotate/revoke keys and reconfigure clients/phones.

Send A WebChat Message

POST /api/v1/messages
Authorization: Bearer CLIENT_API_KEY
Content-Type: application/json

{
  "phone_id": "phone_main",
  "channel": "webchat",
  "to": "16hexchataddressofrecipient",
  "text": "hello",
  "source": "16hexchataddressofsender",
  "idempotency_key": "webchat-001"
}

Poll Incoming

POST /api/v1/webchat/poll
Authorization: Bearer CLIENT_API_KEY
Content-Type: application/json

{ "phone_id": "phone_main", "chat_address": "your16hex...", "limit": 20 }

Presence

POST /api/v1/webchat/presence
Authorization: Bearer CLIENT_API_KEY
Content-Type: application/json

{ "chat_address": "your16hex...", "display_name": "Alice", "visible": true }

Read Receipts

POST /api/v1/webchat/read
Authorization: Bearer CLIENT_API_KEY
Content-Type: application/json

{ "chat_address": "your16hex...", "message_ids": ["msg_...","msg_..."] }

Sent Receipt Status

POST /api/v1/webchat/receipt-status
Authorization: Bearer CLIENT_API_KEY
Content-Type: application/json

{ "message_ids": ["msg_...","msg_..."] }

Optional: File Upload

Used by WebChat for attachments and voice notes.

POST /api/v1/webchat/upload
Authorization: Bearer CLIENT_API_KEY
Content-Type: multipart/form-data

file=@/path/to/file
// response includes:
{ "success": true, "url": "/api/v1/webchat/files/<file_id>", "size": 12345 }