Send Client Message

POST /tenants/{tenant}/clients/{client}/messages

Sends an SMS or WhatsApp message from the practice's number to one of the client's numbers or one of its contacts' (matched by phone lookup key; any other number is a 400). Free text (body), on WhatsApp a template (contentSid + contentVariables), or a practice text template (templateCode: rendered here for the client and the contact holding the number, and sent as free text; 400 when it does not exist or is not for the channel), exactly one. The message is stored at once from the Messaging Service's answer and returned as 201; its delivery status then follows from the service's events. A provider refusal is still a 201, with status Failed and errorCode/errorMessage. The conversation is matched to the client (and to the contact when one of the client's contacts holds the number) unless it is already matched. 409 when messaging is off or not set up, when the number has opted out, or for WhatsApp free text more than 24 hours after the recipient's last WhatsApp message (send a template); the service's text is passed through. 503 when the service or Twilio is unavailable.

Requires: Create on Messaging.

Parameters

NameTypeDescription
tenant* path string

The Tenant.Code

The Tenant.Code

client* path string
{
  "channel": "Sms",
  "body": "string",
  "contentSid": "string",
  "contentVariables": {},
  "templateCode": "string",
  "to": "string"
}

Responses

400 Bad Request
401 Unauthorized – Invalid or missing API key
403 Forbidden – the caller lacks the permissions this endpoint requires; the detail lists every one missing
application/problem+json
404 Not Found
409 Conflict
503 Service Unavailable