OTP Templates API
This API allows managing OTP (One-Time Password) templates in the system. It provides endpoints to create, read, update, and delete OTP templates, as well as to query and filter existing templates.
The OTP Template Object
The OTP Template object represents a template for sending OTP codes through different channels.
Attributes
| Attribute | Description | Type |
|---|---|---|
| id | Unique identifier of the template | String |
| channel | Sending channel (email, sms, or whatsapp) | String |
| label | Descriptive label of the template | String |
| lang | Language of the template | String |
| sender | Sender's email address (email only) | String |
| subject | Email subject (email only) | String |
| slug | Friendly identifier of the template | String |
| title | Message title | String |
| headerLogo | Header logo URL | String |
| headerLogoHeight | Header logo height | String |
| preOtpBlurb | Text before the OTP code | String |
| posOtpBlurb | Text after the OTP code | String |
| didNotAskMessage | Message for users who did not request the code | String |
| footerBlurb | Footer text | String |
| footerLink | Footer link URL | String |
| footerLinkLabel | Footer link label | String |
| footerSlogan | Footer slogan | String |
| footerLogo | Footer logo URL | String |
| footerLogoHeight | Footer logo height | String |
| createdAt | Template creation date | String (ISO 8601) |
| updatedAt | Last update date of the template | String (ISO 8601) |
Available Operations
Create a New OTP Template
Creates a new OTP template in the system.
Input Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| label | Descriptive label of the template | String | Yes |
| channel | Sending channel (email or sms) | String | Yes |
| lang | Language of the template | String | No |
| subject | Email subject (email only) | String | No |
| slug | Friendly identifier of the template | String | No |
| title | Message title | String | No |
| headerLogo | Header logo URL | String | No |
| headerLogoHeight | Header logo height | String | No |
| preOtpBlurb | Text before the OTP code | String | No |
| posOtpBlurb | Text after the OTP code | String | No |
| didNotAskMessage | Message for users who did not request the code | String | No |
| footerBlurb | Footer text | String | No |
| footerLink | Footer link URL | String | No |
| footerLinkLabel | Footer link label | String | No |
| footerSlogan | Footer slogan | String | No |
| footerLogo | Footer logo URL | String | No |
| footerLogoHeight | Footer logo height | String | No |
Request Example
Successful Response
Update an OTP Template
Updates an existing OTP template.
Path Parameters
| Parameter | Description |
|---|---|
| template_id | ID of the template to update |
Input Parameters
All parameters are optional and correspond to the fields of the OTP Template object that can be updated.
Request Example
Successful Response
The response will be the updated OTP Template object.
Get an OTP Template
Retrieves information of a specific OTP template.
Path Parameters
| Parameter | Description |
|---|---|
| template_id | ID of the template to retrieve |
Successful Response
The response will be the complete OTP Template object.
List OTP Templates
Retrieves a paginated list of OTP templates with filtering and sorting options.
Query Parameters
| Parameter | Description | Type |
|---|---|---|
| channel | Filter by sending channel | String |
| search | Text to search in the templates | String |
| page | Page number | Integer |
| per-page | Items per page | Integer |
| sort-by | Field to sort by | String |
| sort-direction | Sorting direction (asc or desc) | String |
Successful Response
The response will be a paginated list of OTP Template objects.
Delete an OTP Template
Deletes an OTP template from the system.
Path Parameters
| Parameter | Description |
|---|---|
| template_id | ID of the template to delete |
Successful Response
Status code 204 (No Content) if the deletion was successful.
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body.