Skip to main content
PATCH
Update an OTP template
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.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

template_id
string
required

The identifier of the template.

Body

application/json

A partial update. Every field is optional, and a field you omit keeps its stored value.

name
string

The name of the template.

Example:

"Acme Bank"

kind
enum<string>

The kind of message the template sends.

Available options:
optimized,
psd2,
account-takeover
suffix
string

The custom text appended to the message. Requires custom suffixes to be enabled on your account.

Example:

"AcmeBank"

code_size
integer

The number of digits in the verification code, between 4 and 8.

Example:

6

ttl_minutes
integer

How many minutes a code stays valid after it was sent, between 1 and 1440.

Example:

10

max_retries
integer

How many times the end user may ask for the code to be sent again, between 1 and 50.

Example:

3

retry_delay_seconds
integer

How many seconds the end user must wait between two of those manual retries, between 1 and 3600.

Example:

30

per_phone_number_limit
integer

How many verifications one phone number may run over sliding_window_hours, between 1 and 1000.

Example:

5

sliding_window_hours
integer

The number of hours the per_phone_number_limit rate limit is measured over, between 1 and 72.

Example:

24

security_suffix_type
enum<string>

The security wording appended to the message.

Available options:
none,
basic,
expiration,
anti_phishing
max_auto_retries
integer

How many times Prelude resends the code on its own, between 1 and 5.

Example:

1

auto_expire_previous_attempts
boolean

Whether requesting a new code invalidates the codes sent before it.

Example:

true

Response

OK

id
string
required

The identifier of the template, to pass as template_id when creating a verification.

Example:

"template_01k8ap1btqf5r9fq2c8ax5fhc9"

name
string
required

The name of the template.

Example:

"Acme Bank"

kind
enum<string>
required

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.
Available options:
optimized,
psd2,
account-takeover
code_size
integer
required

The number of digits in the verification code.

Example:

6

ttl_minutes
integer
required

How many minutes a code stays valid after it was sent.

Example:

10

max_retries
integer
required

How many times the end user may ask for the code to be sent again.

Example:

3

retry_delay_seconds
integer
required

How many seconds the end user must wait between two of those manual retries.

Example:

30

per_phone_number_limit
integer
required

How many verifications one phone number may run over sliding_window_hours.

Example:

5

sliding_window_hours
integer
required

The number of hours the per_phone_number_limit rate limit is measured over.

Example:

24

security_suffix_type
enum<string>
required

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.
Available options:
none,
basic,
expiration,
anti_phishing
max_auto_retries
integer
required

How many times Prelude resends the code on its own, without the end user asking.

Example:

1

auto_expire_previous_attempts
boolean
required

Whether requesting a new code invalidates the codes sent before it, so only the most recently sent code is valid.

Example:

true

suffix
string

The custom text appended to the message. Absent when the template appends none.

Example:

"AcmeBank"

created_at
string<date-time>

The date and time when the template was created. Absent on templates created before this was recorded.

Example:

"2024-01-01T12:00:00Z"