AltScore
Borrower Central (BC)

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.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "channel": "email",
  "label": "Email verification template",
  "lang": "es",
  "sender": "otps@altscore.ai",
  "subject": "Verification code",
  "slug": "tenant:123e4567-e89b-12d3-a456-426614174000",
  "title": "Your verification code",
  "headerLogo": "https://example.com/logo.png",
  "headerLogoHeight": "40px",
  "preOtpBlurb": "Use the following code to verify your account:",
  "posOtpBlurb": "This code will expire in 10 minutes.",
  "didNotAskMessage": "If you did not request this code, ignore this message.",
  "footerBlurb": "Thank you for using our service.",
  "footerLink": "https://example.com",
  "footerLinkLabel": "Visit our website",
  "footerSlogan": "Security first",
  "footerLogo": "https://example.com/footer-logo.png",
  "footerLogoHeight": "30px",
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-01-02T12:30:00Z"
}

Attributes

AttributeDescriptionType
idUnique identifier of the templateString
channelSending channel (email, sms, or whatsapp)String
labelDescriptive label of the templateString
langLanguage of the templateString
senderSender's email address (email only)String
subjectEmail subject (email only)String
slugFriendly identifier of the templateString
titleMessage titleString
headerLogoHeader logo URLString
headerLogoHeightHeader logo heightString
preOtpBlurbText before the OTP codeString
posOtpBlurbText after the OTP codeString
didNotAskMessageMessage for users who did not request the codeString
footerBlurbFooter textString
footerLinkFooter link URLString
footerLinkLabelFooter link labelString
footerSloganFooter sloganString
footerLogoFooter logo URLString
footerLogoHeightFooter logo heightString
createdAtTemplate creation dateString (ISO 8601)
updatedAtLast update date of the templateString (ISO 8601)

Available Operations

Create a New OTP Template

Creates a new OTP template in the system.

POST /v1/otp-templates

Input Parameters

ParameterDescriptionTypeRequired
labelDescriptive label of the templateStringYes
channelSending channel (email or sms)StringYes
langLanguage of the templateStringNo
subjectEmail subject (email only)StringNo
slugFriendly identifier of the templateStringNo
titleMessage titleStringNo
headerLogoHeader logo URLStringNo
headerLogoHeightHeader logo heightStringNo
preOtpBlurbText before the OTP codeStringNo
posOtpBlurbText after the OTP codeStringNo
didNotAskMessageMessage for users who did not request the codeStringNo
footerBlurbFooter textStringNo
footerLinkFooter link URLStringNo
footerLinkLabelFooter link labelStringNo
footerSloganFooter sloganStringNo
footerLogoFooter logo URLStringNo
footerLogoHeightFooter logo heightStringNo

Request Example

{
  "label": "Email verification template",
  "channel": "email",
  "lang": "es",
  "subject": "Verification code",
  "title": "Your verification code",
  "preOtpBlurb": "Use the following code to verify your account:",
  "posOtpBlurb": "This code will expire in 10 minutes."
}

Successful Response

{
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Update an OTP Template

Updates an existing OTP template.

PATCH /v1/otp-templates/:template_id

Path Parameters

ParameterDescription
template_idID 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

{
  "subject": "New verification code",
  "preOtpBlurb": "Here is your new verification code:"
}

Successful Response

The response will be the updated OTP Template object.

Get an OTP Template

Retrieves information of a specific OTP template.

GET /v1/otp-templates/:template_id

Path Parameters

ParameterDescription
template_idID 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.

GET /v1/otp-templates

Query Parameters

ParameterDescriptionType
channelFilter by sending channelString
searchText to search in the templatesString
pagePage numberInteger
per-pageItems per pageInteger
sort-byField to sort byString
sort-directionSorting 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.

DELETE /v1/otp-templates/:template_id

Path Parameters

ParameterDescription
template_idID 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:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Errors will include a descriptive message in the response body.