UC-012 — RCS Template Lifecycle
| Field | Value |
|---|---|
| ID | UC-012 |
| Goal | Manage the full lifecycle of RCS templates: creation, sending, update, deletion |
| Channel | RCS |
| Complexity | ⭐⭐⭐ Advanced |
| Estimated time | 20 minutes |
| APIs involved | POST /api/message-server/rcs/templates, GET /rcs/templates, PUT /rcs/templates/{id}, DELETE /rcs/templates/{id}, POST /api/message-server/rcs/send |
Real-world scenarios
- TechStore — Marketing team builds reusable templates: The marketing manager creates a rich card with an image and buttons for the monthly promotions, and reuses it every month with different placeholders.
- FashionOutlet — Seasonal templates: Templates for summer sales, Black Friday and Christmas are created in advance, used during the season, then updated or deleted.
- ElettroShop — Product catalog: A carousel of featured products is updated every week with new images, descriptions and prices.
Prerequisites
Before you begin, make sure you have:
- Active API Key → How to get one
- Sufficient credit → Check in the Qlara Dashboard
- RCS
agentIdconfigured
Add "simulation": true in the send request body to validate the flow without actually sending messages and without consuming credit.
Template lifecycle
Step-by-step guide
Step 1 — Create a TEXT template
The simplest type: a text message with interactive suggestions.
curl -X POST "https://api.qlara.ai/api/message-server/rcs/templates" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "benvenuto_cliente",
"description": "Template di benvenuto per nuovi clienti",
"type": "TEXT",
"body": {
"text": "Ciao {name}! Benvenuto in TechStore. Siamo felici di averti con noi. Scopri le offerte riservate ai nuovi clienti!",
"suggestions": [
{
"type": "reply",
"text": "Mostra offerte",
"reply": {}
},
{
"type": "url",
"text": "Visita il sito",
"url": { "url": "https://techstore.it/benvenuto" }
},
{
"type": "dial",
"text": "Chiamaci",
"dial": { "phoneNumber": "+390212345678" }
}
],
"fallbackSms": {
"sender": "TechStore",
"text": "Ciao {name}! Benvenuto in TechStore. Scopri le offerte: https://techstore.it/benvenuto"
}
}
}'
Response: 201 Created with the saved template (id, name, description, type, enabled, body, createdAt, updatedAt). Keep the id: it is the templateId you pass when sending.
Step 1b — Create a CARD template
A rich card with an image, title, description and buttons:
curl -X POST "https://api.qlara.ai/api/message-server/rcs/templates" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "promo_estate_2026",
"description": "Promozione saldi estivi con immagine",
"type": "CARD",
"body": {
"cardOrientation": "VERTICAL",
"thumbnailAlignment": "LEFT",
"card": {
"title": "Saldi Estivi TechStore",
"description": "Fino al 40% di sconto su tutta la collezione estate. Offerta valida fino al 31 luglio 2026.",
"media": {
"height": "TALL",
"fileUrl": "https://cdn.techstore.it/img/saldi-estate-2026.jpg"
},
"suggestions": [
{
"type": "url",
"text": "Scopri i saldi",
"url": { "url": "https://techstore.it/saldi-estate" }
},
{
"type": "calendar",
"text": "Ricordami la scadenza",
"calendar": {
"title": "Fine saldi estivi TechStore",
"description": "Ultimo giorno per i saldi estivi!",
"startTime": "2026-07-31T09:00:00Z",
"endTime": "2026-07-31T23:59:00Z"
}
}
]
},
"fallbackSms": {
"sender": "TechStore",
"text": "Saldi estivi TechStore! Fino al 40% di sconto. Scopri: https://techstore.it/saldi-estate"
}
}
}'
Step 1c — Create a CAROUSEL template
A carousel of cards that scroll horizontally:
curl -X POST "https://api.qlara.ai/api/message-server/rcs/templates" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "catalogo_prodotti_top",
"description": "Carousel prodotti in evidenza",
"type": "CAROUSEL",
"body": {
"cardWidth": "MEDIUM",
"cards": [
{
"title": "Cuffie Wireless Pro",
"description": "79.99 EUR - Noise cancelling attivo",
"media": {
"height": "MEDIUM",
"fileUrl": "https://cdn.techstore.it/img/cuffie-pro.jpg"
},
"suggestions": [
{
"type": "url",
"text": "Dettagli",
"url": { "url": "https://techstore.it/p/cuffie-pro" }
}
]
},
{
"title": "Smartwatch FitPlus",
"description": "149.99 EUR - GPS integrato",
"media": {
"height": "MEDIUM",
"fileUrl": "https://cdn.techstore.it/img/smartwatch-fitplus.jpg"
},
"suggestions": [
{
"type": "url",
"text": "Dettagli",
"url": { "url": "https://techstore.it/p/smartwatch" }
}
]
},
{
"title": "Speaker Bluetooth Mini",
"description": "39.99 EUR - Waterproof IP67",
"media": {
"height": "MEDIUM",
"fileUrl": "https://cdn.techstore.it/img/speaker-mini.jpg"
},
"suggestions": [
{
"type": "url",
"text": "Dettagli",
"url": { "url": "https://techstore.it/p/speaker-mini" }
}
]
}
],
"fallbackSms": {
"sender": "TechStore",
"text": "Scopri i prodotti in evidenza su TechStore: https://techstore.it/top"
}
}
}'
Step 2 — List the templates
Retrieve the templates, with optional filters:
curl -X GET "https://api.qlara.ai/api/message-server/rcs/templates?type=CARD&sortBy=creationDate&sortOrder=desc&limit=10&page=0" \
-H "X-Api-Key: YOUR_API_KEY"
The response wraps the templates in a data array.
| Parameter | Description |
|---|---|
search | Full-text search on name and description |
id | Filter by template ID |
name | Filter by template name |
description | Filter by description |
type | TEXT, CARD, CAROUSEL |
enabled | 0 = disabled only, 1 = enabled only |
sortBy | Sort field (name, type, creationDate) |
sortOrder | asc or desc |
limit | Items per page (default 10) |
page | Page number (0-based) |
Step 3 — Send a message using the template
Use the templateId obtained from the creation or from the list:
curl -X POST "https://api.qlara.ai/api/message-server/rcs/send" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "+393471234567",
"agentId": 1,
"templateId": 55,
"placeholders": {
"name": "Laura"
},
"campaignId": "benvenuto-aprile-2026",
"enableNotification": true
}'
Response:
{
"messageId": "b7e4f201-9a3c-4d58-a612-fedcba987654",
"simulation": false,
"results": {
"rcs": {
"accepted": true
},
"sms": {
"accepted": true,
"unicode": false,
"parts": 1
}
}
}
The API answers 202 Accepted. The sms result is there because the template has a fallbackSms: the SMS is prepared with the message and sent only if RCS fails.
If the recipient does not support RCS, the message is sent via SMS with the text defined in the template's fallbackSms, with the same placeholders. The send request has nothing to add: a maxSmsParts field, if present, is ignored, and the SMS is split into as many parts as its text needs. You can also configure a fallbackWhatsApp to try WhatsApp before SMS; in that case fallbackSms becomes mandatory, and the WhatsApp fallback applies only if your account supports mixed-channel sending.
Step 4 — Update a template
Change an existing template with PUT. Only the fields you send are updated; if you send body, send type as well:
curl -X PUT "https://api.qlara.ai/api/message-server/rcs/templates/55" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "benvenuto_cliente_v2",
"description": "Template benvenuto aggiornato con nuove offerte",
"type": "TEXT",
"body": {
"text": "Ciao {name}! Benvenuto in TechStore. Usa il codice WELCOME10 per il 10% di sconto sul primo acquisto!",
"suggestions": [
{
"type": "url",
"text": "Usa lo sconto",
"url": { "url": "https://techstore.it/promo/WELCOME10" }
}
],
"fallbackSms": {
"sender": "TechStore",
"text": "Ciao {name}! Benvenuto in TechStore. Codice sconto WELCOME10 su techstore.it"
}
}
}'
Response: 200 OK with the updated template.
Step 5 — Delete a template
When a template is no longer needed:
curl -X DELETE "https://api.qlara.ai/api/message-server/rcs/templates/55" \
-H "X-Api-Key: YOUR_API_KEY"
Response: 204 No Content
Deleting a template is permanent. Messages already sent with that template are not affected, but you can no longer use it for new sends.
Template types compared
| Type | Content | When to use it |
|---|---|---|
| TEXT | Text + suggestions (buttons) | Notifications, confirmations, simple messages with actions |
| CARD | Image/video + title + description + buttons | Single promotions, offers with an eye-catching visual |
| CAROUSEL | 2-10 scrollable cards | Product catalogs, comparisons, option menus |
Available suggestions
| Type | Description |
|---|---|
reply | Quick reply with predefined text |
url | Opens a link in the browser |
dial | Starts a phone call |
locationCoordinates | Shows a position on a map |
locationQuery | Searches for an address on a map |
calendar | Creates a calendar event |
Behind the scenes
RCS templates are managed internally by the Qlara platform, with no external approval (unlike WhatsApp templates, which require Meta's approval):
- Creation -- The template is saved and linked to your account. It is immediately available for sending.
- Rendering -- At send time, the placeholders (
{name},{codice}, etc.) are replaced with the values given inplaceholders. - Fallback -- If the recipient does not support RCS, the system tries
fallbackWhatsApp(if configured) and thenfallbackSms. The chain is: RCS -> WhatsApp -> SMS. - Update --
PUTchanges only the fields you send. Messages already sent are not modified. - Metrics -- Use the
campaignIdto group the sends, then export the reports with UC-011: Export Delivery Reports.
Expected result
| Aspect | Detail |
|---|---|
| Action completed | RCS template created, used for sending, updated or deleted |
| Channel used | RCS (with SMS fallback) |
| Delivery confirmation | Via webhook (statusCode: 3) within 5-60 sec |
Common errors
| Problem | Probable cause | Solution |
|---|---|---|
HTTP 401 | Missing or invalid API Key | Check X-Api-Key header |
accepted: false | Invalid number, or no operator found for it (see reasons) | Verify E.164 format |
HTTP 400 — Invalid template type | Unsupported type or malformed body structure | Verify type is TEXT, CARD, or CAROUSEL with the matching body schema; when updating body, send type too |
HTTP 404 — Template not found | Wrong template ID or template was deleted | List templates with GET /rcs/templates to verify the ID |
| Fallback SMS sent instead of RCS | Recipient device does not support RCS | Expected behavior; verify the fallbackSms content is appropriate |
| No SMS fallback | The template has no fallbackSms, or the SMS was rejected (sms.accepted: false in the send response) | Add fallbackSms to the template; check sms.reasons (e.g. SMS sender not allowed) |
Next steps
- RCS Templates Guide -- Complete reference on RCS templates
- RCS API Guide -- Send RCS messages with an inline body
- UC-013: WhatsApp Template Workflow -- Compare with the WhatsApp template flow (with Meta approval)
- UC-010: Scheduled Messages -- Schedule the sending of RCS templates
- UC-011: Export Delivery Reports -- Export the campaign results