Overview
The User Analytics API retrieves comprehensive financial analytics and insights for a specific user based on their financial data. This API provides personalized financial metrics, spending patterns, investment analysis, and other PFM insights that can be displayed in your application interface.Example Request
Authentication
This API requires Bearer token authentication:| Header | Type | Required | Description |
|---|---|---|---|
authorization | string | Yes | Bearer token obtained from the SDK Init API session |
content-type | string | Yes | Must be set to application/json |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fiType | string | No | Filter analytics by Financial Information type. Valid values are DEPOSIT, MUTUAL_FUNDS, EQUITIES, TERM_DEPOSIT, RECURRING_DEPOSIT, ETF. |
Response
Success Response (200 OK)
When the analytics data is successfully retrieved, the API returns comprehensive financial insights. Complete Response Examples: For detailed response structures across all analytics types (ETF, Mutual Funds, Equities, Deposits, Term Deposits, Recurring Deposits), access our comprehensive response folder: 👉 View All Analytics Sample Response Basic Response Structure:| Field | Type | Description |
|---|---|---|
status | string | Status of the API call. Will be SUCCESS for successful requests. |
data | object | Analytics data containing financial insights and metrics for the user. |
Error Responses (400 Bad Request / 404 Not Found)
When the request fails due to authentication or data issues, the API returns specific error responses:| Field | Type | Description |
|---|---|---|
status | string | Status of the API call. Will be FAILED for failed requests. |
message | string | Human-readable error message explaining what went wrong. |
status_code | string | Machine-readable error code for programmatic error handling. |
Error Handling
| Error Code | HTTP Status | Description | Resolution |
|---|---|---|---|
invalid_session_token | 400 Bad Request | The provided session token is invalid, expired, or malformed | Obtain a new session token using the SDK Init API |
no_analytics | 404 Not Found | No financial analytics data is available for the user | Ensure the user has connected their financial accounts and data is available |
invalid_fitype | 400 Bad Request | The provided fiType parameter value is not supported | Use a valid FI type from the supported list (DEPOSIT, MUTUAL_FUNDS, EQUITIES, etc.) |
Supported FI Types
ThefiType parameter accepts the following values:
| FI Type | Description |
|---|---|
DEPOSIT | Bank deposits and savings accounts |
MUTUAL_FUNDS | Mutual Fund investments |
EQUITIES | Equity investments and stocks |
TERM_DEPOSIT | Fixed/Term deposits |
RECURRING_DEPOSIT | Recurring deposit accounts |
ETF | Exchange Traded Funds |
Next Steps
After successfully retrieving analytics data:- Parse the Response: Extract the analytics data and breakdown information for display in your application
- Handle Different FI Types: Use the breakdown array to show category-wise analytics
- Implement Caching: Consider caching analytics data to reduce API calls and improve performance
- Error Handling: Implement proper error handling for token expiry and retry logic
Security Considerations
- Token Security: Handle session tokens securely and avoid logging them
- HTTPS Only: Always use HTTPS when calling this API
- Token Refresh: Implement proper token refresh logic when tokens expire
- Rate Limiting: Be mindful of API rate limits and implement appropriate throttling
- Encryption Support: This API supports encryption. When encryption is enabled for your integration, both request and response payloads will be encrypted. See API Encryption Guide for details.
