Emails
Use POST /v1/emails/send to email one client from your own system, for example a booking confirmation from your website or a follow-up after a phone call. The email is sent from your account's sending address and domain and uses your email credits, the same way emails from automations do.
- Who receives it: pass the
idof an existing client, or theirname,emailandphone. With a phone number, the client with that exact number is used (if several clients share it, the one with the same name); if none is found, a new client is created. Creating a client needs the CRM Suite add-on. A client's existing email address is never replaced: the email goes to the address on file. - Content:
subject(up to 200 characters) and an HTMLbody(up to 10,000 characters). Client personalisation variables such as{{client.fullName}}are filled in. - Category: always transactional (reminders, confirmations, receipts). No unsubscribe link is added. Marketing email belongs in email broadcasts.
- When: now, or at
scheduleDateTime(ISO 8601). - Team copies: up to 5 addresses in total in
cc(visible to the client) andbcc(hidden).
The request returns as soon as the email is queued; id identifies the queued send.
API region
api.whautomate.comSend an Email to a Client
POST
/v1/emails/sendHeaders
x-api-keystringrequiredYour Whautomate API key.
Body
locationobjectrequiredThe workspace sending the email.
clientobjectrequiredEither id of an existing client, or name, email and phone to find or create one by phone number.
subjectstringrequiredUp to 200 characters.
bodystringrequiredHTML, up to 10,000 characters. Client personalisation variables are applied.
categorystring (enum)One of:
transactional.scheduleDateTimestringISO 8601 date and time to send. Omit to send now.
ccstring[]Team copies the client can see. Up to 5 addresses together with bcc.
bccstring[]Team copies the client cannot see. Up to 5 addresses together with cc.
Response 200
successbooleanidstringID of the queued send.
clientIdstringThe client the email goes to.
clientCreatedbooleanTrue when a new client was created.
Request
curl -X POST "https://api.whautomate.com/v1/emails/send" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location": { "id": "LOCATION_ID" },
"client": {
"name": "Jane Tan",
"email": "jane@example.com",
"phone": { "countryCode": "+65", "number": "98765432" }
},
"subject": "Your consultation summary",
"body": "<p>Hi {{client.fullName}},</p><p>Thanks for calling us today.</p>",
"bcc": ["frontdesk@example.com"]
}'
Response 200
{
"success": true,
"id": "string",
"clientId": "string",
"clientCreated": false
}
Errors
| Status | Error | Meaning |
|---|---|---|
| 400 | Invalid parameters | A required field is missing, the subject or body is too long, or the category is not transactional. |
| 400 | cc and bcc must be lists of up to 5 email addresses in total | Check the cc and bcc lists. |
| 400 | No Email credits available | Your account has no email credits left. |
| 400 | Client has no email address | The client given by id has no email address. |
| 403 | This feature is not included in your plan. | A new client would be created, which needs the CRM Suite add-on. |
| 404 | Invalid Location / Invalid Client | The location or client is not in your account. |