> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update SMS Template

> This API updates an SMS template by specifying its external template ID. You can specify in the request whether the updated version of the template can be used in active campaigns.

#### Rate Limit

The rate limit is **100 RPM**.


## OpenAPI

````yaml /api/sms-templates/sms-templates.yaml put /custom-templates/sms
openapi: 3.0.3
info:
  title: MoEngage SMS Template API
  version: '1.0'
  description: >-
    API for creating, updating, and searching SMS templates within the MoEngage
    platform.
servers:
  - url: https://api-{dc}.moengage.com/v1.0
    description: MoEngage Custom Templates API Server
    variables:
      dc:
        default: '01'
        description: >-
          The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of ‘dc’ in the URL by referring
          to the DC and API endpoint mapping
          [here](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101.
security:
  - basicAuth: []
tags:
  - name: SMS Templates
    description: Operations to manage SMS templates.
paths:
  /custom-templates/sms:
    put:
      tags:
        - SMS Templates
      summary: Update SMS Template
      description: >-
        This API updates an SMS template by specifying its external template ID.
        You can specify in the request whether the updated version of the
        template can be used in active campaigns.
      requestBody:
        required: true
        description: The updated details for the SMS template.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSmsTemplateRequest'
            example:
              external_template_id: d05a44f0-a7cf-471a-bcb6-63054800a367
              update_campaigns: false
              basic_details:
                message: >-
                  Hi {{UserAttribute['first_name']}}, your order has been
                  delivered!
              meta_info:
                template_name: Shipping Update Template V2
                updated_by: jane.doe@example.com
                template_version: '2'
      responses:
        '200':
          description: Template updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  external_template_id:
                    type: string
                    format: uuid
                    description: The unique ID of the updated template.
              examples:
                success:
                  summary: Successful Update
                  value:
                    external_template_id: eca024b7-a8ea-4f31-9154-5b80c85d18a9
        '400':
          description: >-
            Bad Request. Invalid `external_template_id` or other request data
            validation errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_id:
                  summary: Invalid Template ID
                  value:
                    error:
                      code: 400 Bad Request
                      message: Invalid template id
                      details:
                        - code: MissingValue
                          target: 9925c8
                          message: 9925c8 is invalid template id.
                      request_id: BTkUaYgU
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
              examples:
                server_error:
                  summary: Internal Server Error
                  value:
                    title: Internal Server Error
                    message: >-
                      An unexpected error was encountered while processing this
                      request. Please contact MoEngage Team
components:
  schemas:
    UpdateSmsTemplateRequest:
      type: object
      required:
        - external_template_id
        - basic_details
        - meta_info
      properties:
        external_template_id:
          type: string
          format: uuid
          description: >-
            This field contains the unique identifier that is generated by
            MoEngage during the template creation.
        update_campaigns:
          type: boolean
          default: false
          description: >-
            If true, this field contains a flag used to update all active
            campaigns currently using the template being updated to the newer
            version (being updated in this request).
        basic_details:
          type: object
          description: This field contains the basic details of the SMS template.
          required:
            - message
          properties:
            message:
              type: string
              description: This field contains the updated content of the template.
        meta_info:
          type: object
          description: This field contains information about the template being created.
          required:
            - template_name
            - updated_by
          properties:
            template_name:
              type: string
              description: This field contains the name of the template being updated.
            updated_by:
              type: string
              format: email
              description: >-
                This field contains the email ID of the person updating the
                template.
            template_version:
              type: string
              description: This field contains the version of the template (optional).
    ErrorResponse:
      type: object
      description: Standard error response format for 4xx errors.
      properties:
        error:
          type: object
          description: This field contains the reason for the request's failure.
          properties:
            code:
              type: string
              description: The HTTP status code and error type.
              example: 4xx Status Code
            message:
              type: string
              description: A description of the error.
              example: Brief description of the error.
            details:
              type: array
              description: >-
                This is a List of the error details objects. Each object
                contains the following information.
              items:
                type: object
                properties:
                  code:
                    type: string
                    example: ErrorCode
                  target:
                    type: string
                    example: Field Name
                  message:
                    type: string
                    example: Error description for this field.
            request_id:
              type: string
              description: This field contains the unique id pertaining to the request.
              example: Unique Request ID
    InternalServerError:
      type: object
      description: Schema for 500 Internal Server Error.
      properties:
        title:
          type: string
          example: Internal Server Error
        message:
          type: string
          example: >-
            An unexpected error was encountered while processing this request.
            Please contact MoEngage Team
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        Authentication is done via Basic Auth. This requires a base64-encoded
        string of your credentials in the format 'username:password'.


        - **Username**: Use your MoEngage workspace ID (also known as the App
        ID). You can find it in the MoEngage dashboard at **Settings** >
        **Account** > **APIs** > **Workspace ID (earlier app id)**.

        - **Password**: Use your API Key, which you can find within the
        **Campaign report/Business events/Custom templates/Catalog API/Inform
        Report** tile.


        For more information on authentication and getting your credentials,
        refer
        [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials).

````