Templates (RCS)

Raw channel templates

A message template stores one authored RCS message as raw channel content: you send the RCS contract itself, not a channel-neutral format, and the API never converts it to another channel. Templates belong to a group and live under/template. Filter a list by channel when you need to; the body's own channel says what a new template is.

Availability. Template routes are only enabled where RCS is enabled. Templates cannot be sent yet: sending arrives in a later release.

The RCS body

  • channel: "rcs". contentFormat is optional: omitted means "content.v1", the block contract below, which is the only format the API stores and returns. "google.rcs" sends Google's RCS format instead (see below).
  • content.blocks: ordered blocks, each with a unique id and a kind of text, richCard, video, carousel, suggestions or attachment. A suggestions block attaches to the message block before it; card buttons go in a card's own suggestions.
  • Suggestions have a type of REPLY, OPEN_URL (url, application BROWSER or WEBVIEW, webviewViewMode for WEBVIEW), DIAL (phoneNumber in E.164), VIEW_LOCATION (latitude and longitude, or an address of at most 512 characters the API resolves to them on create, update and validate when a geocoding provider is configured, plus locationLabel. Each distinct address is looked up once, an address containing {{ is not looked up, and at most 25 addresses not already cached are resolved per request, each counted against the group's window of 60 lookups a minute shared with GET /template/geocode. An address that stays unresolved blocks publishing with LOCATION_UNRESOLVED), SHARE_LOCATION or CALENDAR (title of at most 100 characters, description of at most 500, startTime, endTime as ISO-8601 with an offset), plus label and postbackData.
  • variables: {{key}} placeholders, with keys of lowercase letters, digits and underscores. They are allowed in message text, card titles and descriptions, button labels and fallback text, and under the rules below in links, media, dial numbers, calendar events and postback data. Each declares type (text, number, dateTime, phoneNumber or url), required, and an optional missingPolicy, default and sample. Samples are for previews only and are never sent. {{sender_name}} is reserved and filled from the sender.
  • missingPolicy says what a recipient with no value for the variable gets. An empty value, or one of only spaces, counts as no value. default: the variable's default, or an empty value when none is declared. block: the recipient is blocked with VARIABLE_MISSING, even when a default is declared. drop: the send leaves out each block that uses the variable, and a message block takes its suggestions blocks with it; in fallback text the variable is empty. The billing class and the generated fallback come from the blocks that remain, and a drop that leaves nothing to send blocks the recipient with VARIABLE_MISSING. With a missingPolicy, required is not read at send. Without one, a missing value takes the default; with no default, a required variable blocks the recipient with VARIABLE_MISSING and an optional one is empty.
  • Placeholders outside text. A url variable may fill a whole link (url, fallbackUrl) or media field (mediaUrl, thumbnailUrl, fileUrl, fallback mediaUrls). Any variable may fill the path, query or fragment of a URL whose scheme and host are written out, and its value is percent-encoded there. A dial phoneNumber takes one phoneNumber variable for the whole field, and a calendar startTime and endTime take one dateTime variable each. A calendar title and description take text. postbackData takes text: the API wraps it as sh1|<messageId>|<buttonId>|<postbackData> at send and gives back only your part. A location's address and locationLabel take no variables. Publish checks only where a placeholder sits (PLACEHOLDER_NOT_ALLOWED). The send checks each recipient's filled field as publish checks a written one (INVALID_URL, INVALID_PHONE, INVALID_DATE_TIME, EVENT_END_BEFORE_START, POSTBACK_REQUIRED, EVENT_TITLE_REQUIRED, EVENT_TITLE_TOO_LONG, EVENT_DESCRIPTION_TOO_LONG), and a failure blocks that recipient with CONTENT_INVALID. The generated fallback writes a filled link as "Label: URL".
  • defaults: optional trafficType and ttlSeconds (10 seconds to 48 hours, the carrier partner's floor and cap).
  • fallback: {} for none, or delivery with the SMS or MMS content you wrote (channel sms or mms, campaignId of one of your campaigns and a phoneNumber on that campaign to send it from (digits only, as /number lists it), content.text, plus mediaUrls and an optional subject for MMS) and an optional validitySeconds. It is sent when RCS cannot be delivered. With {}, a send that allows a fallback and sets no fallback.content gets text the API generates from the RCS content.

Unknown fields are rejected at every level. Drafts may have empty fields; publishing requires complete content within the channel limits returned by /capabilities, and a fallback campaignId that belongs to the template's group with a phoneNumber assigned to that campaign.

Sending Google's RCS format

Send contentFormat: "google.rcs" with content set to an RBM AgentContentMessage, the object Google's API takes under contentMessage: exactly one of text, richCard (standaloneCard orcarouselCard) or contentInfo, plus suggestions (reply or action with one of openUrlAction, dialAction, viewLocationAction, shareLocationAction,createCalendarEventAction). The API converts it to content.v1 before anything else happens, so the stored, validated and returned body is always content.v1. variables, defaults and fallbackare the same as above.

  • A viewLocationAction.query (an address) becomes the suggestion's address and is resolved to coordinates the same way. latLong maps to latitude and longitude; label to locationLabel.
  • Fields with no carrier equivalent are accepted and dropped: uploadedRbmFile, composeAction (a suggestion with only a compose action is dropped), openUrlAction.description, contentInfo.forceRefresh and altText. Google's *_UNSPECIFIED enum members read as absent. Any other unknown field is rejected with its path.
  • /capabilities lists the accepted formats as contentFormats.

Versions and concurrent edits

Each template has a head with a draftVersion and a publishedVersion. Publishing freezes the draft; editing a published template creates the next draft and leaves the published version unchanged. Every change increments the head's revision. Writes apply directly: the last write wins, and the API keeps each write whole. The 409 codes are TEMPLATE_ARCHIVED,TEMPLATE_NAME_TAKEN, NO_DRAFT when publishing without a draft, and DRAFT_CHANGED when the draft changed while it was being published (publish again). Send an Idempotency-Key header to retry a write safely.

How you hear about a problem

The API checks content at the earliest stage that can know the answer, and every stage says why. The SDKs check required parameters only, so each response carries its result. Read validation on every save, and call POST /message/rcs/validate before a large send.

StageCallWhat runsWhat you get
SavePOST /template, PUT /template/:templateIdStructure rejects the request. Every publish check but content moderation runs and is reported.400 for bad structure. Otherwise the draft saves, and validation lists what would stop it publishing.
CheckPOST /template/:templateId/validateEvery publish check, content moderation included, with nothing written.{ valid, errors, warnings }
PublishPOST /template/:templateId/publishEvery publish check, content moderation included.400 TEMPLATE_INVALID with every error and warning, or the published version with its warnings.
Check a sendPOST /message/rcs/validateEvery check a send runs for your recipients and agent, with nothing written and no funds held.{ valid, errors, warnings, billingClass, segments, estimatedCostMicros, unsupportedFiles, recipients }. valid is true only with no errors.
SendPOST /message/rcsThe full send plan.400 for a problem with the whole request. A blocked recipient is a BLOCKED row with blockReason, reason and issues; the rest still send.
After queueingWebhooks, GET /messageThe carrier partner's answer.reason in failed, blocked, expired and fallback webhooks, with fallbackReason or blockReason.
CodeWhenHow to fix it
CARD_EMPTYSave, publish and sendGive the card media or a title. A description alone is not enough.
MEDIA_HEIGHT_REQUIRES_VERTICALSave and publishRemove mediaHeight from a horizontal card.
ALIGNMENT_REQUIRES_HORIZONTALSave and publishRemove thumbnailImageAlignment from a vertical card.
TTL_OUT_OF_RANGESave and publishSet defaults.ttlSeconds inside the range of defaults.trafficType.
INFOBIP_TOO_MANY_MESSAGESSave and publishUse at most 10 messages. A message is one content block and the suggestions after it.
INFOBIP_PERSISTENT_UNSUPPORTEDSave and publishRemove persistent from the suggestion.
INFOBIP_FALLBACK_URL_UNSUPPORTEDSave and publishRemove fallbackUrl from the suggestion.
EVENT_IN_PASTA warning on save and publish; blocks the recipient at sendMove the calendar event's startTime into the future, then publish again.
IOS_CHIPS_COLLAPSEA warning on save, publish, estimate and checkKeep a message to two suggested actions, or accept the Options menu on iPhone.
IOS_CARD_BUTTONS_COLLAPSEA warning on save, publish, estimate and checkKeep a card to one button, or accept the Options menu on iPhone.
IOS_GIF_STATICA warning on save, publish, estimate and checkSend the GIF as a file to animate it on iPhone.
IOS_TEXT_CLIPPEDA warning on save, publish, estimate and checkKeep a card title or description to three lines.
IOS_HORIZONTAL_CARDA warning on save, publish, estimate and checkUse a vertical card, or accept a vertical card with a cropped image on iPhone.
IOS_CARD_LINK_PLAINA warning on save, publish, estimate and checkUse an Open URL button in place of a link in card text.
IOS_CARD_CODE_NOT_COPYABLEA warning on save, publish, estimate and checkSend a one-time code as plain text, not in a card.
CONTENT_POLICY_FLAGGEDCheck and publishContent moderation flagged a block's text or image, or the fallback text, for the category the message names. Change that content. When the moderation service cannot answer, the check passes, as a send does. An image URL with a variable is moderated at send instead, with its value filled in, and a refused image blocks the recipient with MODERATION.
VARIABLE_MISSINGSendSend a value in recipients[].variables for each variable whose missingPolicy is block, or that is required with no default and no missingPolicy. A drop variable blocks the recipient when leaving out the blocks that use it leaves nothing to send. An empty value, or one of only spaces, counts as none.
MEDIA_REDIRECTSend, check a send and estimateReplace the external media URL with the URL its redirect leads to.
TEMPLATE_ARCHIVEDSend, check a send and estimate (409)Send a template that is not archived. An archived template cannot be sent, edited or published.

/template

POST/template

Create a template with draft version 1 (head revision 1). The draft may be incomplete: it saves, and validation lists what would stop it publishing.

The following roles are required to use this endpoint: admin, developer, api

Request Body

FieldTypeRequiredDescription
groupIdBody ParamRequiredGroup that owns the template. Must be your active group, with RCS enabled (otherwise 403).
nameBody ParamRequiredLibrary name, 1–120 characters, unique per group and channel.
tagBody ParamOptionalTag shown in the portal (1–60 characters). Presentation only; it never affects delivery.
bodyBody ParamRequiredThe raw RCS template body (see the contract above). contentFormat is optional: omitted means content.v1; "google.rcs" sends Google's RBM content, which is converted and stored as content.v1. Drafts may be incomplete.

Example Request

Request
{
  "groupId": "G1234567",
  "name": "Order ready",
  "tag": "Order Confirmation",
  "body": {
    "channel": "rcs",
    "contentFormat": "content.v1",
    "content": {
      "blocks": [
        {
          "id": "b1",
          "kind": "text",
          "text": "Order {{order_number}} is ready."
        },
        {
          "id": "b2",
          "kind": "suggestions",
          "suggestions": [
            {
              "type": "REPLY",
              "label": "Thanks",
              "postbackData": "order_ack"
            }
          ]
        }
      ]
    },
    "variables": [
      {
        "key": "order_number",
        "type": "text",
        "required": true,
        "sample": "A-48213"
      }
    ],
    "defaults": {
      "trafficType": "TRANSACTION"
    },
    "fallback": {
      "delivery": {
        "channel": "sms",
        "campaignId": "CABC123",
        "phoneNumber": "15551234567",
        "content": {
          "text": "Order {{order_number}} is ready."
        }
      }
    }
  }
}

Example Response 201

Response
{
  "head": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "channel": "rcs",
    "name": "Order ready",
    "tag": "Order Confirmation",
    "archivedAt": null,
    "draftVersion": 1,
    "publishedVersion": null,
    "revision": 1,
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "state": "DRAFT",
    "hasUnpublishedChanges": false
  },
  "version": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "version": 1,
    "state": "DRAFT",
    "body": {
      "channel": "rcs",
      "contentFormat": "content.v1",
      "content": {
        "blocks": [
          {
            "id": "b1",
            "kind": "text",
            "text": "Order {{order_number}} is ready."
          },
          {
            "id": "b2",
            "kind": "suggestions",
            "suggestions": [
              {
                "type": "REPLY",
                "label": "Thanks",
                "postbackData": "order_ack"
              }
            ]
          }
        ]
      },
      "variables": [
        {
          "key": "order_number",
          "type": "text",
          "required": true,
          "sample": "A-48213"
        }
      ],
      "defaults": {
        "trafficType": "TRANSACTION"
      },
      "fallback": {
        "delivery": {
          "channel": "sms",
          "campaignId": "CABC123",
          "phoneNumber": "15551234567",
          "content": {
            "text": "Order {{order_number}} is ready."
          }
        }
      }
    },
    "contentHash": "9f2c4e…",
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "publishedAt": null
  },
  "validation": {
    "valid": true,
    "errors": [],
    "warnings": []
  }
}

SDK Example

GET/template

List a group's templates with server-side filters, sorting and pagination. Each row includes the derived state and hasUnpublishedChanges.

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
groupIdQuery ParamRequiredGroup that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).
stateQuery ParamOptionalDRAFT, PUBLISHED or ARCHIVED. Omitted lists every template that is not archived.
tagQuery ParamOptionalExact tag.
searchQuery ParamOptionalCase-insensitive match on the template name.
sortByQuery ParamOptionalname, createdAt or updatedAt (default updatedAt).
sortOrderQuery ParamOptionalasc or desc (default desc).
pageQuery ParamOptionalPage number (default 1).
limitQuery ParamOptionalResults per page (default 25, maximum 100).

Example Response 200

Response
{
  "data": [
    {
      "templateId": "TPL7K3M9QXR2V",
      "groupId": "G1234567",
      "channel": "rcs",
      "name": "Order ready",
      "tag": "Order Confirmation",
      "archivedAt": null,
      "draftVersion": 2,
      "publishedVersion": 1,
      "revision": 3,
      "createdBy": "60f7b2a1c9e77c001a2b3c4d",
      "createdAt": "2026-10-12T15:00:00.000Z",
      "updatedAt": "2026-10-12T15:00:00.000Z",
      "state": "PUBLISHED",
      "hasUnpublishedChanges": true
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 25
}

SDK Example

GET/template/capabilities

Describe the RCS contract's block kinds, action types, limits and accepted media, and optionally one provider's adapter constraints. Not account configuration.

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
groupIdQuery ParamRequiredGroup that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).
providerQuery ParamOptionalinfobip or sinch: include that provider's adapter constraints and unsupported features.

Example Response 200

Response
{
  "channel": "rcs",
  "contentFormat": "content.v1",
  "contentFormats": [
    "content.v1",
    "google.rcs"
  ],
  "validatorVersion": "content-1.0.0",
  "blockKinds": [
    "text",
    "richCard",
    "video",
    "carousel",
    "suggestions",
    "attachment"
  ],
  "actionTypes": [
    "REPLY",
    "OPEN_URL",
    "DIAL",
    "VIEW_LOCATION",
    "SHARE_LOCATION",
    "CALENDAR"
  ],
  "limits": {
    "maxTextLength": 3072,
    "maxCardTitle": 200,
    "maxCardDescription": 2000,
    "maxSuggestionLabel": 25,
    "maxMessageSuggestions": 11,
    "maxRecipients": 100,
    "maxCardSuggestions": 4,
    "minCarouselCards": 2,
    "maxCarouselCards": 10,
    "maxCalendarTitle": 100,
    "maxCalendarDescription": 500,
    "minTtlSeconds": 10,
    "maxTtlSeconds": 172800
  },
  "ttlPresets": {
    "AUTHENTICATION": {
      "seconds": 30,
      "min": 15,
      "max": 300
    },
    "TRANSACTION": {
      "seconds": 900,
      "min": 60,
      "max": 86400
    },
    "SERVICEREQUEST": {
      "seconds": 900,
      "min": 60,
      "max": 86400
    },
    "ACKNOWLEDGEMENT": {
      "seconds": 300,
      "min": 60,
      "max": 3600
    },
    "PROMOTION": {
      "seconds": 14400,
      "min": 600,
      "max": 172800
    }
  },
  "trafficByUseCase": {
    "OTP": [
      "AUTHENTICATION"
    ],
    "TRANSACTIONAL": [
      "TRANSACTION",
      "SERVICEREQUEST",
      "ACKNOWLEDGEMENT"
    ],
    "PROMOTIONAL": [
      "PROMOTION"
    ],
    "MULTI_USE": [
      "AUTHENTICATION",
      "TRANSACTION",
      "SERVICEREQUEST",
      "ACKNOWLEDGEMENT",
      "PROMOTION"
    ]
  },
  "defaultTrafficByUseCase": {
    "OTP": "AUTHENTICATION",
    "TRANSACTIONAL": "TRANSACTION",
    "PROMOTIONAL": "PROMOTION"
  },
  "ios": {
    "cardButtonsInline": 1,
    "suggestedActionsInline": 2,
    "linesPerField": 3,
    "charsPerLine": 30
  },
  "media": {
    "maxUploadBytes": 10485760,
    "mimeTypes": [
      "image/jpeg",
      "image/png",
      "image/gif",
      "video/mp4",
      "audio/mpeg",
      "audio/mp4",
      "application/pdf"
    ],
    "maxImageEdge": 1920,
    "imageTargetBytes": 5000000
  },
  "geocoding": {
    "available": true
  },
  "provider": {
    "provider": "sinch",
    "adapterVersion": "sinch-rcs-1.0.0",
    "unsupported": [
      {
        "feature": "carousel",
        "code": "SINCH_CARD_WIDTH_UNMAPPED",
        "message": "Sinch has no verified carousel card-width mapping"
      }
    ]
  }
}

SDK Example

GET/template/geocode

Resolve an address to coordinates for a VIEW_LOCATION suggestion, through the server's geocoding provider. 400 with code LOCATION_NOT_FOUND when nothing matches; 429 past the group's window of 60 lookups a minute, which template saves and validations share; 503 when the server has no geocoding provider (capabilities.geocoding.available is false).

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
groupIdQuery ParamRequiredGroup that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).
addressQuery ParamRequiredThe address to resolve, 1–512 characters.

Example Response 200

Response
{
  "address": "88 Lakeshore Dr, Chicago, IL 60601, USA",
  "latitude": 41.8819,
  "longitude": -87.6278,
  "partialMatch": false
}

SDK Example

POST/template/media

Upload one media file and get its public CDN URL to use in a template. An image with a longest edge over capabilities.media.maxImageEdge (1920) or over capabilities.media.imageTargetBytes (5,000,000 bytes) is compressed to both before it is stored; a GIF keeps its animation, a PNG stays PNG when it fits, and any other image is stored as JPEG, flattened onto white. An image within both is stored as uploaded. bytes, mimeType, width and height describe the stored file. An image over the MMS size limit (700 KB) also gets an MMS copy, in variants.mms ({ url, bytes }), with a longest edge of at most 1200; an MMS fallback leg sends the copy in place of the image, and a template may use the copy's URL where an image goes. variants is {} when there is no copy. The copy counts against the group's storage quota. Uploaded files are publicly reachable by anyone with the URL; never upload confidential documents.

The following roles are required to use this endpoint: admin, developer, api

Request Body

FieldTypeRequiredDescription
groupIdForm FieldRequiredGroup that will own the file. Must be your active group.
fileForm FieldRequiredOne file, at most 10 MiB: JPEG, PNG, GIF, MP4, MP3, M4A or PDF. The type is read from the file's bytes, not its name or declared type.

Example Response 201

Response
{
  "mediaId": "MED4Q8ZK2M7TX",
  "groupId": "G1234567",
  "url": "https://media.signalhouse.io/message-templates/1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed.jpg",
  "bytes": 1482130,
  "mimeType": "image/jpeg",
  "kind": "image",
  "width": 1920,
  "height": 1005,
  "variants": {
    "mms": {
      "url": "https://media.signalhouse.io/message-templates/6f1c2a9e-4b7d-4e2f-8a31-0d5c9b7e2f14.jpg",
      "bytes": 612345
    }
  },
  "createdAt": "2026-10-12T15:00:00.000Z"
}

SDK Example

GET/template/:templateId

Read a template head with one selected version.

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdQuery ParamRequiredGroup that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).
versionQuery ParamOptionalA version number, "draft" or "published". Omitted means the published version, otherwise the draft. An explicit selector never falls back.

