Skip to main content

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

curl --location 'https://api-uat.pfm.equal.in/pfm/user/analytics?fiType=ETF' \
--header 'Content-Type: application/json' \
--header 'authorization: eyJh...' \
--data ''

Authentication

This API requires Bearer token authentication:
HeaderTypeRequiredDescription
authorizationstringYesBearer token obtained from the SDK Init API session
content-typestringYesMust be set to application/json

Query Parameters

ParameterTypeRequiredDescription
fiTypestringNoFilter 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:
{
  "status": "SUCCESS",
  "data": {
    // Analytics data specific to the requested fiType
    // Complete examples available in the drive folder above
  }
}
FieldTypeDescription
statusstringStatus of the API call. Will be SUCCESS for successful requests.
dataobjectAnalytics 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:
{
  "status": "FAILED",
  "message": "Error in processing request, please retry after sometime",
  "status_code": "invalid_session_token"
}
FieldTypeDescription
statusstringStatus of the API call. Will be FAILED for failed requests.
messagestringHuman-readable error message explaining what went wrong.
status_codestringMachine-readable error code for programmatic error handling.

Error Handling

Error CodeHTTP StatusDescriptionResolution
invalid_session_token400 Bad RequestThe provided session token is invalid, expired, or malformedObtain a new session token using the SDK Init API
no_analytics404 Not FoundNo financial analytics data is available for the userEnsure the user has connected their financial accounts and data is available
invalid_fitype400 Bad RequestThe provided fiType parameter value is not supportedUse a valid FI type from the supported list (DEPOSIT, MUTUAL_FUNDS, EQUITIES, etc.)

Supported FI Types

The fiType parameter accepts the following values:
FI TypeDescription
DEPOSITBank deposits and savings accounts
MUTUAL_FUNDSMutual Fund investments
EQUITIESEquity investments and stocks
TERM_DEPOSITFixed/Term deposits
RECURRING_DEPOSITRecurring deposit accounts
ETFExchange Traded Funds

Next Steps

After successfully retrieving analytics data:
  1. Parse the Response: Extract the analytics data and breakdown information for display in your application
  2. Handle Different FI Types: Use the breakdown array to show category-wise analytics
  3. Implement Caching: Consider caching analytics data to reduce API calls and improve performance
  4. 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.