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
Headers
x-api-keystringrequired
Your Whautomate API key.
Body
locationobjectrequired

The workspace sending the email.

clientobjectrequired

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

subjectstringrequired
Up to 200 characters.
bodystringrequired
HTML, up to 10,000 characters. Client personalisation variables are applied.
categorystring (enum)
One of: transactional.
scheduleDateTimestring
ISO 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
successboolean
idstring
ID of the queued send.
clientIdstring
The client the email goes to.
clientCreatedboolean
True 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​

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.