{
   "openapi": "3.0.3",
   "info": {
      "version": "1.5.2",
      "title": "WhatsApp Template Management API",
      "x-metaTitle": "Vonage WhatsApp Template Management API Reference | Vonage API Documentation",
      "x-metaDescription": "Find quick answers to questions about the Vonage WhatsApp Template Management API in this reference guide. Learn more in Vonage's API documentation.",
      "description": "The Messages API now offers the WhatsApp Template Management API that allow you to manage templates for your WABAs and cut out the manual step of submitting and checking templates manually. \nYou can manage your templates using the Template Management API, including adding new templates, retrieving their statuses, and deleting any that are already in use.\nDifferent sorts of media can be sent with each WhatsApp message template. You can manage your media files via the API and set up extra features to improve their functionality.\nSee [the Vonage Developer Portal](https://developer.vonage.com/messages/) for more information.\n",
      "contact": {
         "name": "Vonage DevRel",
         "email": "devrel@vonage.com",
         "url": "https://developer.vonage.com/"
      },
      "license": {
         "name": "Apache 2.0",
         "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
      },
      "x-label": "Beta"
   },
   "tags": [
      {
         "name": "WhatsApp Template Management",
         "description": "Create and Manage WhatsApp Message Templates"
      }
   ],
   "servers": [
      {
         "url": "https://api.nexmo.com/v2/whatsapp-manager",
         "description": "API Server"
      }
   ],
   "paths": {
      "/wabas/{id}/templates": {
         "parameters": [
            {
               "$ref": "#/components/parameters/WabaId"
            }
         ],
         "get": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "List Templates",
            "operationId": "ListTemplates",
            "description": "Get a list of templates,and their associated metadata, for the specified WABA ID. If multiple language variants exist for a template, each variant will be returned as a separate template object.",
            "parameters": [
               {
                  "schema": {
                     "type": "number",
                     "minLength": 1,
                     "maxLength": 500,
                     "default": 25,
                     "example": 10
                  },
                  "in": "query",
                  "name": "limit",
                  "description": "The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "MAZDZD"
                  },
                  "in": "query",
                  "name": "before",
                  "description": "A cursor point used for a paginated request to indicate the template to paginate backwards from."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "MjQZD"
                  },
                  "in": "query",
                  "name": "after",
                  "description": "A cursor point used for a paginated request to indicate the template to paginate forwards from."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "UTILITY",
                     "enum": [
                        "UTILITY",
                        "AUTHENTICATION",
                        "MARKETING"
                     ]
                  },
                  "in": "query",
                  "name": "category",
                  "description": "A filter  for returning only templates matching a specific category."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "special offer"
                  },
                  "in": "query",
                  "name": "content",
                  "description": "A search filter representing the content of a template. Only matching templates will be returned in the list."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "en"
                  },
                  "in": "query",
                  "name": "language",
                  "description": "A filter  for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) "
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "My Template"
                  },
                  "in": "query",
                  "name": "name",
                  "description": "A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "special offer"
                  },
                  "in": "query",
                  "name": "name_or_content",
                  "description": "A search filter representing the name, either full or partial, or content of a template. Only matching templates will be returned in the list."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "RED",
                     "enum": [
                        "GREEN",
                        "YELLOW",
                        "RED",
                        "UNKNOWN"
                     ]
                  },
                  "in": "query",
                  "name": "quality_score",
                  "description": "A search filter representing the quality score of a template. Only matching templates will be returned in the list."
               },
               {
                  "schema": {
                     "type": "string",
                     "example": "APPROVED",
                     "enum": [
                        "APPROVED",
                        "IN_APPEAL",
                        "PENDING",
                        "REJECTED",
                        "DISABLED",
                        "PAUSED",
                        "LIMIT_EXCEEDED"
                     ]
                  },
                  "in": "query",
                  "name": "status",
                  "description": "A filter for returning only templates matching a specific status. "
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/ListTemplatesResponse200"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "post": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "Create Template",
            "operationId": "CreateTemplate",
            "description": "Submit a new template to be associated with this WABA",
            "parameters": [
               {
                  "schema": {
                     "type": "string"
                  },
                  "in": "header",
                  "name": "Content-Type",
                  "required": true,
                  "description": "application/json",
                  "example": "application/json"
               }
            ],
            "requestBody": {
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/TemplateBaseProperties"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/CreateTemplateResponse200"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "422": {
                  "$ref": "#/components/responses/422"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "delete": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "Delete Template",
            "operationId": "DeleteTemplate",
            "description": "Delete a template of the specified name associated with the WABA ID",
            "parameters": [
               {
                  "name": "name",
                  "in": "query",
                  "schema": {
                     "type": "string"
                  },
                  "example": "my_template",
                  "required": true,
                  "description": "The name of the template to be deleted. The `name` is required, but if specified without `hsm_id` being specified then **all** templates matching that name will be deleted."
               },
               {
                  "name": "hsm_id",
                  "in": "query",
                  "schema": {
                     "type": "string"
                  },
                  "example": "408766354711449",
                  "required": false,
                  "description": "The ID of the specific template to be deleted. Only the template matching **both** the specified `name` and `hsm_id` will be deleted."
               }
            ],
            "responses": {
               "204": {
                  "$ref": "#/components/responses/204"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/wabas/{id}/templates/{template_id}": {
         "parameters": [
            {
               "$ref": "#/components/parameters/WabaId"
            },
            {
               "$ref": "#/components/parameters/TemplateId"
            }
         ],
         "get": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "Get Template",
            "operationId": "GetTemplate",
            "description": "Get details of an existing template identified by the WABA and Template ID",
            "responses": {
               "200": {
                  "$ref": "#/components/responses/GetTemplateResponse200"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "put": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "Update Template",
            "operationId": "UpdateTemplate",
            "description": "Update an existing template identified by the WABA and Template ID",
            "parameters": [
               {
                  "schema": {
                     "type": "string"
                  },
                  "in": "header",
                  "name": "Content-Type",
                  "description": "application/json"
               }
            ],
            "requestBody": {
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/TemplateBaseProperties"
                     }
                  }
               }
            },
            "responses": {
               "204": {
                  "$ref": "#/components/responses/204"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/media/uploads": {
         "post": {
            "tags": [
               "WhatsApp Template Management"
            ],
            "security": [
               {
                  "bearerAuth": []
               }
            ],
            "summary": "Media Upload",
            "operationId": "MediaUpload",
            "description": "Upload media files to the WhatsApp platform. Once uploaded, you can use an uploaded file's handle to create a media template.",
            "parameters": [
               {
                  "schema": {
                     "type": "string"
                  },
                  "in": "query",
                  "name": "file_type",
                  "required": true,
                  "description": "The file's MIME type. Valid values are: `image/jpeg`, `image/jpg`, `image/png`, and `video/mp4`."
               },
               {
                  "schema": {
                     "type": "string"
                  },
                  "in": "header",
                  "name": "Content-Type",
                  "description": "multipart/form-data",
                  "required": true
               }
            ],
            "requestBody": {
               "content": {
                  "multipart/form-data": {
                     "schema": {
                        "type": "object",
                        "properties": {
                           "mediafile": {
                              "type": "string",
                              "format": "binary",
                              "description": "The file to be uploaded. [See an example cURL request](/messages/guides/whatsapp-template-management#uploading-media)",
                              "example": "--73dc24e0-b350-48f8-931e-eab338df00e1--"
                           }
                        }
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/MediaUploadResponse200"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      }
   },
   "components": {
      "securitySchemes": {
         "bearerAuth": {
            "type": "http",
            "scheme": "bearer",
            "bearerFormat": "JWT"
         }
      },
      "parameters": {
         "WabaId": {
            "name": "id",
            "description": "The id of the WABA",
            "in": "path",
            "required": true,
            "schema": {
               "type": "string",
               "example": "345688589250625"
            }
         },
         "TemplateId": {
            "name": "template_id",
            "description": "The id of the template",
            "in": "path",
            "required": true,
            "schema": {
               "type": "string",
               "example": "1045638762820500"
            }
         }
      },
      "schemas": {
         "WhatsAppTemplate": {
            "allOf": [
               {
                  "$ref": "#/components/schemas/TemplateResponseProperties"
               },
               {
                  "$ref": "#/components/schemas/TemplateBaseProperties"
               }
            ]
         },
         "TemplateBaseProperties": {
            "type": "object",
            "required": [
               "name",
               "language",
               "category",
               "components"
            ],
            "properties": {
               "name": {
                  "type": "string",
                  "description": "The name of the template",
                  "example": "sample_issue_resolution"
               },
               "language": {
                  "type": "string",
                  "description": "The language of the template. The same template name can be used for multiple language versions. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/). Note: Adding new languages on *legacy* template categories has been disabled by Meta, see the documentation for [Language Variants](/messages/whatsapp-template-management/overview#language-variants) and [Categories](/messages/whatsapp-template-management/overview#template-categories)",
                  "example": "en"
               },
               "category": {
                  "type": "string",
                  "description": "The required category of the template. The category determines what the template will be used for. Note: Adding new languages on *legacy* template categories has been disabled by Meta, see the documentation for [Language Variants](/messages/whatsapp-template-management/overview#language-variants) and [Categories](/messages/whatsapp-template-management/overview#template-categories)",
                  "example": "UTILITY",
                  "enum": [
                     "UTILITY",
                     "AUTHENTICATION",
                     "MARKETING"
                  ]
               },
               "allow_category_change": {
                  "type": "boolean",
                  "deprecated": true,
                  "description": "**This field is now deprecated. This functionality is now enabled by default by Meta and cannot be disabled. See the [Meta documentation](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/) for more infomration.**\n\n~~An optional parameter which, when set to `true`, can avoid template rejection due to mis-categorization.\nIncluding this parameter, with a value of `true`, will allow Meta to re-assign the template to a different category as appropriate.~~\n",
                  "example": true,
                  "enum": [
                     true,
                     false
                  ]
               },
               "components": {
                  "type": "array",
                  "description": "An array of objects representing the parts of the template itself. A template must have at least one component, and at least one component must be of type `BODY`. `HEADER`, `FOOTER`, and `BUTTONS` components are optional.",
                  "minItems": 1,
                  "maxItems": 4,
                  "uniqueItems": true,
                  "items": {
                     "type": "object",
                     "anyOf": [
                        {
                           "title": "Header",
                           "x-tab-id": "HEADER",
                           "oneOf": [
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsTextHeader"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsMediaHeader"
                              }
                           ]
                        },
                        {
                           "title": "Body",
                           "x-tab-id": "BODY",
                           "oneOf": [
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsBodyNoParams"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsBodyNamedParams"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsBodyPositionalParams"
                              }
                           ]
                        },
                        {
                           "title": "Footer",
                           "x-tab-id": "FOOTER",
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsFooter"
                              }
                           ]
                        },
                        {
                           "title": "Buttons",
                           "x-tab-id": "BUTTONS",
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/TemplateComponentButtonsNew"
                              }
                           ]
                        }
                     ]
                  },
                  "example": [
                     {
                        "type": "BODY",
                        "text": "Your parcel will be delivered today"
                     }
                  ]
               }
            }
         },
         "TemplateComponentsTextHeader": {
            "allOf": [
               {
                  "title": "Text Header",
                  "x-tab-id": "Text Header",
                  "oneOf": [
                     {
                        "$ref": "#/components/schemas/TemplateComponentsTextHeaderNoParams"
                     },
                     {
                        "$ref": "#/components/schemas/TemplateComponentsTextHeaderNamedParams"
                     },
                     {
                        "$ref": "#/components/schemas/TemplateComponentsTextHeaderPositionalParams"
                     }
                  ]
               }
            ]
         },
         "TemplateComponentsMediaHeader": {
            "allOf": [
               {
                  "title": "Media Header",
                  "x-tab-id": "Media Header",
                  "properties": {
                     "type": {
                        "type": "string",
                        "description": "The type of template component.",
                        "example": "HEADER",
                        "enum": [
                           "HEADER"
                        ]
                     },
                     "format": {
                        "type": "string",
                        "description": "The format of the template component. For a Media Header, `format` can be `IMAGE`, `GIF`, `VIDEO`, or `DOCUMENT`.",
                        "example": "IMAGE",
                        "enum": [
                           "IMAGE",
                           "GIF",
                           "VIDEO",
                           "DOCUMENT"
                        ]
                     },
                     "example": {
                        "type": "object",
                        "description": "Must be included for a Media Header component.",
                        "properties": {
                           "header_handle": {
                              "type": "string",
                              "description": "The identifier or 'handle' of a file received in the [response to a Media Upload](#MediaUpload-responses).",
                              "example": "h:3:MjAyMi0wOC0wNCUyMDExXzE0XzQ0Ljc0Mjk0NV9XaGF0c0FwcCUyMEltYWdlJTIwMjAyMi0wOC0wNCUyMGF0JTIwMTEuMDcuMzclMjBBTS5qcGVn:aW1hZ2UvanBlZw==:ARZBgKmPpdCDKM9p8VulwOuNGrHg5RZYIrvwYWpn5YgJezdnoufigT9OTwtRYfAhP4EbpvJik7GZv5QGT7cU7k1Fqu3fnDxEe5XkdIypjSgngQ:e:1662475718:ARauPjU_zJe83Ukp5pY"
                           }
                        }
                     }
                  }
               }
            ]
         },
         "TemplateComponentsBodyNoParams": {
            "description": "Body without parameters",
            "type": "object",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "BODY",
                  "enum": [
                     "BODY"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 1024,
                  "description": "The text to be displayed in this template component. Body text can be a maximum of 1024 characters.",
                  "example": "Your parcel is out for delivery."
               }
            }
         },
         "TemplateComponentsBodyNamedParams": {
            "description": "Body with named parameters",
            "type": "object",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "BODY",
                  "enum": [
                     "BODY"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 1024,
                  "description": "The text to be displayed in this template component, with named placeholders. Named placeholders take the form {{placeholder_name}}.\nBody text support multiple parameters.\nBody text can be a maximum of 1024 characters.\n",
                  "example": "Your parcel from {{courier}} is out for delivery at {{time}}."
               },
               "example": {
                  "description": "Must be included when using named placeholders in the text.",
                  "properties": {
                     "body_text_named_params": {
                        "type": "array",
                        "description": "Example value for the named placeholder.",
                        "items": {
                           "type": "object",
                           "properties": {
                              "param_name": {
                                 "type": "string",
                                 "description": "The name of the named parameter placeholder, matching the name used in the text.",
                                 "example": "courier"
                              },
                              "example": {
                                 "type": "string",
                                 "description": "The value to replace the placeholder with in the template preview and when sending messages using the template.",
                                 "example": "FedEx"
                              }
                           }
                        },
                        "example": [
                           {
                              "param_name": "courier",
                              "example": "FedEx"
                           },
                           {
                              "param_name": "time",
                              "example": "2:00 PM"
                           }
                        ]
                     }
                  }
               }
            }
         },
         "TemplateComponentsBodyPositionalParams": {
            "description": "Body with positional parameters",
            "type": "object",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "BODY",
                  "enum": [
                     "BODY"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 1024,
                  "description": "The text to be displayed in this template component, with positional placeholders. Positional placeholders take the form {{1}}.\nBody text support multiple parameters.\nBody text can be a maximum of 1024 characters.\n",
                  "example": "Your parcel from {{1}} is out for delivery at {{2}}."
               },
               "example": {
                  "type": "object",
                  "description": "Must be included when using positional placeholders in the text.",
                  "properties": {
                     "body_text": {
                        "type": "array",
                        "description": "Example value for the positional placeholder.",
                        "items": {
                           "type": "string",
                           "description": "Example value to replace the positional placeholder within the template.",
                           "example": "FedEx"
                        },
                        "example": [
                           "FedEx",
                           "2:00 PM"
                        ]
                     }
                  }
               }
            }
         },
         "TemplateComponentsFooter": {
            "type": "object",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "FOOTER",
                  "enum": [
                     "FOOTER"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 60,
                  "description": "The text to be displayed in this template component. 60 characters maximum.",
                  "example": "Thank you for shopping with us."
               }
            }
         },
         "TemplateComponentButtonsNew": {
            "allOf": [
               {
                  "title": "Buttons",
                  "x-tab-id": "Buttons",
                  "properties": {
                     "type": {
                        "type": "string",
                        "description": "The type of template component.",
                        "example": "BUTTONS",
                        "enum": [
                           "BUTTONS"
                        ]
                     },
                     "buttons": {
                        "type": "array",
                        "maxItems": 10,
                        "description": "An array of objects representing button components.\nTemplates can have a combination of up to 10 button components in total, although there are limits to individual buttons of the same type as well as combination limits, see the [Meta Documentation](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/components#buttons) for more information.\n",
                        "items": {
                           "type": "object",
                           "anyOf": [
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsButtonsQuickReply"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsButtonsURL"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsButtonsPhoneNumber"
                              },
                              {
                                 "$ref": "#/components/schemas/TemplateComponentsButtonsOTP"
                              }
                           ]
                        }
                     }
                  }
               }
            ]
         },
         "TemplateComponentsTextHeaderNoParams": {
            "description": "Text Header without parameters",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "HEADER",
                  "enum": [
                     "HEADER"
                  ]
               },
               "format": {
                  "type": "string",
                  "description": "The format of the template component. For a Text Header, `format` is always `TEXT`.",
                  "example": "TEXT",
                  "enum": [
                     "TEXT"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 60,
                  "description": "The text to be displayed in this template component. Maximum 60 characters.",
                  "example": "Your parcel is out for delivery."
               }
            }
         },
         "TemplateComponentsTextHeaderNamedParams": {
            "description": "Text Header with named parameters",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "HEADER",
                  "enum": [
                     "HEADER"
                  ]
               },
               "format": {
                  "type": "string",
                  "description": "The format of the template component. For a Text Header, `format` is always `TEXT`.",
                  "example": "TEXT",
                  "enum": [
                     "TEXT"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 60,
                  "description": "The text to be displayed in this template component, with named placeholders.  One parameter is allowed in a Header component. Named placeholders take the form {{placeholder_name}}. Maximum 60 characters.",
                  "example": "Your parcel from {{courier}} is out for delivery."
               },
               "example": {
                  "type": "object",
                  "description": "Must be included when using named placeholders in the text.",
                  "properties": {
                     "header_text_named_params": {
                        "type": "array",
                        "description": "Example value for the named placeholder.",
                        "items": {
                           "type": "object",
                           "properties": {
                              "param_name": {
                                 "type": "string",
                                 "description": "The name of the named parameter placeholder, matching the name used in the text.",
                                 "example": "courier"
                              },
                              "example": {
                                 "type": "string",
                                 "description": "The value to replace the placeholder with in the template preview and when sending messages using the template.",
                                 "example": "FedEx"
                              }
                           }
                        },
                        "example": [
                           {
                              "param_name": "courier",
                              "example": "FedEx"
                           }
                        ]
                     }
                  }
               }
            }
         },
         "TemplateComponentsTextHeaderPositionalParams": {
            "description": "Text Header with positional parameters",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of template component.",
                  "example": "HEADER",
                  "enum": [
                     "HEADER"
                  ]
               },
               "format": {
                  "type": "string",
                  "description": "The format of the template component. For a Text Header, `format` is always `TEXT`.",
                  "example": "TEXT",
                  "enum": [
                     "TEXT"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 60,
                  "description": "The text to be displayed in this template component, with positional placeholders. One parameter is allowed in a Header component. Positional placeholders take the form {{1}}. Maximum 60 characters.",
                  "example": "Your parcel from {{1}} is out for delivery."
               },
               "example": {
                  "type": "object",
                  "description": "Must be included when using positional placeholders in the text.",
                  "properties": {
                     "header_text": {
                        "type": "array",
                        "description": "Example value for the positional placeholder.",
                        "items": {
                           "type": "string",
                           "description": "Example value to replace the positional placeholder within the template.",
                           "example": "FedEx"
                        },
                        "example": [
                           "FedEx"
                        ]
                     }
                  }
               }
            }
         },
         "TemplateComponentsButtonsQuickReply": {
            "allOf": [
               {
                  "title": "Quick Reply Button",
                  "x-tab-id": "Quick Reply Button",
                  "description": "Button component with `type` `QUICK_REPLY`",
                  "properties": {
                     "type": {
                        "type": "string",
                        "description": "The type of button.",
                        "example": "QUICK_REPLY",
                        "enum": [
                           "QUICK_REPLY"
                        ]
                     },
                     "text": {
                        "type": "string",
                        "maxLength": 25,
                        "description": "The text to appear on the button. 25 characters maximum.",
                        "example": "Yes"
                     }
                  }
               }
            ]
         },
         "TemplateComponentsButtonsURL": {
            "allOf": [
               {
                  "title": "URL Button",
                  "x-tab-id": "URL Button",
                  "description": "Button component with `type` `URL`",
                  "properties": {
                     "type": {
                        "type": "string",
                        "description": "The type of button.",
                        "example": "URL",
                        "enum": [
                           "URL"
                        ]
                     },
                     "text": {
                        "type": "string",
                        "maxLength": 25,
                        "description": "The text to appear on the button. 25 characters maximum.",
                        "example": "Visit our site"
                     },
                     "url": {
                        "type": "string",
                        "maxLength": 2000,
                        "description": "A URL to which the end-user will be directed when hitting the button. URL strings can contain up to one positional parameter, in the form {{1}} at the end of the string. If using a parameter in the URL, the `example` parameter must be included with an example value for the parameter.",
                        "example": "https://example.com/special-offer-opt-in?promo={{1}}"
                     },
                     "example": {
                        "type": "array",
                        "description": "An array containing one string which is the URL including an example value for the positional parameter within the URL. Must be included when using a positional parameter in the URL.",
                        "items": {
                           "type": "string",
                           "description": "The URL including an example value for the positional parameter within the URL."
                        },
                        "example": [
                           "https://example.com/special-offer-opt-in?promo=SUMMER_SALE"
                        ]
                     }
                  }
               }
            ]
         },
         "TemplateComponentsButtonsPhoneNumber": {
            "allOf": [
               {
                  "title": "Phone Number Button",
                  "x-tab-id": "Phone Number Button",
                  "description": "Button component with `type` `PHONE_NUMBER`",
                  "properties": {
                     "type": {
                        "type": "string",
                        "description": "The type of button.",
                        "example": "PHONE_NUMBER",
                        "enum": [
                           "PHONE_NUMBER"
                        ]
                     },
                     "text": {
                        "type": "string",
                        "maxLength": 25,
                        "description": "The text to appear on the button. 25 characters maximum.",
                        "example": "Call us"
                     },
                     "phone_number": {
                        "type": "string",
                        "format": "e164",
                        "maxLength": 20,
                        "description": "Phone number to which a phone call would be placed by the end-user when hitting the button. Must be set when `type` is `PHONE_NUMBER`. 20 characters maximum.",
                        "example": "441234567890"
                     }
                  }
               }
            ]
         },
         "TemplateComponentsButtonsOTP": {
            "allOf": [
               {
                  "title": "OTP Button",
                  "x-tab-id": "OTP Button",
                  "description": "Button component with `type` `OTP`",
                  "oneOf": [
                     {
                        "$ref": "#/components/schemas/TemplateComponentsButtonsOTPCopyCode"
                     },
                     {
                        "$ref": "#/components/schemas/TemplateComponentsButtonsOTPOneTap"
                     }
                  ]
               }
            ]
         },
         "TemplateComponentsButtonsOTPCopyCode": {
            "description": "OTP Copy Code Button",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of button.",
                  "example": "OTP",
                  "enum": [
                     "OTP"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 25,
                  "description": "The text to appear on the button. 25 characters maximum.",
                  "example": "Copy Code"
               },
               "otp_type": {
                  "type": "string",
                  "description": "The type of OTP button. Mandatory if the button `type` is `OTP`",
                  "enum": [
                     "COPY_CODE"
                  ],
                  "example": "COPY_CODE"
               }
            }
         },
         "TemplateComponentsButtonsOTPOneTap": {
            "description": "OTP One Tap Button",
            "properties": {
               "type": {
                  "type": "string",
                  "description": "The type of button.",
                  "example": "OTP",
                  "enum": [
                     "OTP"
                  ]
               },
               "text": {
                  "type": "string",
                  "maxLength": 25,
                  "description": "The text to appear on the Copy Code button. 25 characters maximum.",
                  "example": "Copy Code"
               },
               "otp_type": {
                  "type": "string",
                  "description": "The type of OTP button. Mandatory if the button `type` is `OTP`",
                  "enum": [
                     "ONE_TAP"
                  ],
                  "example": "ONE_TAP"
               },
               "autofill_text": {
                  "type": "string",
                  "maxLength": 25,
                  "description": "The text to appear on the Autofill button. 25 characters maximum.",
                  "example": "Autofill"
               },
               "supported_apps": {
                  "type": "array",
                  "description": "The `supported_apps` array allows you define objects containing pairs of app package names and signing key hashes for up to 5 apps.\nSee the [Meta Documentation](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/authentication-templates/autofill-button-authentication-templates#supported-apps) for more information.\n",
                  "minItems": 1,
                  "maxItems": 5,
                  "items": {
                     "type": "object",
                     "properties": {
                        "package_name": {
                           "type": "string",
                           "description": "Your Android app's package name. Mandatory if `otp_type` is `ONE_TAP`",
                           "example": "com.example.myapp"
                        },
                        "signature_hash": {
                           "type": "string",
                           "description": "Your app signing key hash. See the [Meta Documentation](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/authentication-templates/autofill-button-authentication-templates#app-signing-key-hash) for more information. Mandatory if `otp_type` is `ONE_TAP`",
                           "example": "K8a%2FAINcGX7"
                        }
                     }
                  }
               }
            }
         },
         "TemplateResponseProperties": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string",
                  "description": "The unique identifier for this template.",
                  "example": "1045638762820500"
               },
               "status": {
                  "type": "string",
                  "description": "The status of the template. Templates with a status of `APPROVED` can be used in WhatsApp template messages.",
                  "enum": [
                     "APPROVED",
                     "REJECTED",
                     "IN_APPEAL",
                     "PENDING",
                     "PENDING_DELETION",
                     "DELETED",
                     "DISABLED",
                     "LOCKED"
                  ],
                  "example": "APPROVED"
               },
               "previous_category": {
                  "type": "string",
                  "description": "If the template has been updated to a different category, shows the previous category of the template.",
                  "example": "MARKETING"
               }
            }
         },
         "ErrorResponse": {
            "type": "object",
            "description": "Base error response following RFC 7807",
            "required": [
               "type",
               "title",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "An error occurred"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "More details about what went wrong"
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorResponseWithInvalidParameters": {
            "allOf": [
               {
                  "$ref": "#/components/schemas/ErrorResponse"
               },
               {
                  "type": "object",
                  "required": [
                     "detail"
                  ],
                  "properties": {
                     "invalid_parameters": {
                        "type": "array",
                        "description": "List of invalid parameters",
                        "items": {
                           "type": "object",
                           "required": [
                              "name",
                              "reason"
                           ],
                           "properties": {
                              "name": {
                                 "type": "string",
                                 "description": "Name of the invalid parameter",
                                 "example": "name"
                              },
                              "reason": {
                                 "type": "string",
                                 "description": "Reason why the parameter is invalid",
                                 "example": "Must not be empty"
                              }
                           }
                        }
                     }
                  }
               }
            ]
         }
      },
      "responses": {
         "204": {
            "description": "No Content - Resource successfully deleted",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            }
         },
         "400": {
            "description": "Bad Request",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponseWithInvalidParameters"
                  }
               }
            }
         },
         "401": {
            "description": "Authentication failure",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "oneOf": [
                        {
                           "description": "Missing or Invalid Credentials",
                           "type": "object",
                           "required": [
                              "type",
                              "title",
                              "instance"
                           ],
                           "properties": {
                              "type": {
                                 "type": "string",
                                 "description": "Link to error / remediation options",
                                 "example": "https://developer.vonage.com/api-errors/#unathorized"
                              },
                              "title": {
                                 "type": "string",
                                 "description": "Generic error message",
                                 "example": "You did not provide correct credentials."
                              },
                              "detail": {
                                 "type": "string",
                                 "description": "Additional information about the error",
                                 "example": "Check that you're using the correct credentials, and that your account has this feature enabled"
                              },
                              "instance": {
                                 "type": "string",
                                 "description": "Internal Trace ID",
                                 "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
                              }
                           }
                        },
                        {
                           "description": "Invalid Application Type",
                           "type": "object",
                           "required": [
                              "type",
                              "title",
                              "instance"
                           ],
                           "properties": {
                              "type": {
                                 "type": "string",
                                 "description": "Link to error / remediation options",
                                 "example": "https://developer.vonage.com/api-errors/#unprovisioned"
                              },
                              "title": {
                                 "type": "string",
                                 "description": "Generic error message",
                                 "example": "The crendentials provided do not have access to the requested product"
                              },
                              "detail": {
                                 "type": "string",
                                 "description": "Additional information about the error",
                                 "example": "Check your API key is correct and has been whitelisted"
                              },
                              "instance": {
                                 "type": "string",
                                 "description": "Internal Trace ID",
                                 "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
                              }
                           }
                        }
                     ]
                  }
               }
            }
         },
         "404": {
            "description": "Not Found",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "422": {
            "description": "Unprocessable Entity",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponseWithInvalidParameters"
                  }
               }
            }
         },
         "429": {
            "description": "Too Many Requests",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               },
               "X-RateLimit-Limit": {
                  "$ref": "#/components/headers/X-RateLimit-Limit"
               },
               "X-RateLimit-Remaining": {
                  "$ref": "#/components/headers/X-RateLimit-Remaining"
               },
               "X-RateLimit-Reset": {
                  "$ref": "#/components/headers/X-RateLimit-Reset"
               },
               "Retry-After": {
                  "$ref": "#/components/headers/Retry-After"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "500": {
            "description": "Internal error",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "ListTemplatesResponse200": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "paging": {
                           "type": "object",
                           "properties": {
                              "cursors": {
                                 "type": "object",
                                 "properties": {
                                    "before": {
                                       "type": "string",
                                       "example": "MAZDZD",
                                       "description": "The template before the first template in the current list"
                                    },
                                    "after": {
                                       "type": "string",
                                       "example": "MjQZD",
                                       "description": "The template after the last template in the current list"
                                    }
                                 }
                              },
                              "next": {
                                 "type": "string",
                                 "format": "uri",
                                 "example": "https://api.nexmo.com/v2/whatsapp-manager/wabas/106499765517625/templates?after=MwZDZD",
                                 "description": "A URI to ge the next paginated page."
                              },
                              "previous": {
                                 "type": "string",
                                 "format": "uri",
                                 "example": "https://api.nexmo.com/v2/whatsapp-manager/wabas/106499765517625/templates?before=MgZDZD",
                                 "description": "A URI to ge the previous paginated page."
                              }
                           }
                        },
                        "templates": {
                           "type": "array",
                           "description": "An array of templates in the current list",
                           "items": {
                              "$ref": "#/components/schemas/WhatsAppTemplate"
                           }
                        }
                     }
                  }
               }
            }
         },
         "GetTemplateResponse200": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/WhatsAppTemplate"
                  }
               }
            }
         },
         "CreateTemplateResponse200": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "required": [
                        "id"
                     ],
                     "properties": {
                        "id": {
                           "type": "string",
                           "description": "The unique ID of the created template.",
                           "example": "408766354711449"
                        }
                     }
                  }
               }
            }
         },
         "MediaUploadResponse200": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "h": {
                           "type": "string",
                           "description": "The uploaded file's file handle. Media handles are valid for 30 days after the upload time, and can be used in template components for template creation.",
                           "example": ":c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"
                        }
                     }
                  }
               }
            }
         }
      },
      "headers": {
         "X-Request-Id": {
            "description": "A unique identifier for the request, used for tracking and debugging",
            "schema": {
               "type": "string",
               "format": "uuid",
               "example": "f94b4e56-604e-07e5-e5ad-5a7228618f81"
            }
         },
         "X-RateLimit-Limit": {
            "description": "Request limit per hour",
            "schema": {
               "type": "integer",
               "example": 30
            }
         },
         "X-RateLimit-Remaining": {
            "description": "Remaining requests",
            "schema": {
               "type": "integer",
               "example": 5
            }
         },
         "X-RateLimit-Reset": {
            "description": "Unix timestamp when limit resets",
            "schema": {
               "type": "integer",
               "example": 1769182705723
            }
         },
         "Retry-After": {
            "description": "Seconds until next request allowed",
            "schema": {
               "type": "integer",
               "example": 15
            }
         }
      }
   },
   "x-errors": {
      "1000": {
         "description": "Throttled - You have exceeded the submission capacity allowed on this account. Please wait and retry"
      },
      "1030": {
         "description": "Internal error  -  There was an error processing your request in the Platform."
      }
   }
}