Example Response 200

Response
{
  "head": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "channel": "rcs",
    "name": "Order ready",
    "tag": "Order Confirmation",
    "archivedAt": null,
    "draftVersion": 1,
    "publishedVersion": null,
    "revision": 1,
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "state": "DRAFT",
    "hasUnpublishedChanges": false
  },
  "version": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "version": 1,
    "state": "DRAFT",
    "body": {
      "channel": "rcs",
      "contentFormat": "content.v1",
      "content": {
        "blocks": [
          {
            "id": "b1",
            "kind": "text",
            "text": "Order {{order_number}} is ready."
          },
          {
            "id": "b2",
            "kind": "suggestions",
            "suggestions": [
              {
                "type": "REPLY",
                "label": "Thanks",
                "postbackData": "order_ack"
              }
            ]
          }
        ]
      },
      "variables": [
        {
          "key": "order_number",
          "type": "text",
          "required": true,
          "sample": "A-48213"
        }
      ],
      "defaults": {
        "trafficType": "TRANSACTION"
      },
      "fallback": {
        "delivery": {
          "channel": "sms",
          "campaignId": "CABC123",
          "phoneNumber": "15551234567",
          "content": {
            "text": "Order {{order_number}} is ready."
          }
        }
      }
    },
    "contentHash": "9f2c4e…",
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "publishedAt": null
  }
}

