Skip to Content
Type of MessagesCall-to-Action

Call-to-Action

Sends a Call-to-Action (CTA) WhatsApp message to a recipient. This message type is ideal for guiding users to take a specific action outside WhatsApp, such as visiting a website, booking an appointment, or completing a task.

Common use cases:

  • Booking demos or consultations
  • Scheduling or rescheduling appointments
  • Completing payments or checkouts
  • Accessing support or help centers
  • Continuing onboarding or verification flows
WhatsApp text message example

URL

https://api.messagesmart.nl/api/v1/whatsapp/messages/cta

Headers

See Authentication.


Request body

FieldTypeRequiredNotes
whatsAppBusinessIdstringYesCan be collected from the dashboard or provided via webhook
whatsAppBusinessPhoneNumberIdstringYesCan be collected from the dashboard or provided via webhook
tostringYesRecipient phone number in E.164 format
headerTextstringYesHeader text shown above the message
bodystringYesMain message text
buttonTextstringYesText shown on the CTA button
urlstringYesURL opened when the button is clicked

Examples

{ "whatsAppBusinessId": "123456789012345", "whatsAppBusinessPhoneNumberId": "106540352242922", "to": "+31612345678", "headerText": "Book a demo", "body": "Interested in seeing how our platform can help your business?\n\nSchedule a short demo with one of our specialists and get your questions answered.", "buttonText": "Schedule demo", "url": "https://calendly.com/company/demo" }

Response

Success (200 OK)

{ "success": true, "data": { "messaging_product": "whatsapp", "contacts": [ { "input": "+31612345678", "wa_id": "31612345678" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] } }

Notes

  • The returned data.messages[0].id is the WhatsApp message ID.
  • The CTA button opens the provided url in the WhatsApp client.

Validation error (400 Bad Request)

Returned when required fields are missing or invalid.

{ "success": false, "error": { "code": "validation_error", "message": "Invalid request body", "httpStatus": 400, "details": null } }

Common causes:

  • Missing both whatsAppBusinessId and whatsAppBusinessPhoneNumberId
  • Missing headerText, body, buttonText, or url
  • Invalid URL format

Provider error (502 Bad Gateway)

Returned when the message could not be sent via WhatsApp / Meta.

{ "success": false, "error": { "code": "WHATSAPP_SEND_FAILED", "message": "Failed to send WhatsApp CTA message.", "httpStatus": 502, "details": { "provider": "meta", "raw": {} } } }
Last updated on