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

# Update message template

> Update an existing Verify profile message template.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/verify.yml patch /verify_profiles/templates/{template_id}
openapi: 3.1.0
info:
  title: Telnyx Verify API
  version: 2.0.0
  description: API for Verify.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /verify_profiles/templates/{template_id}:
    patch:
      tags:
        - Verify
      summary: Update message template
      description: Update an existing Verify profile message template.
      operationId: UpdateMessageTemplate
      parameters:
        - required: true
          description: The identifier of the message template to update.
          schema:
            example: 12ade33a-21c0-473b-b055-b3c836e1c292
            format: uuid
            type: string
          name: template_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMessageTemplateRequest'
        required: true
      responses:
        '200':
          description: Expected message template response to a valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageTemplateResponseDataWrapper'
        '400':
          $ref: '#/components/responses/verify_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const messageTemplate = await client.verifyProfiles.updateTemplate(
              '12ade33a-21c0-473b-b055-b3c836e1c292',
              { text: 'Your {{app_name}} verification code is: {{code}}.' },
            );

            console.log(messageTemplate.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            message_template = client.verify_profiles.update_template(
                template_id="12ade33a-21c0-473b-b055-b3c836e1c292",
                text="Your {{app_name}} verification code is: {{code}}.",
            )
            print(message_template.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmessageTemplate, err := client.VerifyProfiles.UpdateTemplate(\n\t\tcontext.TODO(),\n\t\t\"12ade33a-21c0-473b-b055-b3c836e1c292\",\n\t\ttelnyx.VerifyProfileUpdateTemplateParams{\n\t\t\tText: \"Your {{app_name}} verification code is: {{code}}.\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", messageTemplate.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import com.telnyx.sdk.models.verifyprofiles.MessageTemplate;

            import
            com.telnyx.sdk.models.verifyprofiles.VerifyProfileUpdateTemplateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    VerifyProfileUpdateTemplateParams params = VerifyProfileUpdateTemplateParams.builder()
                        .templateId("12ade33a-21c0-473b-b055-b3c836e1c292")
                        .text("Your {{app_name}} verification code is: {{code}}.")
                        .build();
                    MessageTemplate messageTemplate = client.verifyProfiles().updateTemplate(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            message_template = telnyx.verify_profiles.update_template(
              "12ade33a-21c0-473b-b055-b3c836e1c292",
              text: "Your {{app_name}} verification code is: {{code}}."
            )

            puts(message_template)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $messageTemplate = $client->verifyProfiles->updateTemplate(
                '12ade33a-21c0-473b-b055-b3c836e1c292',
                text: 'Your {{app_name}} verification code is: {{code}}.',
              );

              var_dump($messageTemplate);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx verify-profiles update-template \
              --api-key 'My API Key' \
              --template-id 12ade33a-21c0-473b-b055-b3c836e1c292 \
              --text 'Your {{app_name}} verification code is: {{code}}.'
components:
  schemas:
    UpdateMessageTemplateRequest:
      title: UpdateMessageTemplateRequest
      description: The request body when updating a message template.
      required:
        - text
      type: object
      properties:
        text:
          example: 'Your {{app_name}} verification code is: {{code}}.'
          type: string
          description: The text content of the message template.
    MessageTemplateResponseDataWrapper:
      title: MessageTemplateResponseDataWrapper
      type: object
      properties:
        data:
          $ref: '#/components/schemas/VerifyProfileMessageTemplateResponse'
    VerifyProfileMessageTemplateResponse:
      title: VerifyProfileResponse
      type: object
      properties:
        id:
          example: 0abb5b4f-459f-445a-bfcd-488998b7572d
          format: uuid
          type: string
        text:
          example: 'Your {{app_name}} verification code is: {{code}}.'
          type: string
    verify_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/verify_Error'
      type: object
    verify_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          example: '10015'
        title:
          type: string
          example: Invalid sorting value
        detail:
          type: string
          example: >-
            The value provided for sorting is not valid. Check the value used
            and try again.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              example: /sort
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
              description: URL with additional information on the error.
              example: https://developers.telnyx.com/docs/overview/errors/10015
      type: object
  responses:
    verify_GenericErrorResponse:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/verify_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````