SDK Example

PUT/template/:templateId

Edit metadata or the draft body. A supplied body replaces the whole draft; nothing is merged. Editing a published template opens its next draft.

The following roles are required to use this endpoint: admin, developer, api

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdBody ParamRequiredGroup that owns the template. Must be your active group, with RCS enabled (otherwise 403).
nameBody ParamOptionalNew library name. Omit to keep.
tagBody ParamOptionalNew tag, or null to clear. Omit to keep.
bodyBody ParamOptionalReplaces the whole draft body. On a published template with no draft, creates draft version published + 1. An update with no fields on such a template opens a draft copy of the published body.

Example Request

Request
{
  "groupId": "G1234567",
  "body": {
    "channel": "rcs",
    "contentFormat": "content.v1",
    "content": {
      "blocks": [
        {
          "id": "b1",
          "kind": "text",
          "text": "Order {{order_number}} is ready."
        },
        {
          "id": "b2",
          "kind": "suggestions",
          "suggestions": [
            {
              "type": "REPLY",
              "label": "Thanks",
              "postbackData": "order_ack"
            }
          ]
        }
      ]
    },
    "variables": [
      {
        "key": "order_number",
        "type": "text",
        "required": true,
        "sample": "A-48213"
      }
    ],
    "defaults": {
      "trafficType": "TRANSACTION"
    },
    "fallback": {
      "delivery": {
        "channel": "sms",
        "campaignId": "CABC123",
        "phoneNumber": "15551234567",
        "content": {
          "text": "Order {{order_number}} is ready."
        }
      }
    }
  }
}

