Generate OTP

This page provides you with information on Generate OTP API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Issues OTP to the customer’s mobile number/email ID using the sessionId generated through the token/generate API. The OTP is valid for 20 minutes, which is the same duration as the session ID validity.

OTP rate limits are enforced per mobile number based on your organisation's configuration. The following parameters control the rate limit:

  • otpMaxCount: The maximum number of OTPs that can be generated per mobile number within a specified time window.
  • otpTimeOut: The time window (in minutes) during which the maximum OTP count applies.

If these parameters are not set (null), there is no rate limit and OTP generation is unrestricted. Contact your administrator to change these limits.

Resource Information

URI for Mobile App/auth/v1/otp/generate
URI for Web App/auth/v1/web/otp/generate
AuthenticationNot required
HTTP MethodPOST
Batch SupportYes

Request URL

For mobile application:

http:{ae-host}/auth/v1/otp/generate

For web application:

http:{ae-host}/auth/v1/web/otp/generate

Request Body Parameters

curl --location 'https://eu.api.capillarytech.com/auth/v1/otp/generate' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'Cookie: _cfuvid=omyxxTL4JKRyz4yJ6akXXwAQb4MsROzdNed9SczptHs-1760004859086-0.0.1.1-604800000' \
--data '{
    "identifierType": "MOBILE",
    "identifierValue": "919999999993",
    "brand": "DocDemo",
    "deviceId": "123456785",
    "sessionId": "P-7df5e433-17bb-4f02-9ce0-7420ba69c7b4"
}'
curl --location 'https://eu.api.capillarytech.com/auth/v1/web/otp/generate' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'Cookie: _cfuvid=omyxxTL4JKRyz4yJ6akXXwAQb4MsROzdNed9SczptHs-1760004859086-0.0.1.1-604800000' \
--data-raw '{
    "identifierType": "EMAIL",
    "identifierValue": "[email protected]",
    "brand": "DocDemo",
    "sessionId": "P-e766af2a-f676-489e-9b24-8571f7af057b"
}'
ParameterDatatypeDescription
identifierType*enumIdentifier used for authentication. Values: MOBILE, EMAIL, USERNAME.
identifierValue*stringValue of the specified identifierType. For example, if identifierType is MOBILE, the identifierValue is mobile number. If you want to send the OTP to WhatsApp or Zalo, you need to raise a JIRA ticket to the sustenance team to define the related configurations and configure the templates.
deviceId**stringUnique ID of the device from which the customer has generated the token. Required for mobile app.
brand*stringName of the brand or org for which authentication needs to be verified.
sessionId*stringSession ID generated through the v1/token/generate API.
hashstringHash value generated by the mobile application to encrypt the payload. The server-side validation is performed by matching this hash value. For information, refer to Enable API encryption. Note: This parameter is mandatory if the API payload encryption configurations are enabled and is not applicable if the API payload encryption is not enabled.

Parameters marked with are mandatory, and the parameter with * is required for the mobile app.

Error

ErrorSolution
5004 - Response tamperedPayload encryption is enabled, and the defined time for the hash value is expired.
Body Params
string
required

Identifier used for token generation. Values: MOBILE, EMAIL, USERNAME.

string

Mobile number of the customer. Either mobile number or email ID is required to authenticate with username.

string

Email ID of the customer. Either mobile number or email ID is required to authenticate with username.

string
required

Name of the brand/org for which authentication needs to be verified.

string
required

Unique ID of the device from which the customer has generated the token.

string
required

Session ID generated through the v1/token/generate API.

Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json