Prepare the recipient
Use an international phone number and confirm the workspace is allowed to contact the recipient for this purpose.
Send a transactional text or approved WhatsApp template while respecting consent, reply windows, and delivery state.
messages:sendUse an international phone number and confirm the workspace is allowed to contact the recipient for this purpose.
Use text only while the reply window is open. Use an approved template when the window is closed or the communication policy requires it.
Generate one unique value for the intended message and reuse it only when retrying that exact request.
Store the returned message_id and conversation_id so later synchronization can match the accepted message.
Queued means accepted for processing. Read conversation messages to observe provider delivery information when available.
These are the supported public contracts for this integration step.
/api/public/v1/messagesmessages:sendQueue a WhatsApp text or approved template message for a recipient.
POST /api/public/v1/messages
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"to": "+15551230000",
"type": "template",
"kind": "transactional",
"template": {
"template_id": "appointment_confirmation",
"variables": { "name": "Sample Patient", "time": "10:30 AM" }
},
"idempotency_key": "9ac86af7-43f5-4b5d-a1e2-2b57a0743324"
}{
"message_id": "msg_example",
"conversation_id": "conv_example",
"status": "queued"
}validation errorCheck the recipient, type, content, and idempotency key.
INSUFFICIENT_SCOPECreate a key with messages:send.
CONSENT_BLOCKEDDo not retry until the recipient has valid consent for this message.
WINDOW_CLOSEDUse an approved template when the customer-service window is closed.
RATE_LIMITEDWait for the next minute and retry with the same idempotency key.
Requests go directly from this browser tab to the API environment you choose. Keys and responses are held in memory only and are cleared when the page closes.
/api/public/v1/messagesEnter a test key, review the sample request, and send it. The response will appear here.
curl -X POST 'https://api.connect.globalclinic.app/api/public/v1/messages' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data '{
"to": "+15551230000",
"type": "template",
"kind": "transactional",
"template": {
"template_id": "appointment_confirmation",
"variables": { "name": "Sample Patient", "time": "10:30 AM" }
},
"idempotency_key": "9ac86af7-43f5-4b5d-a1e2-2b57a0743324"
}'messages:sendQueue a WhatsApp text or approved template message for a recipient.