Example Response 200

Response
{
  "head": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "channel": "rcs",
    "name": "Order ready",
    "tag": "Order Confirmation",
    "archivedAt": null,
    "draftVersion": 1,
    "publishedVersion": null,
    "revision": 2,
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "state": "DRAFT",
    "hasUnpublishedChanges": false
  },
  "version": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "version": 1,
    "state": "DRAFT",
    "body": {
      "channel": "rcs",
      "contentFormat": "content.v1",
      "content": {
        "blocks": [
          {
            "id": "b1",
            "kind": "text",
            "text": "Order {{order_number}} is ready."
          },
          {
            "id": "b2",
            "kind": "suggestions",
            "suggestions": [
              {
                "type": "REPLY",
                "label": "Thanks",
                "postbackData": "order_ack"
              }
            ]
          }
        ]
      },
      "variables": [
        {
          "key": "order_number",
          "type": "text",
          "required": true,
          "sample": "A-48213"
        }
      ],
      "defaults": {
        "trafficType": "TRANSACTION"
      },
      "fallback": {
        "delivery": {
          "channel": "sms",
          "campaignId": "CABC123",
          "phoneNumber": "15551234567",
          "content": {
            "text": "Order {{order_number}} is ready."
          }
        }
      }
    },
    "contentHash": "9f2c4e…",
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "publishedAt": null
  },
  "validation": {
    "valid": true,
    "errors": [],
    "warnings": []
  }
}

