Download OpenAPI specification:Download

Managing templates

The Template Management API offers a way to manage templates that can be used together with the Conversation API. Note that you may also use the Message Composer tool on the Sinch Customer Dashboard to manage templates.

One can view a template as a pre-defined message that can optionally contain some parameters to facilitate some customization of the pre-defined message. This feature can, for instance, be used to construct a generic customer welcome message where the customer's name can be injected via a parameter. It's also possible to provide translations to different languages when creating a template to make it possible to reuse one template for different languages.

Template Management API Version 2

Version 2 of the Template Management API was released on September 4, 2023. We recommend using this version of the Template Management API for all template management activities via API calls. In addition to the feature set included with Version 1, Version 2 also includes:

  • Strongly typed translations field content, allowing the user to define the message using the same JSON structure used to define messages in a send message request
  • Improved validation
  • The option to override the omni-channel template configuration with a channel-specific template (for channels on which channel-specific templates can be created) using the channel_template_overrides field

Accessing the Template Management API

The first step towards interacting with the Template Management API is to create an account on the Sinch Customer Dashboard. The next step is to create an Access Key under the Settings tab and note down the provided Key ID and Key Secret in a secure location. Also make sure to remember the Project ID since your template will be placed under the provided Project ID.

The Key ID and the Key Secret are then used in the following way to obtain a valid OAuth2 Access Token that will be used to authenticate towards the Template Management API.

curl -d grant_type=client_credentials --user <key_id>:<key_secret>

The obtained Access Token is then used in the following way to interact with the Template Management API:

curl<Project ID>/templates -H "Authorization: Bearer <Access Token>"

Note that the obtained token above is only valid when interacting with the Template Management API in the US region. Another Access Token must be obtained from the FQDN to interact with the Template Management API in the EU region(FQDN