pChat App (Web Sender)

pChat is the included web sender app. It can send via SMS/WhatsApp/Telegram/email/notify and also supports a private web-to-web channel (pchat) backed by the relay.

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

PCHAT Messaging Endpoints

These endpoints power the pChat web-to-web channel. They require the same auth header as the send API: Authorization: Bearer CLIENT_API_KEY.

Send (channel=pchat)
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 pChat Message

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

{
  "phone_id": "phone_main",
  "channel": "pchat",
  "to": "16hexchataddressofrecipient",
  "text": "hello",
  "source": "16hexchataddressofsender",
  "idempotency_key": "pchat-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 the pChat UI 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 }