SDK Example

POST/template/:templateId/publish

Validate the current draft and publish it; with no draft this returns 409 NO_DRAFT, and if the draft changed while it was being published, 409 DRAFT_CHANGED. Published versions are immutable. An incomplete draft returns 400 with details.code TEMPLATE_INVALID and per-block errors, and nothing is written. Publish moderates each block's text and images and the fallback text: a flag is a CONTENT_POLICY_FLAGGED error whose message names the category. When the moderation service cannot answer, the check passes, as a send does. An image URL with a variable is moderated at send instead, with its value filled in, and a refused image blocks the recipient with MODERATION.

The following roles are required to use this endpoint: admin, developer, api

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdBody ParamRequiredGroup that owns the template. Must be your active group, with RCS enabled (otherwise 403).

Example Request

Request
{
  "groupId": "G1234567"
}

Example Response 200

Response
{
  "head": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "channel": "rcs",
    "name": "Order ready",
    "tag": "Order Confirmation",
    "archivedAt": null,
    "draftVersion": null,
    "publishedVersion": 1,
    "revision": 2,
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "state": "PUBLISHED",
    "hasUnpublishedChanges": false
  },
  "version": {
    "templateId": "TPL7K3M9QXR2V",
    "groupId": "G1234567",
    "version": 1,
    "state": "PUBLISHED",
    "body": {
      "channel": "rcs",
      "contentFormat": "content.v1",
      "content": {
        "blocks": [
          {
            "id": "b1",
            "kind": "text",
            "text": "Order {{order_number}} is ready."
          },
          {
            "id": "b2",
            "kind": "suggestions",
            "suggestions": [
              {
                "type": "REPLY",
                "label": "Thanks",
                "postbackData": "order_ack"
              }
            ]
          }
        ]
      },
      "variables": [
        {
          "key": "order_number",
          "type": "text",
          "required": true,
          "sample": "A-48213"
        }
      ],
      "defaults": {
        "trafficType": "TRANSACTION"
      },
      "fallback": {
        "delivery": {
          "channel": "sms",
          "campaignId": "CABC123",
          "phoneNumber": "15551234567",
          "content": {
            "text": "Order {{order_number}} is ready."
          }
        }
      }
    },
    "contentHash": "9f2c4e…",
    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
    "createdAt": "2026-10-12T15:00:00.000Z",
    "updatedAt": "2026-10-12T15:00:00.000Z",
    "publishedAt": "2026-10-12T15:05:00.000Z"
  },
  "warnings": []
}

