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
| Header | Type | Required | Description |
|---|---|---|---|
| Content-Type | string | Yes | application/json |
| X-API-Key | string | Yes | Your Rampwin API Key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| template_json | object | Yes | Template configuration object |
| channel_id | string | Yes | WhatsApp channel ID |
Template JSON Object
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Template name (must be unique) |
| category | string | Yes | MARKETING / UTILITY / AUTHENTICATION |
| language | string | Yes | Language code (e.g., en, hi, af) |
| components | array | Yes | Template components (BODY, HEADER, etc.) |
Components Object
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Component type (e.g., BODY) |
| text | string | Yes | Template 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
| Error | Description |
|---|---|
| Duplicate template | Template name already exists |
| Invalid category | Unsupported template category |
| Invalid language | Unsupported language code |
| Unauthorized | Invalid API key |
