RCS Templates
RCS templates are pre-configured messages that can be reused for repeated sends. They support three formats: plain text, rich card, and card carousel.
Endpoint
| Method | Path | Description |
|---|---|---|
GET | /api/message-server/rcs/templates | List templates |
GET | /api/message-server/rcs/templates/{id} | Template details |
POST | /api/message-server/rcs/templates | Create template |
PUT | /api/message-server/rcs/templates/{id} | Update template |
DELETE | /api/message-server/rcs/templates/{id} | Delete template |
Template types
TEXT
The simplest type: a text message with optional suggestions.
{
"name": "rcs_welcome",
"description": "Welcome template",
"type": "TEXT",
"body": {
"text": "Ciao {name}! Benvenuto nel nostro servizio.",
"suggestions": [
{ "type": "reply", "text": "Grazie!" },
{ "type": "url", "text": "Visita il sito", "url": { "url": "https://example.com" } }
],
"fallbackSms": {
"sender": "AZIENDA",
"text": "Ciao {name}! Benvenuto. Visita https://example.com"
}
}
}
CARD
A rich card with image/video, title, description, and buttons.
{
"name": "rcs_promo",
"description": "Promotion with image",
"type": "CARD",
"body": {
"cardOrientation": "VERTICAL",
"thumbnailAlignment": "LEFT",
"card": {
"title": "Offerta speciale",
"description": "Scopri le novita' della stagione",
"media": {
"height": "TALL",
"fileUrl": "https://example.com/promo.jpg"
},
"suggestions": [
{ "type": "url", "text": "Scopri", "url": { "url": "https://example.com/promo" } }
]
},
"fallbackSms": {
"sender": "SHOP",
"text": "Offerta speciale! Scopri: https://example.com/promo"
}
}
}
CAROUSEL
A carousel of horizontally scrollable cards.
{
"name": "rcs_catalogo",
"description": "Product catalog",
"type": "CAROUSEL",
"body": {
"cardWidth": "MEDIUM",
"cards": [
{
"title": "Prodotto A",
"description": "29.99 EUR",
"media": { "height": "MEDIUM", "fileUrl": "https://example.com/a.jpg" },
"suggestions": [
{ "type": "url", "text": "Dettagli", "url": { "url": "https://example.com/a" } }
]
},
{
"title": "Prodotto B",
"description": "49.99 EUR",
"media": { "height": "MEDIUM", "fileUrl": "https://example.com/b.jpg" },
"suggestions": [
{ "type": "url", "text": "Dettagli", "url": { "url": "https://example.com/b" } }
]
}
],
"fallbackSms": {
"sender": "SHOP",
"text": "Scopri il nostro catalogo: https://example.com"
}
}
}
Template creation fields
| Field | Type | Req. | Description |
|---|---|---|---|
name | string | Yes | Template name |
description | string | No | Description |
type | string | Yes | Type: TEXT, CARD, CAROUSEL |
body | object | Yes | Content (structure varies based on the type) |
Available suggestions
| Type | Description | Fields |
|---|---|---|
reply | Quick reply | text |
url | Opens a link | text, url.url |
dial | Starts a call | text, dial.phoneNumber |
locationCoordinates | Shows location | text, locationCoordinates.latitude/longitude/label |
locationQuery | Searches for location | text, locationQuery.query |
calendar | Calendar event | text, calendar.title/description/startTime/endTime |
Fallback
Each template can include:
- fallbackWhatsApp: if RCS is not available, sends via WhatsApp
- fallbackSms: if the previous channel fails, sends SMS (required if fallbackWhatsApp is present)
Media
| Field | Type | Description |
|---|---|---|
height | enum | SHORT, MEDIUM, TALL, UNSPECIFIED |
fileUrl | string | Public media URL (*exclusive with mediaKey) |
mediaKey | string | Internal media key (*exclusive with fileUrl) |
thumbnailUrl | string | Preview URL (optional) |
Template list filters
| Parameter | Description |
|---|---|
search | Search by name/description |
type | Filter by type: TEXT, CARD, CAROUSEL |
enabled | 0 = disabled only, 1 = enabled only |
sortBy | Sort field (name, type, creationDate, etc.) |
sortOrder | asc or desc |
limit | Items per page |
page | Page number (0-based) |