API Documentation
v2.0.1 Postman
API Reference

API Documentation

Complete reference for all Unaport.ai REST APIs — authentication, consent management, data retrieval, and analytics. All responses are in JSON format.

🔑

Postman Collection

Import our Postman collection to quickly test all APIs in both UAT and Production environments.

⬇ Download Postman Collection v2.0 ⬇ Download Environment Variables
💡After importing, set the token environment variable from the Login API response before calling any other endpoints.

📝

FIU Data Flow

The standard end-to-end integration flow for an FIU to retrieve consented financial data.

1
Authenticate

Call the Login API to receive an access_token and refresh_token.

2
Create Consent Template

Pre-define consent parameters as a reusable Product template (optional but recommended).

3
Raise a Consent

Create a consent request for the user, providing vuaId, trackingId, AA, and consent parameters.

4
User Approves Consent

User is redirected to the AA platform via redirectUrl to approve or reject.

5
Receive Consent Notification

Unaport calls your webhook with the updated consent status (ACTIVE, FAILED, EXPIRED, etc.).

6
Data Fetched Automatically

On approval, Unaport fetches financial data from FIPs via the AA.

7
Receive Data Notification

Your webhook receives the sessionId when data is ready.

8
Fetch Data

Call Fetch Data by Session API with the sessionId to retrieve financial data.

9
Run Analytics (optional)

Call the Generate Analytics API on the session for ML-powered insights and spend analysis.


🌟

Introduction

All API requests require a Bearer token obtained via the Login API. Send it in the Authorization header for every authenticated request.

🔒Required headers for all authenticated requests: Authorization: Bearer <token> and Content-Type: application/json

🔒

Authentication API

Authenticate with email and password to get access and refresh tokens.

Login
POST https://common.sandbox.unaport.com/api/v1/public/user/login
No authentication required
AttributeDescriptionLengthTypeReq
emailIdUser email address254StringM
passwordLogin password8-64StringM
Request
POST https://common.sandbox.unaport.com/api/v1/public/user/login
Content-Type: application/json

{
  "emailId": "[email protected]",
  "password": "*****"
}
Response 200
{
  "access_token": "eyJhbGci...",
  "expires_in": 300,
  "refresh_expires_in": 1800,
  "refresh_token": "eyJhbGci...",
  "token_type": "Bearer",
  "txnId": "...",
  "timestamp": "2024-03-28T05:04:39.821Z"
}
AttributeDescriptionType
access_tokenBearer token for all authenticated requests (valid 300s)String
refresh_tokenUsed to get a new access token (valid 1800s)String
expires_inSeconds before access token expiresNumber
token_typeAlways "Bearer"String
Refresh Token API
POST https://common.sandbox.unaport.com/api/v1/public/user/refresh
AttributeDescriptionReq
refresh_tokenRefresh token from Login responseM

Returns the same structure as Login — a new access_token and refresh_token.

Get FIU Organisation Details
GET https://common.sandbox.unaport.com/api/v1/FIU/getClientOrganisation
Headers: Authorization: Bearer <token>
AttributeDescription
fiulive.entityIdFIU entity ID in live mode
fiutest.entityIdFIU entity ID in test mode
orgIdOrganisation identifier

📑

Consents API

Create templates, raise consents, check status, and revoke consents.

