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

# Update an OTP template

> Update an OTP template. This is a partial update: a field you omit keeps its stored value, it does not fall back to your account default.

In order to get access to this endpoint, contact our support team.


Update an OTP template. This is a partial update: a field you omit keeps its stored value rather than falling back to your account default, so changing a suffix leaves the template's code size, TTL and rate limits alone.

Custom suffixes are checked before they are stored. Sending a `suffix` while custom suffixes are not enabled on your account is refused with `custom_suffix_not_enabled`. A suffix that is malformed is refused with `invalid_suffix`, one that reads like another company or a public institution with `suffix_not_allowed`, and one written in an alphabet we do not support yet with `suffix_script_not_supported`.


## OpenAPI

````yaml patch /v2/verification/management/templates/{template_id}
openapi: 3.1.0
info:
  title: Prelude API
  version: 2.0.0
  description: The Prelude API allows you to send messages to your users.
  contact:
    email: support@prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - apiToken: []
tags:
  - name: Notify
    description: Send transactional and marketing messages with compliance enforcement.
  - name: Transactional
    description: Send transactional messages (deprecated - use Notify API instead).
  - name: Verify
    description: Verify phone numbers.
  - name: Watch
    description: Evaluate email addresses and phone numbers for trustworthiness.
  - name: Lookup
    description: >-
      Retrieve detailed information about a phone number including carrier data,
      line type, and portability status.
paths:
  /v2/verification/management/templates/{template_id}:
    patch:
      tags:
        - Verify
      summary: Update an OTP template
      description: >
        Update an OTP template. This is a partial update: a field you omit keeps
        its stored value, it does not fall back to your account default.


        In order to get access to this endpoint, contact our support team.
      operationId: updateVerificationTemplate
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
          description: The identifier of the template.
          example: template_01k8ap1btqf5r9fq2c8ax5fhc9
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVerificationTemplateRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerificationTemplate'
        '400':
          description: KO
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateVerificationTemplateRequest:
      type: object
      description: >-
        A partial update. Every field is optional, and a field you omit keeps
        its stored value.
      properties:
        name:
          type: string
          description: The name of the template.
          examples:
            - Acme Bank
        kind:
          type: string
          description: The kind of message the template sends.
          enum:
            - optimized
            - psd2
            - account-takeover
        suffix:
          type: string
          description: >-
            The custom text appended to the message. Requires custom suffixes to
            be enabled on your account.
          examples:
            - AcmeBank
        code_size:
          type: integer
          description: The number of digits in the verification code, between 4 and 8.
          examples:
            - 6
        ttl_minutes:
          type: integer
          description: >-
            How many minutes a code stays valid after it was sent, between 1 and
            1440.
          examples:
            - 10
        max_retries:
          type: integer
          description: >-
            How many times the end user may ask for the code to be sent again,
            between 1 and 50.
          examples:
            - 3
        retry_delay_seconds:
          type: integer
          description: >-
            How many seconds the end user must wait between two of those manual
            retries, between 1 and 3600.
          examples:
            - 30
        per_phone_number_limit:
          type: integer
          description: >-
            How many verifications one phone number may run over
            `sliding_window_hours`, between 1 and 1000.
          examples:
            - 5
        sliding_window_hours:
          type: integer
          description: >-
            The number of hours the `per_phone_number_limit` rate limit is
            measured over, between 1 and 72.
          examples:
            - 24
        security_suffix_type:
          type: string
          description: The security wording appended to the message.
          enum:
            - none
            - basic
            - expiration
            - anti_phishing
        max_auto_retries:
          type: integer
          description: How many times Prelude resends the code on its own, between 1 and 5.
          examples:
            - 1
        auto_expire_previous_attempts:
          type: boolean
          description: Whether requesting a new code invalidates the codes sent before it.
          examples:
            - true
    VerificationTemplate:
      type: object
      required:
        - id
        - name
        - kind
        - code_size
        - ttl_minutes
        - max_retries
        - retry_delay_seconds
        - per_phone_number_limit
        - sliding_window_hours
        - security_suffix_type
        - max_auto_retries
        - auto_expire_previous_attempts
      properties:
        id:
          type: string
          description: >-
            The identifier of the template, to pass as `template_id` when
            creating a verification.
          examples:
            - template_01k8ap1btqf5r9fq2c8ax5fhc9
        name:
          type: string
          description: The name of the template.
          examples:
            - Acme Bank
        kind:
          type: string
          description: |
            The kind of message the template sends. Possible values are:
              * `optimized` - A standard OTP message.
              * `psd2` - A PSD2 strong customer authentication message.
              * `account-takeover` - An account takeover confirmation message.
          enum:
            - optimized
            - psd2
            - account-takeover
        suffix:
          type: string
          description: >-
            The custom text appended to the message. Absent when the template
            appends none.
          examples:
            - AcmeBank
        code_size:
          type: integer
          description: The number of digits in the verification code.
          examples:
            - 6
        ttl_minutes:
          type: integer
          description: How many minutes a code stays valid after it was sent.
          examples:
            - 10
        max_retries:
          type: integer
          description: How many times the end user may ask for the code to be sent again.
          examples:
            - 3
        retry_delay_seconds:
          type: integer
          description: >-
            How many seconds the end user must wait between two of those manual
            retries.
          examples:
            - 30
        per_phone_number_limit:
          type: integer
          description: >-
            How many verifications one phone number may run over
            `sliding_window_hours`.
          examples:
            - 5
        sliding_window_hours:
          type: integer
          description: >-
            The number of hours the `per_phone_number_limit` rate limit is
            measured over.
          examples:
            - 24
        security_suffix_type:
          type: string
          description: |
            The security wording appended to the message. Possible values are:
              * `none` - No security wording.
              * `basic` - A short do-not-share warning.
              * `expiration` - The basic warning plus the code expiration.
              * `anti_phishing` - The strongest anti-phishing wording.
          enum:
            - none
            - basic
            - expiration
            - anti_phishing
        max_auto_retries:
          type: integer
          description: >-
            How many times Prelude resends the code on its own, without the end
            user asking.
          examples:
            - 1
        auto_expire_previous_attempts:
          type: boolean
          description: >-
            Whether requesting a new code invalidates the codes sent before it,
            so only the most recently sent code is valid.
          examples:
            - true
        created_at:
          type: string
          format: date-time
          description: >-
            The date and time when the template was created. Absent on templates
            created before this was recorded.
          examples:
            - '2024-01-01T12:00:00Z'
    Error:
      type: object
      properties:
        code:
          type: string
          description: The error code.
          examples:
            - invalid_phone_number
        message:
          type: string
          examples:
            - >-
              The provided phone number is invalid. Provide a valid E.164 phone
              number.
          description: A human-readable message describing the error.
        type:
          type: string
          examples:
            - bad_request
          description: The error type.
        request_id:
          type: string
          examples:
            - 3d19215e-2991-4a05-a41a-527314e6ff6a
          description: >-
            A string that identifies this specific request. Report it back to us
            to help us diagnose your issues.
        param:
          type: string
          examples:
            - phone_number
          description: The parameter the error refers to, when it applies to a single one.
      required:
        - code
        - message
        - type
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer

````