Introduction

The /template API provides the templates for the request endpoint. Fetch the available templates and use the id as the template_id.

An example response from/template is:

{
  "data": [
    {
      "id": "065efefb-650d-4e38-9927-431db8c6ec30",
      "name": "otp_simple",
      "from": "YourCompany",
      "text": "Your 2FA verification code is ${code}",
      "ttl": 300
    },
    {
      "id": "20891401-e79d-4061-8a3b-10342ef51c65",
      "name": "otp_advanced",
      "from": "YourCompany",
      "text": "Hello ${firstName} ${lastName}. Please enter ${code} as your one-time pin.",
      "ttl": 60
    }
  ]
}

Where:

  • id is the unique template id
  • name is the unique template name
  • from is the sender name which is going to be used to deliver the 2FA code to the recipient
  • text is the content which is going to be delivered to the recipient
    • Interpolates variables which should be sent as parameters object via request endpoint
  • ttl is the time to live, in seconds (default: 300, maximum: 600)
    • if the recipient doesn't enter the 2FA code within the defined ttl it will expire and result with validate returning HTTP STATUS 404
Language
Authorization
Header
Click Try It! to start a request and see the response here!