Create Consent Template
POST https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/ConsentTemplate/{orgId}
AttributeDescriptionTypeReq
product_nameUnique name for the consent templateStringM
ConsentDetail.consentModeVIEW | STORE | QUERY | STREAMStringM
ConsentDetail.fetchTypeONETIME | PERIODICStringM
ConsentDetail.consentTypesPROFILE, SUMMARY, TRANSACTIONSArrayM
ConsentDetail.fiTypesSee FI Types table belowArrayM
ConsentDetail.Purpose.code101–105 (see Purpose Codes)StringM
ConsentDetail.FIDataRange.fromStart months (negative = past, e.g. -12)NumberM
ConsentDetail.FIDataRange.toEnd monthsNumberM
ConsentDetail.DataLife.unitMONTH | YEAR | DAY | INFStringM
ConsentDetail.Frequency.unitHOUR | DAY | MONTH | YEARStringM
FI Types Reference
CategoryFI Types
BankDEPOSIT, TERM_DEPOSIT, RECURRING_DEPOSIT
InvestmentMUTUAL_FUNDS, ETF, EQUITIES, NPS
InsuranceINSURANCE_POLICIES
GSTGSTR1_3B
Create Consent with Template
POST https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/Consents/{orgId}
AttributeDescriptionReq
vuaIdUser's virtual AA ID (e.g. 9867902913@ink)M
mobileNumberMobile number linked to user's AA accountM
trackingIdYour unique tracking reference for this requestM
aaIdAccount Aggregator identifierM
fiuIdFIU identifier (as registered in Sahamati)M
productIdID of the consent template to useM
redirectUrlURL to redirect user after consent processedO
fiuBaseUrlYour FIU API base URL for notificationsM
Sample Request
{
  "vuaId": "9867902913@ink",
  "createdBy": "[email protected]",
  "trackingId": "your-unique-id-001",
  "aaId": "UNACORES-AA-UAT",
  "fiuId": "UNACORES-FIU-UAT",
  "redirectUrl": "https://your-app.com/consent-callback",
  "fiuBaseUrl": "https://api.sandbox.unaport.com/backend/api/v1",
  "productId": "5961868f-ac0e-45e6-9e7b-394c535fa4cc"
}
Response 200
{
  "ver": "1.0",
  "timestamp": "2024-03-28T05:04:39.821Z",
  "txnid": "4a4adbbe-29ae-11e8-a8d7-0289437bf331",
  "Customer": { "id": "9867902913@ink" },
  "ConsentHandle": "39e108fe-9243-11e8-b9f2-0256d88baae8",
  "success": "Consent created successfully",
  "redirectUrl": "https://api.sandbox.unaport.com/backend/api/v1/redirect/dfdESWW23dx"
}
Check Consent Status
GET https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/GetConsent/{consentHandle}
AttributeDescriptionType
consentHandleThe handle returned at consent creationString
approveStatusPENDING | READY | FAILED | EXPIREDString
consentStatusACTIVE | PAUSED | REVOKED | EXPIREDString
consentIdUnique consent ID (available only after approval)String
consentStartConsent validity startISO 8601
consentExpriedConsent expirationISO 8601
fetchTypeONETIME or PERIODICString
Revoke Consent
DELETE https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/RevokeConsent/{org_id}/{consentId}
Path params: org_id and consentId of the consent to revoke

📊

Data API

Fetch financial data using session IDs received via webhook notifications after consent approval.

Get FI Notification (Fetch Data Status)
GET https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/FINotification/{consentHandle}
AttributeDescriptionType
FIStatusNotification.sessionIdSession ID — use this to fetch dataString
FIStatusNotification.sessionStatusACTIVE | COMPLETEDString
FIStatusResponse[].fipIDFIP identifierString
Accounts[].FIStatusREADY | PENDING | FAILEDString
Fetch Data by Session ID
GET https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/FifetchDataBySessionId/{sessionId}
Returns full account summary, holder details, and transactions
AttributeDescriptionType
tabs[].nameFI type tab names (e.g. "DEPOSIT")Array
DEPOSIT.summary[].currentBalanceCurrent account balanceString
DEPOSIT.summary[].accountNumberMasked account numberString
DEPOSIT.summary[].accountTypeSAVINGS | CURRENT | ODString
DEPOSIT.accountHolder[].nameAccount holder nameString
DEPOSIT.accountHolder[].panPAN numberString
DEPOSIT.transactions[].amountTransaction amountString
DEPOSIT.transactions[].typeDEBIT | CREDITString
DEPOSIT.transactions[].narrationTransaction descriptionString
DEPOSIT.transactions[].tranTimestampTransaction timestampISO 8601
DEPOSIT.transactions[].currentBalanceBalance after transactionString

📈

Analytics API

ML-powered analytics for single and aggregate accounts — available in sync and async modes. Includes spend categorization, income analysis, and EMI matching.

Single Account — Generate Analytics (Sync & Async)
POST https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/Analytics/{reportId}/{sessionId}
Headers: Authorization: Bearer <token>
ResponseDescriptionType
reportIdUnique ID for the generated analytics reportInteger
statusHTTP status of the requestString
Aggregate Analytics — Generate (Sync & Async)
POST https://api.sandbox.unaport.com/backend-v2/api/v2/FIU/AggregateAnalytics/{sessionId}
HeaderDescription
AuthorizationBearer token
OrgIDOrganisation ID

📊

Data Notification API

Webhook sent when financial data is fetched. Contains the sessionId to retrieve the data.

AttributeDescriptionType
FIStatusNotification.sessionIdUse this to call Fetch Data by SessionString
FIStatusNotification.sessionStatusACTIVE | COMPLETEDString
Accounts[].FIStatusREADY — data is availableString
📈

Analytics Notification API

Webhook called when analytics processing completes for a session.

AttributeDescriptionType
sessionIdSession identifierString
analyticIdList of generated analytic report IDsArray
statusSUCCESS | FAILEDString