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/sendQueues a transactional email to one client.
Headers
x-api-keystringrequiredYour Whautomate API key.
Body
locationobjectrequiredclientobjectrequiredEither { id } of an existing client, or { name, phone, email } to find or create one by phone number.
subjectstringrequiredbodystringrequiredHTML. {{client.*}} personalisation is applied.
categorystring (enum)One of:
transactional.scheduleDateTimestringccstring[]Team copies the client can see. Up to 5 addresses with bcc.
bccstring[]Team copies the client cannot see. Up to 5 addresses with cc.
Response 200
successbooleanidstringclientIdstringclientCreatedbooleanErrors
| 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. |
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": "string"
},
"client": {
"id": "string",
"name": "string",
"email": "string",
"phone": {
"countryCode": "string",
"number": "string"
}
},
"subject": "string",
"body": "string",
"category": "transactional",
"scheduleDateTime": "string",
"cc": [
"string"
],
"bcc": [
"string"
]
}'
Response 200
{
"success": true,
"id": "string",
"clientId": "string",
"clientCreated": true
}