UC-003 — RCS Template Lifecycle
- Goal
- Manage the full lifecycle of RCS templates: creation, use in a campaign, update, deletion
- Channel
- RCS
- Estimated time
- 20 minutes
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 agent of your account: its
agentGoogleId, listed byGET /api/partner-gateway/rcs/agents, is thercsAgentIdof a campaign
Campaigns have no simulation mode, but nothing is sent and no credit is used until you confirm one: the campaign of Step 3 stays a draft.
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, companyId, name, description, type, body, placeholderFields (an object keyed by channel, RCS and SMS, which can be empty or null), enabled, creationDate and lastUpdateDate (strings in yyyy-MM-dd HH:mm:ss.SSSZ). Keep the id: it is the rcsTemplateId of a campaign.
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, with the paging in page, limit, totalCount and totalPages.
| Parameter | Description |
|---|---|
search | Case-insensitive search on name and description. When set, it overrides every other filter (id, name, description, type) and can list disabled templates too: do not combine it with other filters |
id | Filter by template ID |
name | Filter by template name (partial, case-insensitive match) |
description | Filter by description (partial, case-insensitive match) |
type | TEXT, CARD, CAROUSEL |
enabled | No effect: without search only enabled templates are listed |
sortBy | Sort field (name, type, creationDate, ...), default id |
sortOrder | asc (default) or desc |
limit | Items per page (default 10) |
page | Page number (0-based) |
Step 3 — Use the template in a campaign
A campaign sends the template to your contact lists. Pass the template's id as rcsTemplateId, its type as rcsTemplateType and the agentGoogleId of your RCS agent as rcsAgentId. This campaign uses the CARD template of Step 1b:
curl -X POST "https://api.qlara.ai/api/partner-gateway/campaigns" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Saldi estivi 2026",
"sendingMode": "RCS",
"destinationType": 0,
"rcsAgentId": "techstore_k3v9x2pq_agent",
"rcsTemplateId": 56,
"rcsTemplateType": "CARD",
"contactListIds": [412]
}'
Response: 201 Created with the campaign in DRAFT status. Nothing is sent yet: mark the campaign as ready, check its price and confirm it as shown in UC-004: Bulk RCS Rich Card Campaign.
rcsTemplateId must be an enabled RCS template of your account, otherwise the campaign is refused with 404, and rcsTemplateType must be the type of that template (TEXT, CARD or CAROUSEL).
To reach the recipients without RCS too, set the campaign's sendingMode to RCS_SMS and add smsSender and smsBody: see RCS campaign with SMS fallback.
Step 4 — Update a template
Change an existing template with PUT. name, description and type keep their value when you leave them out, but body does not: an update without body erases the content of the template. So always send type and body, the current ones from GET if you only change the name:
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 in new campaigns.
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 campaigns.
- Rendering -- The placeholders in the text (
{name},{codice}, etc.) are replaced when each message is sent. - Fallback --
fallbackSmsis the only fallback a template keeps: afallbackWhatsAppsent when you create or update the template is not saved. A campaign sets its own SMS fallback, with theRCS_SMSsending mode and itssmsSenderandsmsBody. - Update --
PUTchanges only the fields you send. Messages already sent are not modified. - Results -- Read the counters of the campaign with
GET /campaigns/{id}, or export its report as in UC-002: Complete Campaign Report.
Expected result
| Aspect | Detail |
|---|---|
| Action completed | RCS template created, used in a campaign, updated or deleted |
| Channel used | RCS |
| Results | Counters of the campaign, with GET /campaigns/{id} |
Common errors
| Problem | Probable cause | Solution |
|---|---|---|
HTTP 401 | Missing or invalid API Key | Check X-Api-Key header |
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 |
HTTP 404 on POST /campaigns — RCS template not found | rcsTemplateId is not an enabled RCS template of your account | Take the id from GET /rcs/templates |
HTTP 400 on POST /campaigns — Bad request. | rcsTemplateType is not the type of the template | Send the type of the template as rcsTemplateType |
Next steps
- RCS Templates Guide -- Complete reference on RCS templates
- UC-004: Bulk RCS Rich Card Campaign -- Send the template to a contact list
- UC-006: WhatsApp Template Workflow -- Compare with the WhatsApp template flow (with Meta approval)
- UC-018: Export Delivery Reports -- Export the campaign results