SDK Example

POST/template/:templateId/archive

Archive a template. Every version stays readable; there is no delete.

The following roles are required to use this endpoint: admin, developer, api

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdBody ParamRequiredGroup that owns the template. Must be your active group, with RCS enabled (otherwise 403).

Example Request

Request
{
  "groupId": "G1234567"
}

Example Response 200

Response
{
  "templateId": "TPL7K3M9QXR2V",
  "groupId": "G1234567",
  "channel": "rcs",
  "name": "Order ready",
  "tag": "Order Confirmation",
  "archivedAt": "2026-10-12T16:00:00.000Z",
  "draftVersion": null,
  "publishedVersion": 1,
  "revision": 3,
  "createdBy": "60f7b2a1c9e77c001a2b3c4d",
  "createdAt": "2026-10-12T15:00:00.000Z",
  "updatedAt": "2026-10-12T15:00:00.000Z",
  "state": "ARCHIVED",
  "hasUnpublishedChanges": false
}

SDK Example

GET/template/:templateId/versions

List a template's versions, newest first, without bodies.

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdQuery ParamRequiredGroup that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).
pageQuery ParamOptionalPage number (default 1).
limitQuery ParamOptionalResults per page (default 25, maximum 100).

Example Response 200

Response
{
  "data": [
    {
      "templateId": "TPL7K3M9QXR2V",
      "groupId": "G1234567",
      "version": 1,
      "state": "DRAFT",
      "contentHash": "9f2c4e…",
      "createdBy": "60f7b2a1c9e77c001a2b3c4d",
      "createdAt": "2026-10-12T15:00:00.000Z",
      "updatedAt": "2026-10-12T15:00:00.000Z",
      "publishedAt": null
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 25
}

SDK Example

POST/template/:templateId/validate

Check a supplied body or a stored version for publication without writing anything. Hosted media must belong to your group; external media URLs are not probed. Content moderation runs as at publish, so a flagged text or image is a CONTENT_POLICY_FLAGGED error, and an image URL with a variable is left to the send.

The following roles are required to use this endpoint: admin, developer, api, billing, user

Request Body

FieldTypeRequiredDescription
templateIdPath ParamRequiredTemplate ID (TPL + 10 characters).
groupIdBody ParamRequiredGroup that owns the template. Must be your active group, with RCS enabled (otherwise 403).
bodyBody ParamOptionalA body to check. Send exactly one of body or version.
versionBody ParamOptionalA stored version number, "draft" or "published" to check.

Example Request

Request
{
  "groupId": "G1234567",
  "version": "draft"
}

Example Response 200

Response
{
  "valid": false,
  "contentHash": "9f2c4e…",
  "validatorVersion": "content-1.0.0",
  "errors": [
    {
      "severity": "error",
      "code": "TEXT_REQUIRED",
      "path": "content.blocks[0].text",
      "message": "Message text is required",
      "blockId": "b1"
    }
  ],
  "warnings": [
    {
      "severity": "warning",
      "code": "VARIABLE_UNUSED",
      "path": "variables[0]",
      "message": "first_name is declared but never used"
    }
  ]
}

SDK Example