Sending Template

Creates and submits a WhatsApp message template (official template) for a specific channel.

Endpoint

POST /api/message-templates/official-templates

Base URL

https://api.rampwin.com

Description

This API is used to create and send a WhatsApp template for approval. Templates are required for sending outbound messages outside the 24-hour session window.

Supports

  • Template creation (Marketing / Utility / Authentication)
  • Multi-component templates (Body, Header, Footer, Buttons)
  • Multi-language templates
  • Channel-specific submission

Authentication

This API requires:

  • API Key

Headers

HeaderTypeRequiredDescription
Content-TypestringYesapplication/json
X-API-KeystringYesYour Rampwin API Key

Request Body

FieldTypeRequiredDescription
template_jsonobjectYesTemplate configuration object
channel_idstringYesWhatsApp channel ID

Template JSON Object

FieldTypeRequiredDescription
namestringYesTemplate name (must be unique)
categorystringYesMARKETING / UTILITY / AUTHENTICATION
languagestringYesLanguage code (e.g., en, hi, af)
componentsarrayYesTemplate components (BODY, HEADER, etc.)

Components Object

FieldTypeRequiredDescription
typestringYesComponent type (e.g., BODY)
textstringYesTemplate message content

Example Request

curl --location 'https://api.rampwin.com/api/message-templates/official-templates' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "template_json": {
    "category": "MARKETING",
    "components": [
      {
        "type": "BODY",
        "text": "Hello {{1}}, check out our latest offers!"
      }
    ],
    "name": "promo_template_v1",
    "language": "en"
  },
  "channel_id": "Your_Channel_ID"
}'

Response

Success (200)

{
  "success": true,
  "data": {
    "template_id": "template_id",
    "name": "promo_template_v1",
    "status": "PENDING",
    "category": "MARKETING",
    "language": "en"
  }
}

Error (400)

{
  "success": false,
  "errors": {
    "message": "Invalid template data"
  }
}

Business Logic Notes

  • Template names must be unique per channel
  • Templates go through approval process (Meta review)
  • Only approved templates can be used for sending messages
  • Language must match supported WhatsApp language codes

Common Errors

ErrorDescription
Duplicate templateTemplate name already exists
Invalid categoryUnsupported template category
Invalid languageUnsupported language code
UnauthorizedInvalid API key