{
  "openapi": "3.1.0",
  "info": {
    "contact": {
      "email": "support@sinch.com",
      "name": "support at sinch"
    },
    "description": "# Overview\nThe 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](https://dashboard.sinch.com/convapi/message-composer) to [manage templates](https://community.sinch.com/t5/Conversation-API/How-do-I-use-Message-Composer-to-create-omni-channel-message/ta-p/9890).\n\nOne 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.\n\n## Base URL\n\nThe following URLs can be used when making calls to the Template Management API.\n\n|Server|URL|\n|------|---|\n|Template Management API (US Production)|`https://us.template.api.sinch.com`|\n|Template Management API (EU Production)|`https://eu.template.api.sinch.com`|\n|Template Management API (BR Production)|`https://br.template.api.sinch.com`|\n\n## Template Management API Version 2\n\n{% admonition type=\"info\" name=\"Note:\" %}\n\nAs of January 31, 2026, Version 1 endpoints for managing message templates have been deprecated and are no longer accessible. Version 2 is recommended and is the only version currently accessible.\n\n{% /admonition %}\n\nVersion 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:\n\n  - 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](https://developers.sinch.com/docs/conversation/api-reference/conversation/messages/messages_sendmessage#messages/messages_sendmessage/t=request&path=correlation_id)\n  - Improved validation\n  - 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\n\n## Accessing the Template Management API\n\nThe first step towards interacting with the Template Management API is to create an account on the [Sinch Customer Dashboard](https://dashboard.sinch.com). 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.\n\nThe 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.\n```console\ncurl https://us.auth.sinch.com/oauth2/token -d grant_type=client_credentials --user <key_id>:<key_secret>\n```\n\nThe obtained Access Token is then used in the following way to interact with the Template Management API:\n```console\ncurl https://us.template.api.sinch.com/v1/projects/<Project ID>/templates -H \"Authorization: Bearer <Access Token>\"\n```\n\nNote 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 eu.auth.sinch.com to interact with the Template Management API in the EU region(FQDN eu.template.api.sinch.com).\n",
    "title": "Template Management API",
    "version": "2.0",
    "license": {
      "name": "MIT",
      "url": "https://www.sinch.com/toc"
    }
  },
  "security": [
    {
      "Basic": []
    },
    {
      "oAuth2": []
    }
  ],
  "paths": {
    "/v2/projects/{project_id}/templates": {
      "get": {
        "tags": [
          "Templates V2"
        ],
        "summary": "List all templates belonging to a project ID.",
        "operationId": "Templates_v2_ListTemplates",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v2ListTemplatesResponse"
                }
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.response.TemplatesV2ListResponse;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class List {\n\n  private static final Logger LOGGER = Logger.getLogger(List.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n\n    LOGGER.info(\"List templates V2\");\n\n    TemplatesV2ListResponse result = templatesServiceV2.list();\n\n    LOGGER.info(\"Response: \");\n    result.iterator().forEachRemaining(f -> LOGGER.info(String.format(\"- %s: %s\", f.getId(), f)));\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    const response = await sinch.conversation.templatesV2.list({});\n    if (!response.templates?.length) {\n      console.log('No Templates found.');\n      return;\n    }\n    console.log(`✅ Found ${response.templates.length} Templates.`);\n    response.templates.forEach((template) => {\n      console.log(template);\n    });\n  } catch (err) {\n    console.error('❌ Failed to list the Templates:');\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      },
      "post": {
        "tags": [
          "Templates V2"
        ],
        "summary": "Creates a template",
        "operationId": "Templates_v2_CreateTemplate",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/v2Template",
                "required": [
                  "default_translation",
                  "translations"
                ]
              },
              "examples": {
                "createTemplate": {
                  "$ref": "#/components/examples/createTemplateV2"
                }
              }
            }
          },
          "description": "Required. The template to create.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v2Template"
                }
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.models.v1.messages.types.text.TextMessage;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.TemplateTranslation;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.TemplateV2;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.Collections;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Create {\n\n  private static final Logger LOGGER = Logger.getLogger(Create.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n    TemplateV2 request =\n        TemplateV2.builder()\n            .setDefaultTranslation(\"en-US\")\n            .setTranslations(\n                Collections.singletonList(\n                    TemplateTranslation.builder()\n                        .setLanguageCode(\"en-US\")\n                        .setMessage(\n                            TextMessage.builder().setText(\"my text from V2 template\").build())\n                        .build()))\n            .build();\n\n    LOGGER.info(\"Create template\");\n\n    TemplateV2 response = templatesServiceV2.create(request);\n\n    LOGGER.info(\"Response: \" + response);\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    const response = await sinch.conversation.templatesV2.create({\n      createTemplateRequestBody: {\n        default_translation: 'en-US',\n        translations: [\n          {\n            language_code: 'en-US',\n            version: '1',\n            location_message: {\n              title: 'Title',\n              coordinates: { latitude: 59.3360453, longitude: 18.0117363 },\n            },\n          },\n        ],\n      },\n    });\n    console.log('✅ Successfully created the Template.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error('❌ Failed to create the Template:');\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      }
    },
    "/v2/projects/{project_id}/templates/{template_id}/translations": {
      "get": {
        "tags": [
          "Templates V2"
        ],
        "summary": "List translations for a template",
        "operationId": "Templates_v2_ListTranslations",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Required. The ID of the template to fetch.",
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional. The translation's language code.",
            "name": "language_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional. The translation's version.",
            "name": "translation_version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v2ListTranslationsResponse"
                }
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.response.TranslationsV2ListResponse;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class ListTranslations {\n\n  private static final Logger LOGGER = Logger.getLogger(ListTranslations.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    // The ID of the template to retrieve translations for\n    String conversationTemplateId = \"TEMPLATE_ID\";\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n\n    LOGGER.info(\n        String.format(\"List translations for template with ID '%s'\", conversationTemplateId));\n\n    TranslationsV2ListResponse response =\n        templatesServiceV2.listTranslations(conversationTemplateId, null);\n\n    LOGGER.info(\"Response: \");\n\n    response.iterator().forEachRemaining(f -> LOGGER.info(String.format(\"- %s\", f)));\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  // The ID of the Template to list Translations for\n  const templateId = 'TEMPLATE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    const response = await sinch.conversation.templatesV2.listTranslations({\n      template_id: templateId,\n    });\n    if (!response.translations?.length) {\n      console.log(`No Translations found for Template with ID ${templateId}.`);\n      return;\n    }\n    console.log(`✅ Found ${response.translations.length} Translations.`);\n    response.translations.forEach((translation) => {\n      console.log(translation);\n    });\n  } catch (err) {\n    console.error('❌ Failed to list the Translations:');\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      }
    },
    "/v2/projects/{project_id}/templates/{template_id}": {
      "put": {
        "tags": [
          "Templates V2"
        ],
        "summary": "Updates a template.",
        "operationId": "Templates_v2_UpdateTemplate",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The id of the template to be updated. Specified or automatically generated during template creation. Unique per project.",
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/v2Template",
                "required": [
                  "id",
                  "version"
                ]
              },
              "examples": {
                "updateTemplate": {
                  "$ref": "#/components/examples/updateTemplateV2"
                }
              }
            }
          },
          "description": "Required. The updated template.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v2Template"
                }
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.models.v1.messages.types.text.TextMessage;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.TemplateTranslation;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.TemplateV2;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.Collections;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Update {\n\n  private static final Logger LOGGER = Logger.getLogger(Update.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    // The ID of the template to update\n    String conversationTemplateId = \"TEMPLATE_ID\";\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n\n    TemplateV2 request =\n        TemplateV2.builder()\n            .setDescription(\"Updated description from V2 API\")\n            .setVersion(2)\n            .setDefaultTranslation(\"en-US\")\n            .setTranslations(\n                Collections.singletonList(\n                    TemplateTranslation.builder()\n                        .setVersion(\"1\")\n                        .setLanguageCode(\"en-US\")\n                        .setMessage(\n                            TextMessage.builder()\n                                .setText(\"my updated text from V2 template\")\n                                .build())\n                        .build()))\n            .build();\n\n    LOGGER.info(String.format(\"Update template with ID '%s'\", conversationTemplateId));\n\n    TemplateV2 response = templatesServiceV2.update(conversationTemplateId, request);\n\n    LOGGER.info(\"Response: \" + response);\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  // The ID of the Template to update\n  const templateId = 'TEMPLATE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    const response = await sinch.conversation.templatesV2.update({\n      template_id: templateId,\n      updateTemplateRequestBody: {\n        description: 'Updated description from Templates V1 API',\n        default_translation: 'en-US',\n        translations: [\n          {\n            language_code: 'en-US',\n            version: '2',\n            variables: [\n              {\n                key: 'name',\n                preview_value: 'Professor Jones',\n              },\n            ],\n            text_message: {\n              text: 'Hello ${name}. Text message template created with V2 API',\n            },\n          },\n        ],\n      },\n    });\n    console.log('✅ Successfully updated the Template.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error(`❌ Failed to update the Template with ID ${templateId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      },
      "get": {
        "tags": [
          "Templates V2"
        ],
        "summary": "Get a template",
        "operationId": "Templates_v2_GetTemplate",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Required. The ID of the template to fetch.",
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v2Template"
                }
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.domains.conversation.templates.models.v2.TemplateV2;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Get {\n\n  private static final Logger LOGGER = Logger.getLogger(Get.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    // The ID of the template to retrieve\n    String conversationTemplateId = \"TEMPLATE_ID\";\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n\n    LOGGER.info(\n        String.format(\"Get information about template with ID '%s'\", conversationTemplateId));\n\n    TemplateV2 response = templatesServiceV2.get(conversationTemplateId);\n\n    LOGGER.info(\"Response: \" + response);\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  // The ID of the Template to retrieve\n  const templateId = 'TEMPLATE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    const response = await sinch.conversation.templatesV2.get({\n      template_id: templateId,\n    });\n    console.log('✅ Successfully retrieved the Template.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error(`❌ Failed to retrieve the Template with ID ${templateId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      },
      "delete": {
        "tags": [
          "Templates V2"
        ],
        "summary": "Delete a template.",
        "operationId": "Templates_v2_DeleteTemplate",
        "parameters": [
          {
            "description": "Required. The project ID.",
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Required. The ID of the template to delete.",
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runtimeError"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Java",
            "source": "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage conversation.templates.v2;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.conversation.templates.api.v2.TemplatesV2Service;\nimport com.sinch.sdk.models.Configuration;\nimport com.sinch.sdk.models.ConversationRegion;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Delete {\n\n  private static final Logger LOGGER = Logger.getLogger(Delete.class.getName());\n\n  public static void main(String[] args) {\n\n    String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n    String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n    String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n    String conversationRegion = Settings.getConversationRegion().orElse(\"MY_CONVERSATION_REGION\");\n\n    // The ID of the template to delete\n    String conversationTemplateId = \"TEMPLATE_ID\";\n\n    Configuration configuration =\n        Configuration.builder()\n            .setProjectId(projectId)\n            .setKeyId(keyId)\n            .setKeySecret(keySecret)\n            .setConversationRegion(ConversationRegion.from(conversationRegion))\n            .build();\n\n    SinchClient client = new SinchClient(configuration);\n\n    TemplatesV2Service templatesServiceV2 = client.conversation().templates().v2();\n\n    LOGGER.info(String.format(\"Deleting template with ID '%s'\", conversationTemplateId));\n\n    templatesServiceV2.delete(conversationTemplateId);\n\n    LOGGER.info(\"Done\");\n  }\n}\n"
          },
          {
            "lang": "Node.js",
            "source": "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n  const conversationRegion = process.env.SINCH_CONVERSATION_REGION ?? 'MY_CONVERSATION_REGION';\n\n  // The ID of the Template to delete\n  const templateId = 'TEMPLATE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret, conversationRegion });\n\n  try {\n    await sinch.conversation.templatesV2.delete({\n      template_id: templateId,\n    });\n    console.log(`✅ Successfully deleted the Template with ID ${templateId}.`);\n  } catch (err) {\n    console.error(`❌ Failed to delete the Template with ID ${templateId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
          }
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Version 2 endpoints for managing message templates. Recommended version for all users. Includes strongly typed `translations` field (allowing for message definition using JSON structures also used in the send message request of the Conversation API), improved validation, and the ability to override omni-channel templates in favor of channel-specific templates (where available).",
      "name": "Templates V2"
    }
  ],
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "java",
    "csharp",
    "node",
    "php"
  ],
  "servers": [
    {
      "url": "https://{region}.template.api.sinch.com",
      "variables": {
        "region": {
          "default": "us",
          "enum": [
            "us",
            "eu",
            "br"
          ]
        }
      },
      "description": "The {region} variable must be set to us, eu, or br, and it must match the region in which you created your Conversation API app."
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "scheme": "basic",
        "description": "For more information about basic authentication, see [Basic Authentication](https://developers.sinch.com/docs/conversation/api-reference#authentication)."
      },
      "oAuth2": {
        "type": "oauth2",
        "description": "The user name and password are your client_id and key_secret from the [Access keys sections](https://dashboard.sinch.com/settings/access-keys)",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.sinch.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    },
    "examples": {
      "createTemplateV2": {
        "summary": "Create a Conversation API V2 template.",
        "value": {
          "description": "English text template with one parameter using Conversation API generic format.",
          "default_translation": "en-US",
          "translations": [
            {
              "language_code": "en-US",
              "version": "1",
              "variables": [
                {
                  "key": "name",
                  "preview_value": "Mr Jones"
                }
              ],
              "text_message": {
                "text": "Hi ${name}"
              },
              "channel_template_overrides": {
                "WHATSAPP": {
                  "template_reference": {
                    "template_id": "<referenced template id>",
                    "version": "1",
                    "language_code": "en-US",
                    "parameters": {
                      "body[1]text": "defaultValue"
                    }
                  },
                  "parameter_mappings": {
                    "body[1]text": "name"
                  }
                }
              }
            }
          ]
        }
      },
      "updateTemplateV2": {
        "summary": "Updates a Conversation API V2 template.",
        "value": {
          "id": "<template id>",
          "description": "English text template with one parameter using Conversation API generic format.",
          "version": 1,
          "default_translation": "en-US",
          "translations": [
            {
              "language_code": "en-US",
              "version": "1",
              "variables": [
                {
                  "key": "name",
                  "preview_value": "Mr Jones"
                }
              ],
              "text_message": {
                "text": "Hi ${name}"
              },
              "channel_template_overrides": {
                "WHATSAPP": {
                  "template_reference": {
                    "template_id": "<referenced template id>",
                    "version": "1",
                    "language_code": "en-US",
                    "parameters": {
                      "body[1]text": "defaultValue"
                    }
                  },
                  "parameter_mappings": {
                    "body[1]text": "name"
                  }
                }
              }
            }
          ]
        }
      }
    },
    "schemas": {
      "ChannelTemplateOverridesMap": {
        "description": "Field to override the omnichannel template by referring to a channel-specific template.\nThe key in the map must point to a valid conversation channel.\nCurrently only `WHATSAPP` and `KAKAOTALK` are supported",
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/ChannelTemplateOverride"
        }
      },
      "ChannelTemplateOverride": {
        "type": [
          "object"
        ],
        "properties": {
          "template_reference": {
            "$ref": "#/components/schemas/TemplateReference"
          },
          "parameter_mappings": {
            "description": "A mapping between omni-template variables and the channel specific parameters.",
            "type": [
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "typeTemplateVariable": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "preview_value": {
            "type": "string"
          }
        }
      },
      "v2ListTemplatesResponse": {
        "type": [
          "object"
        ],
        "properties": {
          "templates": {
            "type": [
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/v2Template"
            }
          }
        }
      },
      "v2ListTranslationsResponse": {
        "type": [
          "object"
        ],
        "properties": {
          "translations": {
            "type": [
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/v2TemplateTranslation"
            }
          }
        }
      },
      "v2Template": {
        "type": [
          "object"
        ],
        "properties": {
          "id": {
            "description": "The id of the template. Specify this yourself during creation.\nOtherwise, we will generate an ID for you. This must be unique\nfor a given project.",
            "type": [
              "string"
            ],
            "example": "id_string"
          },
          "description": {
            "description": "The description of the template.",
            "type": [
              "string"
            ],
            "example": "Template description"
          },
          "version": {
            "description": "The version of the template. While creating a template, this will be defaulted to 1.\nWhen updating a template, you must supply the latest version of the template in order for the update to be successful.",
            "type": [
              "integer"
            ],
            "example": 1
          },
          "default_translation": {
            "type": [
              "string"
            ],
            "description": "The default translation to use if not specified.\nSpecified as a BCP-47 `language_code` and the `language_code` must exist\nin the translations list.",
            "example": "en-US"
          },
          "translations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v2TemplateTranslation"
            }
          },
          "create_time": {
            "description": "Timestamp of when the template was created.",
            "type": [
              "string"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "update_time": {
            "description": "Timestamp when the template was updated.",
            "type": [
              "string"
            ],
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "v2TemplateTranslation": {
        "type": [
          "object"
        ],
        "required": [
          "language_code",
          "message"
        ],
        "allOf": [
          {
            "$ref": "#/components/schemas/v2MessageCommonProps"
          },
          {
            "$ref": "#/components/schemas/v2MessageTypes"
          }
        ]
      },
      "v2MessageCommonProps": {
        "type": "object",
        "properties": {
          "language_code": {
            "description": "The BCP-47 language code, such as `en-US` or `sr-Latn`. For more information,\nsee https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.",
            "type": [
              "string"
            ]
          },
          "version": {
            "description": "The version of the translation.",
            "type": [
              "string"
            ],
            "example": "1"
          },
          "channel_template_overrides": {
            "$ref": "#/components/schemas/ChannelTemplateOverridesMap"
          },
          "variables": {
            "description": "List of expected variables. Can be used for request validation.",
            "type": [
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/typeTemplateVariable"
            }
          },
          "create_time": {
            "description": "Timestamp when the translation was created.",
            "type": [
              "string"
            ],
            "format": "date-time",
            "readOnly": true
          },
          "update_time": {
            "description": "Timestamp of when the translation was updated.",
            "type": [
              "string"
            ],
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "v2MessageTypes": {
        "type": "object",
        "description": "Must be one of the following: [text_message, card_message, carousel_message,\nchoice_message, location_message, media_message, template_message, list_message]",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CardMessageField"
          },
          {
            "$ref": "#/components/schemas/CarouselMessageField"
          },
          {
            "$ref": "#/components/schemas/ChoiceMessageField"
          },
          {
            "$ref": "#/components/schemas/LocationMessageField"
          },
          {
            "$ref": "#/components/schemas/MediaMessageField"
          },
          {
            "$ref": "#/components/schemas/TemplateMessageField"
          },
          {
            "$ref": "#/components/schemas/TextMessageField"
          },
          {
            "$ref": "#/components/schemas/ListMessageField"
          },
          {
            "$ref": "#/components/schemas/ContactInfoMessageField"
          }
        ]
      },
      "protobufAny": {
        "type": "object",
        "properties": {
          "type_url": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "format": "byte"
          }
        }
      },
      "runtimeError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32"
              },
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/protobufAny"
                }
              },
              "message": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            }
          }
        }
      },
      "TemplateReference": {
        "type": "object",
        "title": "Template reference with concrete parameter values",
        "description": "The referenced template can be an omnichannel template stored in Conversation API Template Store as an AppMessage. You may also reference external channel-specific templates, such as a WhatsApp Business Template. Note that channel-specific template references are not supported when populating the `explicit_channel_omni_message` field.",
        "required": [
          "template_id"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "Used to specify what version of a template to use. Required when using `omni_channel_override` and `omni_template` fields.\nThis will be used in conjunction with `language_code`. Note that, when referencing omni-channel templates using the [Sinch Customer Dashboard](https://dashboard.sinch.com/), the latest version of a given omni-template can be identified by populating this field with `latest`."
          },
          "language_code": {
            "description": "The BCP-47 language code, such as `en_US` or `sr_Latn`.\nFor more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. English is the default `language_code`.\nNote that, while many API calls involving templates accept either the dashed format (`en-US`) or the underscored format (`en_US`), some channel specific templates (for example, WhatsApp channel-specific templates) only accept the underscored format. Note that this field is required for WhatsApp channel-specific templates.",
            "type": "string"
          },
          "parameters": {
            "description": "Required if the template has parameters. Concrete values must\nbe present for all defined parameters\nin the template. Parameters can be different for\ndifferent versions and/or languages of the template.",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "template_id": {
            "description": "The ID of the template. Note that, in the case of WhatsApp channel-specific templates, this field must be populated by the name of the template.",
            "type": "string"
          }
        }
      },
      "CallMessageField": {
        "description": "Message for triggering a call.",
        "type": "object",
        "title": "Call",
        "properties": {
          "call_message": {
            "title": "Call Message",
            "type": "object",
            "required": [
              "phone_number",
              "title"
            ],
            "properties": {
              "phone_number": {
                "description": "Phone number in E.164 with leading +.",
                "type": "string",
                "example": "+15551231234"
              },
              "title": {
                "description": "Title shown close to the phone number.\nThe title is clickable in some cases.",
                "type": "string",
                "example": "Message text"
              }
            }
          }
        }
      },
      "Coordinates": {
        "type": "object",
        "title": "Geographic coordinates",
        "required": [
          "latitude",
          "longitude"
        ],
        "properties": {
          "latitude": {
            "description": "The latitude.",
            "type": "number",
            "format": "float"
          },
          "longitude": {
            "description": "The longitude.",
            "type": "number",
            "format": "float"
          }
        }
      },
      "LocationMessageField": {
        "type": "object",
        "description": "Message containing geographic location.",
        "title": "Location",
        "properties": {
          "location_message": {
            "title": "Location Message",
            "type": "object",
            "required": [
              "coordinates",
              "title"
            ],
            "properties": {
              "coordinates": {
                "$ref": "#/components/schemas/Coordinates"
              },
              "label": {
                "description": "Label or name for the position.",
                "type": "string"
              },
              "title": {
                "description": "The title is shown close to the button or link that leads to a map showing the location. The title can be clickable in some cases.",
                "type": "string"
              }
            }
          }
        }
      },
      "TextMessageField": {
        "type": "object",
        "title": "Text",
        "description": "A message containing only text.",
        "properties": {
          "text_message": {
            "type": "object",
            "title": "Text Message",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "description": "The text to be sent.",
                "type": "string"
              }
            }
          }
        }
      },
      "UrlMessageField": {
        "description": "A generic URL message.",
        "type": "object",
        "title": "URL",
        "properties": {
          "url_message": {
            "title": "URL Message",
            "type": "object",
            "required": [
              "title",
              "url"
            ],
            "properties": {
              "title": {
                "description": "The title shown close to the URL. The title can be clickable in some cases.",
                "type": "string"
              },
              "url": {
                "description": "The url to show.",
                "type": "string"
              }
            }
          }
        }
      },
      "CalendarMessageField": {
        "description": "Message containing details about a calendar event.",
        "type": "object",
        "title": "Calendar",
        "properties": {
          "calendar_message": {
            "title": "Calendar message",
            "type": "object",
            "required": [
              "title",
              "event_start",
              "event_end",
              "event_title",
              "fallback_url"
            ],
            "properties": {
              "title": {
                "description": "The title is shown close to the button that leads to open a user calendar.",
                "type": "string"
              },
              "event_start": {
                "description": "The timestamp defines start of a calendar event.",
                "type": "string",
                "format": "date-time",
                "example": "2025-11-30T10:00:00Z"
              },
              "event_end": {
                "description": "The timestamp defines end of a calendar event.",
                "type": "string",
                "format": "date-time",
                "example": "2025-11-30T11:00:00Z"
              },
              "event_title": {
                "description": "Title of a calendar event.",
                "type": "string"
              },
              "event_description": {
                "description": "Description of a calendar event.",
                "type": "string"
              },
              "fallback_url": {
                "description": "The URL that is opened when the user cannot open a calendar event directly or channel does not have support for this type.",
                "type": "string"
              }
            }
          }
        }
      },
      "ShareLocationMessageField": {
        "description": "Message requesting location from a user.",
        "type": "object",
        "title": "Request location",
        "properties": {
          "share_location_message": {
            "title": "Share Location Message",
            "type": "object",
            "required": [
              "title",
              "fallback_url"
            ],
            "properties": {
              "title": {
                "description": "The title is shown close to the button that leads to open a map to share a location.",
                "type": "string"
              },
              "fallback_url": {
                "description": "The URL that is opened when channel does not have support for this type.",
                "type": "string"
              }
            }
          }
        }
      },
      "choiceTypes": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CallMessageField"
          },
          {
            "$ref": "#/components/schemas/LocationMessageField"
          },
          {
            "$ref": "#/components/schemas/TextMessageField"
          },
          {
            "$ref": "#/components/schemas/UrlMessageField"
          },
          {
            "$ref": "#/components/schemas/CalendarMessageField"
          },
          {
            "$ref": "#/components/schemas/ShareLocationMessageField"
          }
        ]
      },
      "choiceCommonProps": {
        "type": "object",
        "properties": {
          "postback_data": {
            "description": "An optional field. This data will be returned in the ChoiceResponseMessage. The default is message_id_{text, title}."
          }
        }
      },
      "Choice": {
        "description": "A choice is an action the user can take such as buttons for quick replies or other call to actions.",
        "type": "object",
        "title": "Choice message",
        "allOf": [
          {
            "$ref": "#/components/schemas/choiceTypes"
          },
          {
            "$ref": "#/components/schemas/choiceCommonProps"
          }
        ]
      },
      "CardHeight": {
        "description": "You can set the desired size of the card in the message.",
        "type": "string",
        "x-enumDescriptions": {
          "UNSPECIFIED_HEIGHT": "The height of the card is unspecified.",
          "SHORT": "The shortest card height.",
          "MEDIUM": "Medium card height.",
          "TALL": "The tallest card height."
        },
        "enum": [
          "UNSPECIFIED_HEIGHT",
          "SHORT",
          "MEDIUM",
          "TALL"
        ]
      },
      "MediaProperties": {
        "title": "Media Properties",
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "thumbnail_url": {
            "type": "string",
            "description": "An optional parameter. Will be used where it is natively supported."
          },
          "url": {
            "description": "Url to the media file.",
            "type": "string"
          },
          "filename_override": {
            "description": "Overrides the media file name.",
            "type": "string"
          }
        }
      },
      "CardMessage": {
        "description": "Message containing text, media and choices.",
        "title": "Card Message",
        "type": "object",
        "properties": {
          "choices": {
            "description": "You may include choices in your Card Message. The number of choices is limited to 10.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "description": {
            "description": "This is an optional description field that is displayed below the title on the card.",
            "type": "string"
          },
          "height": {
            "$ref": "#/components/schemas/CardHeight"
          },
          "title": {
            "description": "The title of the card message.",
            "type": "string"
          },
          "media_message": {
            "type": "object",
            "description": "A message containing a media component.",
            "allOf": [
              {
                "$ref": "#/components/schemas/MediaProperties"
              }
            ]
          },
          "message_properties": {
            "type": "object",
            "description": "Optional additional properties.",
            "properties": {
              "whatsapp_header": {
                "description": "Optional. Sets the header for the footer of a WhatsApp reply button message, if there is no media in the message. Ignored for other channels. Ignored if not transcoded to a native WhatsApp message with reply buttons.",
                "type": "string"
              }
            }
          }
        }
      },
      "CardMessageField": {
        "description": "Field containing a Card Message",
        "type": "object",
        "title": "Card",
        "properties": {
          "card_message": {
            "$ref": "#/components/schemas/CardMessage"
          }
        }
      },
      "CarouselMessageField": {
        "description": "Message containing a list of cards often rendered horizontally on supported channels.",
        "type": "object",
        "title": "Carousel",
        "properties": {
          "carousel_message": {
            "title": "Carousel Message",
            "type": "object",
            "required": [
              "cards"
            ],
            "properties": {
              "cards": {
                "description": "A list of up to 10 cards.",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardMessage"
                }
              },
              "choices": {
                "description": "Optional. Outer choices on the carousel level. The number of outer choices is limited to 3.",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Choice"
                }
              }
            }
          }
        }
      },
      "Choices": {
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "description": "The number of choices is limited to 10.",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          }
        }
      },
      "ChoiceMessagePropertiesField": {
        "type": "object",
        "title": "Properties",
        "description": "Additional properties for the message.",
        "properties": {
          "message_properties": {
            "type": "object",
            "properties": {
              "whatsapp_footer": {
                "description": "Optional. Sets the text for the footer of a WhatsApp reply button or URL button message. Ignored for other channels.",
                "type": "string"
              }
            }
          }
        }
      },
      "ChoiceMessageField": {
        "description": "Message containing choices/actions.",
        "type": "object",
        "title": "Choice",
        "properties": {
          "choice_message": {
            "title": "Choice Message",
            "type": "object",
            "required": [
              "choices"
            ],
            "allOf": [
              {
                "description": "A message containing choices."
              },
              {
                "$ref": "#/components/schemas/Choices"
              },
              {
                "$ref": "#/components/schemas/TextMessageField"
              },
              {
                "$ref": "#/components/schemas/ChoiceMessagePropertiesField"
              }
            ]
          }
        }
      },
      "MediaMessageField": {
        "type": "object",
        "title": "Media Message",
        "description": "A message containing a media component, such as an image, document, or video.",
        "properties": {
          "media_message": {
            "$ref": "#/components/schemas/MediaProperties"
          }
        }
      },
      "TemplateReferenceWithVersion": {
        "type": "object",
        "allOf": [
          {
            "required": [
              "version"
            ]
          },
          {
            "$ref": "#/components/schemas/TemplateReference"
          }
        ]
      },
      "TemplateMessageField": {
        "type": "object",
        "description": "Message referring to predefined template",
        "title": "Template Message",
        "properties": {
          "template_message": {
            "type": "object",
            "title": "Template Message",
            "properties": {
              "channel_template": {
                "description": "Optional. Channel specific template reference with parameters per channel.\nThe channel template if exists overrides the omnichannel template.\nAt least one of `channel_template` or `omni_template` needs to be present.\nThe key in the map must point to a valid conversation channel as\ndefined by the enum ConversationChannel.",
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/TemplateReference"
                }
              },
              "omni_template": {
                "$ref": "#/components/schemas/TemplateReferenceWithVersion"
              }
            }
          }
        }
      },
      "ChoiceItem": {
        "type": "object",
        "title": "Choice",
        "description": "A message component for interactive messages, containing a choice.",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Required parameter. Title for the choice item."
          },
          "description": {
            "type": "string",
            "description": "Optional parameter. The description (or subtitle) of this choice item."
          },
          "media": {
            "description": "Optional parameter. The media of this choice item.",
            "allOf": [
              {
                "$ref": "#/components/schemas/MediaProperties"
              }
            ]
          },
          "postback_data": {
            "type": "string",
            "description": "Optional parameter. Postback data that will be returned in the MO if the user selects this option."
          }
        }
      },
      "ProductItem": {
        "type": "object",
        "title": "Product",
        "description": "A message component for interactive messages, containing a product.",
        "required": [
          "id",
          "marketplace"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Required parameter. The ID for the product."
          },
          "marketplace": {
            "type": "string",
            "description": "Required parameter. The marketplace to which the product belongs.",
            "example": "FACEBOOK"
          },
          "quantity": {
            "type": "integer",
            "format": "int32",
            "description": "Output only. The quantity of the chosen product."
          },
          "item_price": {
            "type": "number",
            "format": "float",
            "description": "Output only. The price for one unit of the chosen product."
          },
          "currency": {
            "type": "string",
            "description": "Output only. The currency of the item_price."
          }
        }
      },
      "ListItem": {
        "type": "object",
        "title": "List Item",
        "description": "Item containing either choiceItem or ProductItem",
        "oneOf": [
          {
            "required": [
              "choice"
            ],
            "type": "object",
            "properties": {
              "choice": {
                "$ref": "#/components/schemas/ChoiceItem"
              }
            },
            "title": "Choice"
          },
          {
            "required": [
              "product"
            ],
            "type": "object",
            "properties": {
              "product": {
                "$ref": "#/components/schemas/ProductItem"
              }
            },
            "title": "Product"
          }
        ]
      },
      "ListSection": {
        "type": "object",
        "title": "List Section",
        "description": "Section for interactive WhatsApp messages containing ListItem",
        "required": [
          "items"
        ],
        "properties": {
          "title": {
            "description": "Optional parameter. Title for list section.",
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListItem"
            }
          }
        }
      },
      "ListMessageField": {
        "type": "object",
        "title": "List",
        "description": "A message containing a list of options to choose from. All items must be of the same type.",
        "properties": {
          "list_message": {
            "title": "List Message",
            "type": "object",
            "required": [
              "title",
              "sections"
            ],
            "properties": {
              "title": {
                "description": "A title for the message that is displayed near the products or choices.",
                "type": "string"
              },
              "description": {
                "description": "This is an optional field, containing a description for the message.",
                "type": "string"
              },
              "media": {
                "$ref": "#/components/schemas/MediaProperties"
              },
              "sections": {
                "description": "List of ListSection objects containing choices to be presented in the list message.",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ListSection"
                }
              },
              "message_properties": {
                "description": "Additional properties for the message. Required if sending a product list message.",
                "properties": {
                  "catalog_id": {
                    "description": "Required if sending a product list message. The ID of the catalog to which the products belong.",
                    "type": "string"
                  },
                  "menu": {
                    "description": "Optional. Sets the text for the menu of a choice list message.",
                    "type": "string"
                  },
                  "whatsapp_header": {
                    "description": "Optional. Sets the text for the header of a WhatsApp choice list message. Ignored for other channels.",
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "NameInfo": {
        "type": "object",
        "title": "Name of the contact",
        "description": "Name information of the contact.",
        "required": [
          "full_name"
        ],
        "properties": {
          "full_name": {
            "description": "Full name of the contact",
            "type": "string"
          },
          "first_name": {
            "description": "First name.",
            "type": "string"
          },
          "last_name": {
            "description": "Last name.",
            "type": "string"
          },
          "middle_name": {
            "description": "Middle name.",
            "type": "string"
          },
          "prefix": {
            "description": "Prefix before the name. e.g. Mr, Mrs, Dr etc.",
            "type": "string"
          },
          "suffix": {
            "description": "Suffix after the name.",
            "type": "string"
          }
        }
      },
      "PhoneNumberInfo": {
        "type": "object",
        "title": "Phone number",
        "description": "Phone numbers of the contact.",
        "required": [
          "phone_number"
        ],
        "properties": {
          "phone_number": {
            "description": "Phone number with country code included.",
            "type": "string"
          },
          "type": {
            "description": "Phone number type, e.g. WORK or HOME.",
            "type": "string"
          }
        }
      },
      "AddressInfo": {
        "type": "object",
        "title": "Address information",
        "description": "Physical addresses of the contact.",
        "properties": {
          "city": {
            "description": "City Name",
            "type": "string"
          },
          "country": {
            "description": "Country Name",
            "type": "string"
          },
          "state": {
            "description": "Name of a state or region of a country.",
            "type": "string"
          },
          "zip": {
            "description": "Zip/postal code",
            "type": "string"
          },
          "type": {
            "description": "Address type, e.g. WORK or HOME",
            "type": "string"
          },
          "country_code": {
            "description": "Two letter country code.",
            "type": "string"
          }
        }
      },
      "EmailInfo": {
        "type": "object",
        "title": "Email information",
        "description": "Email addresses of the contact.",
        "required": [
          "email_address"
        ],
        "properties": {
          "email_address": {
            "description": "Email address.",
            "type": "string"
          },
          "type": {
            "description": "Email address type. e.g. WORK or HOME.",
            "type": "string"
          }
        }
      },
      "OrganizationInfo": {
        "type": "object",
        "title": "Organization information",
        "description": "Organization information of the contact.",
        "properties": {
          "company": {
            "description": "Company name",
            "type": "string"
          },
          "department": {
            "description": "Department at the company",
            "type": "string"
          },
          "title": {
            "description": "Corporate title, e.g. Software engineer",
            "type": "string"
          }
        }
      },
      "UrlInfo": {
        "type": "object",
        "title": "URL Info",
        "description": "A URL/website",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "description": "The URL to be referenced",
            "type": "string"
          },
          "type": {
            "description": "Optional. URL type, e.g. Org or Social",
            "type": "string"
          }
        }
      },
      "ContactInfoMessageField": {
        "type": "object",
        "description": "Message containing contact information.",
        "title": "Contact Info",
        "properties": {
          "contact_info_message": {
            "title": "Contact Info Message",
            "type": "object",
            "required": [
              "name",
              "phone_numbers"
            ],
            "properties": {
              "name": {
                "$ref": "#/components/schemas/NameInfo"
              },
              "phone_numbers": {
                "description": "Phone numbers of the contact",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PhoneNumberInfo"
                }
              },
              "addresses": {
                "description": "Physical addresses of the contact",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AddressInfo"
                }
              },
              "email_addresses": {
                "description": "Email addresses of the contact",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/EmailInfo"
                }
              },
              "organization": {
                "$ref": "#/components/schemas/OrganizationInfo"
              },
              "urls": {
                "description": "URLs/websites associated with the contact",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UrlInfo"
                }
              },
              "birthday": {
                "description": "Date of birth in YYYY-MM-DD format.",
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "x-proxy-enabled": true,
  "x-samples-enabled": true
}