WhatsApp

Send a WhatsApp template message

Send an approved WhatsApp template message to a recipient.

Authentication — send your organization API key in the x-api-key header.

Request fields

  • to — recipient phone number in international format, digits only, no +, spaces or dashes (e.g. 34622222222). Required.
  • phone_number_id — the Meta phone number ID to send from. Must be configured for your organization.
  • template_name — name of an approved template (list them via GET /public/v1/whatsapp/templates/{phone_number_id}).
  • language_code — Meta BCP-47 code that matches the template (e.g. es, en_US).
  • components — template variables (header / body / buttons). Required when the template has variables; send the same structure the template defines.
  • text — message body persisted as the conversation in GuruSup. Required, non-empty.

Failures return the envelope { "detail": "...", "error_code": "..." }: 422 request validation (e.g. blank to/text), 400 permanent error (fix and resend), 429 rate limited (retry later), 503 transient WhatsApp/Meta error (safe to retry).

post/public/v1/whatsapp/send-template

Request

  • Base URL: https://api.gurusup.com
  • URL: https://api.gurusup.com/public/v1/whatsapp/send-template
  • Auth: API key in header x-api-key

Request body

template_namestring required

Name of the approved template

language_codestring required

Meta BCP 47 language code (e.g. 'es', 'es_MX', 'en_US'). Must match exactly one of the languages returned by /public/v1/whatsapp/templates.

componentsobject[] nullable

Template components (header, body, buttons)

textstring required

Message body persisted as the conversation in GuruSup. Required and non-empty.

integration_metadataobject nullable

Integration metadata

origin'intentional' | 'automated' | 'proactive_followup'

Example request

{
  "template_name": "welcome",
  "language_code": "es",
  "components": [
    {
      "parameters": [
        {
          "text": "header",
          "type": "text"
        }
      ],
      "type": "header"
    },
    {
      "parameters": [
        {
          "text": "1",
          "type": "text"
        },
        {
          "text": "well",
          "type": "text"
        }
      ],
      "type": "body"
    },
    {
      "index": "0",
      "parameters": [
        {
          "text": "33232",
          "type": "text"
        }
      ],
      "sub_type": "url",
      "type": "button"
    }
  ],
  "text": "Hello \nIm glad to get you on Gurusup\nThis is the 1 time you are on the platform\nI hope you are doing well with us\n<a href=\"https://gurusup.com/33232\" class=\"text-blue-500\" target=\"_blank\">Visit website</a>"
}

Response

Template accepted by WhatsApp.

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.