Skip to main content

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 id of an existing client, or their name, email and phone. 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 HTML body (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) and bcc (hidden).

The request returns as soon as the email is queued; id identifies the queued send.

API regionapi.whautomate.com

Send an email to a client​

POST /v1/emails/send

Queues a transactional email to one client.

Headers
x-api-keystringrequired
Your Whautomate API key.
Body
locationobjectrequired
clientobjectrequired

Either { id } of an existing client, or { name, phone, email } to find or create one by phone number.

subjectstringrequired
bodystringrequired
HTML. {{client.*}} personalisation is applied.
categorystring (enum)
One of: transactional.
scheduleDateTimestring
ccstring[]
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
successboolean
idstring
clientIdstring
clientCreatedboolean
Errors
StatusErrorMeaning
400Invalid parametersA required field is missing, the subject or body is too long, or the category is not transactional.
400cc and bcc must be lists of up to 5 email addresses in totalCheck the cc and bcc lists.
400No Email credits availableYour account has no email credits left.
400Client has no email addressThe client given by id has no email address.
403This feature is not included in your plan.A new client would be created, which needs the CRM Suite add-on.
404Invalid Location / Invalid ClientThe 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
}