Authentication¶
This authentication guide is for users working on REST API accounts already mapped to OMS V3.
Use the environment URL that matches the account mapping you have been enabled on. In most rollout cases, teams validate first on UAT and then switch the same V3 flow to PROD after the production account has been mapped.
Nubra Auth Flow¶
API Endpoints¶
| Environment | Base URL |
|---|---|
| PROD | https://api.nubra.io |
| UAT | https://uatapi.nubra.io |
Step 1: Generate Temporary Token¶
Initiates the login flow and returns a temp_token. This token is required for the OTP request in the next step.
Method: POST
Endpoint: /sendphoneotp
cURL¶
curl --location 'https://api.nubra.io/sendphoneotp' \
--header 'Content-Type: application/json' \
--data '{
"phone": "0000000000",
"skip_totp": false
}'
Payload¶
{
"phone": "0000000000",
"skip_totp": false
}
Response¶
{
"attempts_left": 4,
"email": "xyz@gmail.com",
"expiry": 30,
"flow": "LOGIN",
"message": "OTP sent",
"next": "VERIFY_MOBILE",
"phone": "0000000000",
"temp_token": "eyJh...zd0"
}
Save the
temp_tokenfrom this response. This token must be passed in thex-temp-tokenheader in Step 2. Also choose thex-device-idto be used for this login session, for example12345macorTS123.
Step 2: Send OTP¶
Uses the temp_token from Step 1 to generate and send the OTP required for login.
Method: POST
Endpoint: /sendphoneotp
cURL¶
curl --location 'https://api.nubra.io/sendphoneotp' \
--header 'x-temp-token: eyJh...zd0' \
--header 'Content-Type: application/json' \
--data '{
"phone": "0000000000",
}'
Headers¶
x-temp-token:temp_tokenreturned in Step 1
Payload¶
{
"phone": "0000000000",
}
Response¶
{
"attempts_left": 4,
"email": "xyz@gmail.com",
"expiry": 30,
"flow": "LOGIN",
"message": "OTP sent",
"next": "VERIFY_MOBILE",
"phone": "0000000000",
"temp_token": "eyJh...zd0"
}
Save the new
temp_tokenreturned in this response. This updated token must be used during OTP verification in Step 3.
Step 3: Verify OTP¶
Validates the OTP received on the registered mobile number. Use the latest temp_token and the same x-device-id selected for this login session.
Method: POST
Endpoint: /verifyphoneotp
cURL¶
curl --location 'https://api.nubra.io/verifyphoneotp' \
--header 'x-temp-token: eyJh...zd0' \
--header 'x-device-id: TS123' \
--header 'Content-Type: application/json' \
--data '{
"phone": "0000000000",
"otp": "341874"
}'
Headers¶
x-temp-token: Latesttemp_tokenreturned by the previous stepx-device-id: Device identifier selected for this login session, for exampleTS123
Payload¶
{
"phone": "0000000000",
"otp": "341874"
}
Response¶
{
"auth_token": "7a1171e6-790c-40fa-ae16-b71cfd19923f",
"flow": "LOGIN",
"message": "User Created Successfully",
"next": "ENTER_MPIN"
}
Save the
auth_token. This token is used as the Bearer token in Step 4.
Step 4: Verify PIN¶
Validates the user's MPIN and returns the final authenticated session.
Method: POST
Endpoint: /verifypin
cURL¶
curl --location 'https://api.nubra.io/verifypin' \
--header 'x-device-id: TS123' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 7a1171e6-790c-40fa-ae16-b71cfd19923f' \
--data '{
"pin": "1234"
}'
Authorization¶
- Type: Bearer Token
- Token:
auth_tokenreturned in Step 3
Headers¶
x-device-id: Same device ID used in Step 3x-temp-token: Do not include this header in this request
Payload¶
{
"pin": "1234"
}
Response¶
{
"email": "xyz@gmail.com",
"message": "Login Successful",
"next": "DASHBOARD",
"phone": "0000000000",
"session_token": "eyJh...6Pno",
"userId": 224
}
The
session_tokenreturned in this response is the final login token. Use it as the Bearer token for authenticated REST APIs such as market data, trading, portfolio, and account endpoints. If static IP access is enabled for the account, call Static IP Validation after login to verify the current outbound IP before sending trading requests.
Authenticated Request Headers¶
For authenticated REST API calls on OMS V3-mapped accounts, use the same REST header style as the main REST API track:
Authorization: Bearer <session_token>x-device-id: <device_id>
Include Content-Type: application/json when the request sends a JSON body.