# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
This site has an agentic ask interface you may use to query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.sahamati.org.in/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

---

# Background

The Account Aggregator (AA) infrastructure is a sophisticated technological framework designed to revolutionize data sharing across the financial sector in India. The collaboration among financial sector regulators (FSRs)—Reserve Bank of India (RBI), Securities and Exchange Board of India (SEBI), Insurance Regulatory Development Authority (IRDA), and Pension Fund Regulatory Development Authority (PFRDA)—under the Financial Sector Development Council (FSDC) has aimed to establish a seamless, secure, and efficient data-sharing mechanism.

The Reserve Bank Information Technology Pvt Ltd (ReBIT), a wholly-owned subsidiary of the RBI, was authorized to establish technology standards for the ecosystem. This regulatory framework established a high-level architecture, and the market was kept independent of operationalizing the data-sharing mechanism. This market-driven approach has led to the formation of Sahamati as an industry alliance to collaboratively build the necessary procedural and technological foundations for the AA ecosystem.

SahamatiNet is the technological infrastructure developed and maintained by Sahamati to support the Account Aggregator (AA) EcoSystem. Hosted in a secure, highly available, and scalable environment, this technological infrastructure ensures the robustness and reliability of the AA EcoSystem. The infrastructure aims to engender trust, build visibility in ecosystem health, offer implementation support and grievance redressal mechanisms, foster a culture of compliance, and enable efficient integrations across the ecosystem. Sahamati has co-created these crucial technology artefacts with the collective intelligence of the ecosystem to serve its diverse needs.

Delve into the functional aspects of the SahamatiNet:

<table data-card-size="large" data-column-title-hidden data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Network Trust</strong></td><td>Sahamati's Central Registry securely lists verified AA ecosystem entities and uses a Token Service to enable trusted, authorized data exchange.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FRaxrXcnrbGVw9rqFpxwF%2Fnetwork-trust-v2.jpg?alt=media&amp;token=da46aaca-a0c1-410d-b237-369b5691b918">network-trust-v2.jpg</a></td><td><a href="https://developer.sahamati.org.in/#network-trust">Background</a></td></tr><tr><td><strong>Network Health</strong></td><td>Sahamati's network health monitoring and MIS dashboards provide real-time visibility and insights to detect issues early, ensure smooth operations, and track key ecosystem metrics.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FmzrXPlcyZpOfEJ9thCdg%2Fnetwork-health.jpg?alt=media&amp;token=9d43c803-a92c-454c-9e50-775884b16240">network-health.jpg</a></td><td><a href="https://developer.sahamati.org.in/#network-health">Background</a></td></tr><tr><td><strong>Certification</strong></td><td>Sahamati promotes compliance in the AA ecosystem through a standardized certification process that ensures adherence to ReBIT standards, fosters trust, and enables seamless interoperability.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2F0gLgkD1urqalDp3W74yE%2Fnetwork-certification.jpg?alt=media&amp;token=9693c826-0653-4833-9e68-9d0b33fbeee0">network-certification.jpg</a></td><td><a href="https://developer.sahamati.org.in/#certification">Background</a></td></tr><tr><td><strong>Network Support</strong></td><td>Sahamati offers support and drives SahamatiNet to ensure seamless onboarding, interoperability, compliance, observability, and policy advocacy for a robust AA ecosystem.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2F8ZkOpusxAd6iY98FaAhm%2Fnetwork-support.jpg?alt=media&amp;token=d724f427-7ac2-4739-8ff5-8a578227f41d">network-support.jpg</a></td><td><a href="https://developer.sahamati.org.in/#network-support">Background</a></td></tr></tbody></table>

### Network Trust <a href="#network-trust" id="network-trust"></a>

Sahamati maintains a Central Registry (CR) to facilitate the discoverability of public information related to each member endpoint. CR is a comprehensive database listing all authenticated and authorized entities within the AA ecosystem. It ensures that only verified Account Aggregators, Financial Information Providers (FIPs), and Financial Information Users (FIUs) can participate. CR empowers eligibility verification and streamlines the onboarding process onto the network, fostering stakeholder confidence and trust.

The CR is supported through a token service that ensures the validity & reliability of end-point information. It enhances security by managing secure and efficient data exchanges between entities. It issues and validates tokens, ensuring that all data requests and transfers are authenticated, authorized, and encrypted. By codifying network-level authorization rules, the token service safeguards against unauthorized access and enhances trust within the network.

### Network Health

Sahamati has built a network health monitoring infrastructure that provides visibility into various parameters of health in the ecosystem. Through continual tracking of the performance of the ecosystem, the system equips identification of potential issues such as downtimes or implementation bugs. It enables proactive management and rapid resolution of any disruptions, ensuring smooth and efficient operations. Complementing the monitoring system are the Management Information System (MIS) dashboards, which offer real-time visibility into key metrics and performance indicators. These dashboards provide detailed insights into volumes of accounts linked as well as consents fulfilled.

### Certification

Sahamati is committed to fostering a culture of compliance in the Account Aggregator (AA) ecosystem. It has institutionalized a certification process before onboarding members to foster a standardized and secure ecosystem. Members can opt for this certification service to ensure adherence to the Technical Standards set by ReBIT and simplify compliance. Sahamati has strategically empanelled organizations to provide independent certification services, guaranteeing compliance and impartial assessment. Certification also fosters trust and enables easy integration, facilitating seamless interoperability and reducing integration friction.

### Network Support

Sahamati equips the ecosystem with implementation support and grievance redressal mechanisms. During the implementation phase, Sahamati provides comprehensive support, offering technical assistance, guidance, and resources to ensure smooth onboarding and effective utilization of the infrastructure. A dedicated support application is available to address grievances and resolve issues faced by members. This mechanism ensures that any problems are promptly addressed, maintaining member satisfaction and trust in the ecosystem.

SahamatiNet aims to create an interoperable, customer-centric ecosystem through a secure, transparent, and efficient infrastructure. This holistic infrastructure ensures the reliability, security, and growth of the AA ecosystem. The infrastructure enhances the efficiency of data-sharing transactions and promotes trust and collaboration among all stakeholders, driving the overall success of the AA ecosystem.

Currently, SahamatiNet is dedicated to addressing key ecosystem challenges, including interoperability, data usage compliance, and operational efficiency, to provide a seamless experience for AA ecosystem members. The following are the primary focus areas of SahamatiNet:

* **Interoperability:** Enable ecosystem members to connect seamlessly with all other Sahamati Network entities. This eliminates the need for multiple integration points, significantly reducing the integration and operational efforts for members.
* **Fair Use Compliance:** FIUs and AAs are expected to align their consent usage within ecosystem-defined boundaries to ensure the fair use of AA. SahamatiNet aims to develop a programmatic, policy-based automated framework that ensures compliance with fair use policies regarding customer consent and data.
* **Network Observability:** SahamatiNet aims to scale the current network health monitoring system to a comprehensive infrastructure that provides real-time data access and monitors fraud to aid efficient dispute resolution, billing & reconciliation, and tracking network usage.
* **Policy Development and Advocacy**: The organization is engaged in developing policies and advocating for regulatory frameworks that support the growth and sustainability of the AA ecosystem.
* **Additional Initiatives**: Sahamati is continually exploring and implementing other initiatives to support and enhance the AA ecosystem's functionality and resilience.

However, it is important to adopt and implement technological solutions alongside governance measures to expedite the resolution of these challenges.


# Central Registry (CR)

### Central Registry (CR) <a href="#central-registry-cr" id="central-registry-cr"></a>

The Central Registry is a core service in the AA ecosystem, provided by Sahamati, which serves as a directory for all participants—Account Aggregators (AAs), Financial Information Providers (FIPs), and Financial Information Users (FIUs). It provides essential information about each participant, including their public IP addresses and public keys, enabling secure and interoperable communication within the ecosystem.

The Central Registry offers an API that allows participants to access details of other members, subject to role-based access restrictions. These roles are defined through identity tokens issued by Sahamati, ensuring that each participant can only access relevant information. For instance, AAs can fetch details of FIPs and FIUs, while FIPs and FIUs can retrieve information about AAs.

Additionally, the Central Registry is closely integrated with the Token Issuance service, which provides each participant with a short-lived JSON Web Token (JWT) for secure API calls across the ecosystem. This JWT is used to authenticate each participant and must be refreshed every 24 hours.

The Central Registry ensures seamless interaction within the AA ecosystem by making vital participant information easily accessible and securely managed.

### &#x20;<a href="#identity-access-management-token-service" id="identity-access-management-token-service"></a>

<br>


# APIs

Central Registry APIs

### Fetching Regulated Entities REs metadata using Central Registry (CR)

A RE should fetch the metadata of the other REs to interact with them through ReBIT APIs to handle the AA ecosystem functionalities. Sahamati provided the CR APIs to access the REs metadata. Here is the sequence diagram for Fetching REs metadata.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTkKNOEJjQLqrQKi9iJSP8KjDbaa3nfnmSw_IcuBi2yhIjW7cLQKPBlv1k2r8UCmWGT21YNh7mnry6pxFUNKr4hGgwUTn-KjXvmrTcfC3EZkn5YEUV97NYyCZbw_-qmkJBGQsQMQ?key=3aTz-3SKYP0rOCX7DFnLglx6" alt=""><figcaption><p>Fetch REs Metadata using Central Registry</p></figcaption></figure>

{% openapi src="/files/jW0T1thS78gNa6XYDnMn" path="/v2/entityInfo/{type}" method="get" %}
[CR-Service-API-v1.0.yaml](https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/ULRrUF0meRjhWs0vS0Tx/CR-Service-API-v1.0.yaml)
{% endopenapi %}

{% openapi src="/files/jW0T1thS78gNa6XYDnMn" path="/v2/entityInfo/{type}/{id}" method="get" %}
[CR-Service-API-v1.0.yaml](https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/ULRrUF0meRjhWs0vS0Tx/CR-Service-API-v1.0.yaml)
{% endopenapi %}

#### API Collection:

{% file src="/files/6JfkK74IpWh1PQYJfoXX" %}
Central Registry - API Collection
{% endfile %}


# JSON Template

## CR Entity Registration

**API Parameter Reference · FIP / FIU / AA**

This document describes every parameter in the Central Registry entity registration JSON payload. Fields marked **Required** must be present for all entity types. Fields marked **FIP only** / **AA only** apply exclusively to that entity type. Fields marked **Ignore** are reserved for future use.

### Root-Level Parameters

<table><thead><tr><th width="152.111083984375">Field / Parameter</th><th width="132.111083984375">Type</th><th>Required</th><th>Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>ver</code></td><td>String</td><td><strong>Required</strong></td><td>Version of the API/schema being used.</td><td><code>2.0</code></td></tr><tr><td><code>timestamp</code></td><td>String (ISO 8601)</td><td><strong>Required</strong></td><td>UTC timestamp of the request in ISO 8601 format.</td><td><code>2026-03-18T08:04:50.314Z</code></td></tr><tr><td><code>txnid</code></td><td>String (UUID)</td><td><strong>Required</strong></td><td>Unique transaction ID for tracking this request.</td><td><code>407a70dd-88dd-423d-97a6-edbc0d0694da</code></td></tr><tr><td><code>type</code></td><td>String (Enum)</td><td><strong>Required</strong></td><td>Entity type being registered. One of: <code>FIP</code>, <code>FIU</code>, <code>AA</code>.</td><td><code>FIU</code></td></tr></tbody></table>

### `requester` — Identifies the party submitting the request

<table><thead><tr><th width="151.66668701171875">Field / Parameter</th><th width="104.5555419921875">Type</th><th width="122.666748046875">Required</th><th>Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>requester.name</code></td><td>String</td><td><strong>Required</strong></td><td>Display name of the entity submitting the request.</td><td><code>Sahamati FIU Test</code></td></tr><tr><td><code>requester.id</code></td><td>String</td><td><strong>Required</strong></td><td>Unique ID of the requesting entity as registered in the CR.</td><td><code>sahamati-fiu-test-new</code></td></tr></tbody></table>

### `entityinfo` — Core entity registration details

<table><thead><tr><th width="149">Field / Parameter</th><th width="105.44439697265625">Type</th><th width="131.111083984375">Required</th><th width="202.3333740234375">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>entityinfo.tags</code></td><td>String</td><td>Optional</td><td>Environment tag for the entity (e.g. <code>Sandbox</code>, <code>Production</code>).</td><td><code>Sandbox</code></td></tr><tr><td><code>entityinfo.name</code></td><td>String</td><td><strong>Required</strong></td><td>Name of the entity as submitted while listing itself in the CR. <br>Note: <strong>Ensure this matches exactly as mentioned in your Certificate of Registration (CoR) issued by your regulator</strong>.</td><td><code>Sahamati Foundation</code></td></tr><tr><td><code>entityinfo.id</code></td><td>String</td><td><strong>Required</strong></td><td>Unique ID issued by the CR to the entity.<br>Note: <strong>Please refer to</strong> <a href="https://membersuccess.sahamati.org.in/member-services/cr-pre-onboarding-guide/entity-id-naming-convention"><strong>this page</strong></a> <strong>for your Entity ID naming convention.</strong></td><td><code>sahamati-fiu-test-new</code></td></tr><tr><td><code>entityinfo.code</code></td><td>String</td><td><strong>Required</strong></td><td>ID issued by the financial sector regulator governing this entity.<br>Note: <strong>Ensure this matches exactly as mentioned in your Certificate of Registration (CoR) issued by your regulator.</strong></td><td></td></tr><tr><td><code>entityinfo.entityhandle</code></td><td>String</td><td>AA only</td><td>Handle suffix for user profiles managed by the AA (e.g. <code>@aa</code>). Leave blank for FIU/FIP.</td><td></td></tr></tbody></table>

### `entityinfo.Identifiers` — Account discovery identifiers

*(FIP only; present here for schema completeness)*

| Field / Parameter        | Type          | Required | Description                                                                                   | Example Value |
| ------------------------ | ------------- | -------- | --------------------------------------------------------------------------------------------- | ------------- |
| `Identifiers[].category` | String (Enum) | FIP only | Category of identifier accepted for account discovery. Values: `STRONG`, `WEAK`, `ANCILLARY`. | `STRONG`      |
| `Identifiers[].type`     | String (Enum) | FIP only | Type of identifier (e.g. `MOBILE`, `PAN`, `DOB`). At least one must be `STRONG`.              | `MOBILE`      |

### `entityinfo` — Connectivity & Endpoints

| Field / Parameter          | Type           | Required     | Description                                                                                                            | Example Value                                       |
| -------------------------- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `entityinfo.baseurl`       | String (URL)   | **Required** | URL hosting all ReBIT-compliant API endpoints. Prefix with version e.g. `v2:` for versioned URLs.                      | `v2:https://data.sahamati.com/fiu/sahamati-test/v2` |
| `entityinfo.webviewurl`    | String (URL)   | AA only      | URL of the AA web app for FIUs to redirect users to. `null` for FIU/FIP.                                               | `null`                                              |
| `entityinfo.fitypes`       | Array\<String> | FIP only     | Financial information types from the ReBIT master list that the entity supports. Present here for schema completeness. | `DEPOSIT, MUTUAL_FUNDS, EQUITIES...`                |
| `entityinfo.inboundports`  | Array\<String> | **Required** | Ports on the entity that counterparties (AA/FIP/FIU) can connect to.                                                   | `["443"]`                                           |
| `entityinfo.outboundports` | Array\<String> | **Required** | Ports from which the entity will make outbound requests.                                                               | `["443"]`                                           |
| `entityinfo.ips`           | Array\<String> | **Required** | IP addresses counterparties may send and receive requests to/from.                                                     | `["13.127.138.226"]`                                |

### `entityinfo.certificate` — Public key in JSON Web Key (JWK) format

| Field / Parameter | Type   | Required     | Description                                              | Example Value                          |
| ----------------- | ------ | ------------ | -------------------------------------------------------- | -------------------------------------- |
| `certificate.alg` | String | **Required** | Algorithm used. Typically `RS256`.                       | `RS256`                                |
| `certificate.kty` | String | **Required** | Key type. Must be `RSA`.                                 | `RSA`                                  |
| `certificate.use` | String | **Required** | Intended use of the key. `sig` = signature verification. | `sig`                                  |
| `certificate.kid` | String | **Required** | Key ID — unique identifier for this key.                 | `ed9c4269-96de-4a62-b057-e2dd628d359c` |
| `certificate.e`   | String | **Required** | RSA public exponent (Base64url encoded).                 | `AQAB`                                 |
| `certificate.n`   | String | **Required** | RSA modulus — the public key value (Base64url encoded).  | `ngB4ScutfK6776QK...`                  |

### `entityinfo.gsp` — Gateway Service Provider

(Leave these Field/Parameter values as null — Reserved for future use)

| Field / Parameter | Type | Required | Description                                                                                    | Example Value |
| ----------------- | ---- | -------- | ---------------------------------------------------------------------------------------------- | ------------- |
| `gsp`             | null | null     | GSP details when a gateway sits between AAs and the FIP (e.g. GSTN). Set to `null` for FIU/AA. | `null`        |

### `entityinfo.tokeninfo` — Token issuance details

(Leave these Field/Parameter values as empty — Reserved for future use)

| Field / Parameter | Type         | Required   | Description                                                          | Example Value |
| ----------------- | ------------ | ---------- | -------------------------------------------------------------------- | ------------- |
| `tokeninfo.url`   | String (URL) | Keep Empty | URL of the entity's Token Issuance Service. Reserved for future use. | `""`          |
| `tokeninfo.desc`  | String       | Keep Empty | Description field. Reserved for future use.                          | `""`          |

### `entityinfo.signature` — Request signature

(Leave these Field/Parameter values as empty — Reserved for future use)

| Field / Parameter     | Type   | Required   | Description                                                              | Example Value |
| --------------------- | ------ | ---------- | ------------------------------------------------------------------------ | ------------- |
| `signature.signValue` | String | Keep Empty | Cryptographic signature of the request payload. Reserved for future use. | `""`          |

***

### Notes

* `baseurl` will be prefixed with a version tag (e.g. v2:https\://...) to indicate the supported API version.
* `certificate` fields follow the JSON Web Key (RFC 7517) specification.
* `tokeninfo` and `signature` fields are present in the schema but should be left empty / ignored until further notice.
* `gsp` must be set to `null` for FIU and AA entity types.
* `entityhandle` and `webviewurl` are AA-specific and should be omitted or set to null/blank for FIP and FIU.

### Template

> **Note**: The base JSON structure is identical for all RE types. The tabs below are provided for clarity — each view highlights the relevant fields and example values as applicable to that entity type (FIU, FIP, or AA).

{% tabs %}
{% tab title="FIU" %}

```json
{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "FIU",
  "requester": {
    "name": "Sahamati FIU Test",
    "id": "sahamati-fiu-test-new"
  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati FIU Test",
    "id": "sahamati-fiu-test-new",
    "code": "sahamati-fiu-test-new",
    "entityhandle": "",
    "Identifiers": [],
    "baseurl": "v2:https://data.sahamati.com/fiu/sahamati-test/v2",
    "webviewurl": null,
    "fitypes": [],
    "certificate": {
      "e": "AQAB",
      "n": "<RSA modulus here>",
      "alg": "RS256",
      "kid": "<key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["<ip-address>"]
  }
}

```

{% endtab %}

{% tab title="FIP" %}

<pre class="language-json"><code class="lang-json">{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "FIP",
  "requester": {
    "name": "Sahamati FIP Test",
<strong>    "id": "sahamati-fip-test"
</strong>  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati FIP Test",
    "id": "sahamati-fip-test",
    "code": "sahamati-fip-test",
    "entityhandle": "",
    "Identifiers": [
      { "category": "STRONG", "type": "MOBILE" },
      { "category": "STRONG", "type": "PAN" }
    ],
    "baseurl": "v2:https://data.sahamati.com/fip/sahamati-test/v2",
    "webviewurl": null,
    "fitypes": [
      "DEPOSIT", "TERM_DEPOSIT", "RECURRING_DEPOSIT", "SIP", "CP",
      "EQUITIES", "MUTUAL_FUNDS"
    ],
    "certificate": {
      "e": "AQAB",
      "n": "&#x3C;RSA modulus here>",
      "alg": "RS256",
      "kid": "&#x3C;key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["&#x3C;ip-address>"]
  }
}
</code></pre>

{% endtab %}

{% tab title="AA" %}

```json
{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "AA",
  "requester": {
    "name": "Sahamati AA Test",
    "id": "sahamati-aa-test"
  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati AA Test",
    "id": "sahamati-aa-test",
    "code": "sahamati-aa-test",
    "entityhandle": "@sahamati-aa-test",
    "Identifiers": [],
    "baseurl": "v2:https://data.sahamati.com/aa/sahamati-test/v2",
    "webviewurl": "https://webview.sahamati.com/aa/sahamati-test",
    "fitypes": [],
    "certificate": {
      "e": "AQAB",
      "n": "<RSA modulus here>",
      "alg": "RS256",
      "kid": "<key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["<ip-address>"]
  }
}

```

{% endtab %}
{% endtabs %}


# Entity ID Naming Convention

Entity ID naming rules for onboarding to the Central Registry are maintained by Sahamati's Member Services team.

Refer to the current guide here:

[**Entity ID Naming Convention →**](https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/entity-id-naming-convention)

For questions specific to entity ID assignment during onboarding, reach out to the Member Services Team at \[<memberservices@sahamati.org.in>].


# FAQ Central Registry

Frequently asked questions on the Sahamati Central Registry, covering listing requirements, entity metadata, access control, API endpoints and rate limits.

**Q: What is the Central Registry and why is it important?**\
The Central Registry is a central repository that maintains accurate, verifiable metadata (e.g., identifiers, API endpoints, IP addresses, public cryptographic keys, etc.) of onboarded AAs, FIPs, and FIUs for automated discoverability and trusted communication among such entities.

**Q: What entities can be listed in the Central Registry?**\
Regulated Entities like Account Aggregators (AAs), Financial Information Providers (FIPs), and Financial Information Users (FIUs).

**Q: What are the key metadata attributes required for listing in the Central Registry?**\
Entity ID, Legal name, Entity type, Base URL (format `v1:<url>`, `v2:<url>`), public key in JWK format, and inbound/outbound IPs, to name a few. For the complete attributes list, kindly refer <https://developer.sahamati.org.in/central-registry/json-template>

**Q: How should I choose my Entity ID?**\
Follow the Entity ID Naming Convention published by the Sahamati Member Success function, which can be found in this FAQ <https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/faqs>

**Q: How do I generate the public key/certificate for listing?**\
Create an RSA key pair in JWK format (kty=RSA, use=sig, alg=RS256, unique kid) as per the How To Generate a Certificate guide. Never share the private key.

**Q: How do I get listed in the Central Registry (CR)?**\
Kindly refer to the CR Onboarding Guide at [https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide](https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/faqs)

**Q: How does role-based access control (RBAC) work in the Central Registry?**\
AAs can retrieve metadata information of FIPs and FIUs **but not** of other AAs, while FIPs and FIUs can retrieve metadata information about AAs **but not** of other FIUs and FIPs.

**Q: What are the Central Registry API endpoints?**\
`GET /cr/v2/entityInfo/{type}` for all entities of a type, `GET /cr/v2/entityInfo/{type}/{id}` for an entity of a specific type with entityID

**Q: Can I still use the Central Registry V1 APIs?**\
No. V1 APIs were decommissioned in October 2024 and would return an HTTP response status of 410; Instead use the /cr/v2 endpoints.

**Q: What security measures protect Central Registry data?**\
HTTPS with TLS 1.2+, bearer-token authentication, role-based access control, and database encryption at rest.

**Q: Can I update my Central Registry information directly?**\
Not via API yet. Send change requests for your Central Registry details to <memberservices@sahamati.org.in>. Kindly refer [Checklists and JSON - Templates | Sahamati](https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/checklists-and-json-templates) for more information.

**Q: Is there any rate limit enforced on the Central Registry GET APIs?**\
Yes, 1000 requests per 24 hours; when requests exceed this rate limit, the API returns *HTTP 429 Too Many Requests.*


# Token Service

The Identity and Access Management (IAM) system within the AA ecosystem is responsible for ensuring secure and authorized access to ecosystem APIs. It manages participant roles, such as AA, FIP, or FIU, which are assigned during registration and embedded in the identity tokens issued by Sahamati. These roles govern access to services and ensure that participants can only access information they are authorized for.

To facilitate secure interactions, IAM utilizes Access Tokens—short-lived JSON Web Tokens (JWT)—to authorise participants when they access ecosystem APIs. The Access Tokens, linked to the participant's role, ensure that only authorised individuals or entities can retrieve specific data or interact with services. Through role-based access control and token-based authentication, IAM safeguards the ecosystem's integrity and protects sensitive data while enabling secure communication among participants.

<br>


# APIs

Identity and Access Management ( Token Service) APIs

Each member of the Sahamati Network will be onboarded with a designated user who holds an admin role to manage the entity’s profile and secret.

* During the onboarding process, the designated user will receive an email containing a verification link. After email verification, **the user will be prompted to set a password**, completing the account activation process.
* Once the password is set, **the user can generate the User Access Token** by providing their email and the new password. This token is used for authenticating the entity’s secrets.
* The designated user can then use the User Access Token to **access the entity’s secret** and, if necessary, **reset the secret**.
* Finally, the entity secret is used to **generate the Entity Access Token**, which is needed for interactions with the ReBIT APIs within the AA network.

### Entity Token Generation use case&#x20;

The Regulated Entities (REs) should generate the Access Token using the Token API from Sahamati for accessing and authentication of any APIs in the AA ecosystem including Sahamati APIs.

Here is the sequence diagram for the Token Generation Process.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdc4HeMCiC89Fdmj_Xf0Nv3AZZKB6BuqMxBUGRt41o73HkYfBchfZOQ9S_a5dg6nK32KXqo44LBDV1AhjU_IyorOrAk0PFyphQuHLr0k3ilJwrjo2xbHH6XFFhwJB0hZWZuW62-0Q?key=3aTz-3SKYP0rOCX7DFnLglx6" alt=""><figcaption><p>Token Generation use case diagram</p></figcaption></figure>

Below are the Base URL of each environment to use IAM APIs.

<table><thead><tr><th width="213.489501953125">Environment</th><th>Base URL</th></tr></thead><tbody><tr><td>Production</td><td>https://api.sahamati.org.in/iam</td></tr></tbody></table>

Please note that the following documentation displays the Base URLs from the Production environment. Ensure you use the appropriate Base URLs depending on the environment you are working in.

## Generate User Access Token API

> To generate a User Access Token, the user must provide their username (email) and the password configured during the account activation process. This access token is necessary for interacting with the member's secret management APIs. The access token has an expiry of 180 days. Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"User APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/user/token/generate":{"post":{"tags":["User APIs"],"summary":"Generate User Access Token API","description":"To generate a User Access Token, the user must provide their username (email) and the password configured during the account activation process. This access token is necessary for interacting with the member's secret management APIs. The access token has an expiry of 180 days. Below is the API specification.\n","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"User email."},"password":{"type":"string","description":"The password associated with the user."}},"required":["username","password"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"TokenResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"accessToken":{"type":"string"},"expiresIn":{"type":"integer"},"tokenType":{"type":"string"}}}}}}
```

## Read Secret API

> The Read Secret API enables admin to retrieve the current secret for a specific member. To access this information, a user access token with administrative rights must be provided. Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/secret/read":{"post":{"tags":["Entity APIs"],"summary":"Read Secret API","description":"The Read Secret API enables admin to retrieve the current secret for a specific member. To access this information, a user access token with administrative rights must be provided. Below is the API specification.\n","parameters":[{"name":"Authorization","in":"header","required":true,"description":"User Bearer token for authorization","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretReadRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretReadResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"EntitySecretReadRequest":{"type":"object","required":["entityId"],"properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"}}},"EntitySecretReadResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secret":{"type":"string"},"expiresOn":{"type":"number"},"expirationDate":{"type":"string"},"oldSecretValidity":{"type":"number"},"oldSecretExpirationDate":{"type":"string"}}}}}}
```

## Reset Secret API

> The Reset Secret API is used to reset the entity’s secret.  To perform this action, a user access token with administrative privileges must be provided.  Once reset, the generated secret will have a validity period (default and max value of 180 days) as specified in the request payload.  The SPOC will have to ensure that it is renewed well before the expiry.\
> An entity’s secret can be reset up to 5 times per day. There will be a waiting period of 5 mins applied after each reset API call.\
> Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/secret/reset":{"post":{"tags":["Entity APIs"],"summary":"Reset Secret API","description":"The Reset Secret API is used to reset the entity’s secret.  To perform this action, a user access token with administrative privileges must be provided.  Once reset, the generated secret will have a validity period (default and max value of 180 days) as specified in the request payload.  The SPOC will have to ensure that it is renewed well before the expiry.\nAn entity’s secret can be reset up to 5 times per day. There will be a waiting period of 5 mins applied after each reset API call.\nBelow is the API specification.\n","parameters":[{"name":"Authorization","in":"header","required":true,"description":"User Bearer token for authorization","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretResetRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretResetResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"EntitySecretResetRequest":{"type":"object","required":["entityId"],"properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secretExpiryDays":{"type":"integer","description":"Specifies the number of days before the secret expires. This field is optional; if not provided, a default value will be used."},"oldSecretValidity":{"type":"integer","description":"Specifies the number of days (a max of 7) for which the previous secret remains valid.  The old and new secret, both, can be used to generate token during this period.  This field is optional. If not provided or set to 0, the old secret will be invalidated immediately.   We advise the REs to use this judiciously."}}},"EntitySecretResetResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secret":{"type":"string"},"expiresOn":{"type":"number"},"expirationDate":{"type":"string"},"oldSecretValidity":{"type":"number"}}}}}}
```

## Generate Entity Access Token API

> To generate a Member (Entity) Access Token, the client ID and Secret are required. The API generates the token with a warning if the secret is within the grace period, but it will fail once the grace period has ended. This token is used for interactions with other members and has a validity of 24 hours. The API specification is detailed below.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/token/generate":{"post":{"tags":["Entity APIs"],"summary":"Generate Entity Access Token API","description":"To generate a Member (Entity) Access Token, the client ID and Secret are required. The API generates the token with a warning if the secret is within the grace period, but it will fail once the grace period has ended. This token is used for interactions with other members and has a validity of 24 hours. The API specification is detailed below.\n","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The entity ID."},"secret":{"type":"string","description":"The secret associated with the entity."}},"required":["id","secret"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"TokenResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"accessToken":{"type":"string"},"expiresIn":{"type":"integer"},"tokenType":{"type":"string"}}}}}}
```

## Token Generation APIs:

#### API Postman Collection:&#x20;

{% hint style="info" %}
We recommend you to use below postman collection to try out our Token-Service\[IAM] APIs
{% endhint %}

{% file src="/files/LrPZkvetWRM9Un9XGz41" %}

## Member Secret Management APIs

#### API Collection:

{% file src="/files/nymDUvFE3Ay3pAtIgcs4" %}
Token-Service\[IAM] - API Collection
{% endfile %}


# FAQ Token Service

Frequently asked questions on Sahamati’s Token Service, covering token types, token generation, rate limits, error responses and Entity Secret rotation.

**Q: What is the Token Service (IAM)?**\
Sahamati's Token Service issues short-lived JWT access tokens. Its APIs include token generation and secret management.

**Q: Is the Token Generation API the same as the IAM API?**\
Yes. The Token Generation APIs are the same as the IAM (Token Service) APIs. In this document, we will refer to these APIs as the Token Service APIs. They include the following APIs:

* User Access Token Generation
* Entity Token Generation
* Secret Read
* Secret Reset

**Q: What are the primary types of tokens available?**\
There are two types of tokens

* User Access Token: Generated using email ID and password; used in secret management APIs.
* Entity Access Token: Generated using Secret and Entity ID; used in AA Ecosystem APIs published by ReBIT.

**Q: What are the validity periods for each token type?**\
User Access Token: 180 days. Entity Access Token: 24 hours.

**Q: What happens when the secret expires?**\
The Entity Token Generation API (Token Service) no longer accepts the expired secret, except when the *OldSecretValidity* parameter is set to a non-zero value in the next Secret Reset API call (Secret Transition). The new secret is to be used for generating Entity tokens. However, the old secret can be used for generating Entity tokens for *OldSecretValidity* days if it was set.

**Q: Who is responsible for managing the Entity Secret for Entity Token issuance in RE's organization?**\
The AA Program SPOC from RE's organization manages the Secret with the help of the Secret Read and Reset APIs provided by Sahamati <https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/spoc-roles-and-responsibilities>

**Q: Will the existing/active tokens be revoked or invalidated when the associated secret is rotated?**\
Yes, existing/active entity tokens will remain valid until their expiry. An Entity token is valid for 24 hours.

**Q: What are the expected HTTP status code and response body/error response returned in the following scenarios?**

<table><thead><tr><th width="199.6666259765625">API Name</th><th width="192">Scenario</th><th>HTTP Status Code</th><th>HTTP Status Message</th></tr></thead><tbody><tr><td>Central Registry:<br>• Get Entities by Type API<br>• Get Entity by Type and ID API</td><td>• Expired Entity Access Token<br>• Invalid Entity Access Token</td><td>401</td><td>Unauthorized or Invalid Token</td></tr><tr><td>Token Service:<br>Generate Entity Access Token API</td><td>• Expired or Invalid Secret<br>• Invalid Entity ID</td><td>401</td><td>Unauthorized</td></tr><tr><td>• Generate Entity Access Token API<br>• Generate User Access Token API<br>• Entity Secret Read API<br>• Entity Secret Reset API<br>• CR - Get Entities by Type API<br>• CR - Get Entity by Type and ID API<br>• Saans Push API</td><td>Whenever the corresponding configured API request rate limit threshold has been exceeded for these specific APIs</td><td>429</td><td>HTTP Too Many Requests</td></tr></tbody></table>

For further details, kindly refer <https://developer.sahamati.org.in/token-service/apis>

### Entity Token Generation

**Q: What are the prerequisites for generating a User Access Token?**\
The AA Program SPOC's registered email and the password configured at Entity Onboarding (see <https://membersuccess.sahamati.org.in/member-services/cr-onboarding-guide/what-happens-after-cr-onboarding>), called from your registered IPs.

**Q: Provide a complete cURL example for User Token generation**\
Kindly refer to the section ***Generate User Access Token API*** in the link <https://developer.sahamati.org.in/token-service/apis>

**Q: What are the prerequisites for generating an Entity Access Token?**\
Your Entity ID and your current Entity Secret: the one issued at Central Registry onboarding, or the latest one you generated through rotation

**Q: Provide a complete cURL example for Entity Token generation**\
Kindly refer to the section ***Generate Entity Access Token API*** in the link <https://developer.sahamati.org.in/token-service/apis>

**Q: What does a typical entity token response include?**\
Kindly refer to the section ***Generate Entity Access Token API*** in the link <https://developer.sahamati.org.in/token-service/apis>

**Q: How should I implement entity token expiration handling in my application?**\
Fetch a new entity token before the *expiresIn* parameter value elapses (e.g., every 24 hours for entity tokens).

**Q: Can I use Postman for token testing?**\
Yes. A Postman collection is available at <https://developer.sahamati.org.in/how-to-guides/token-service-apis-production>.

**Q: Is there any rate limit enforced for the API?**\
Yes, API request rate limits have been configured for the APIs below; whenever these limits are exceeded, an ***HTTP 429 Too Many Requests*** will be returned as part of HTTP response for the API request.

| API Description         | Current rate limits (per 24 hours) |
| ----------------------- | ---------------------------------- |
| Entity Token Generation | 300                                |
| User Token Generation   | 300                                |
| Entity Secret Read      | 300                                |
| Entity Secret Reset     | 5                                  |

**Q: What error codes might I encounter during token generation?**\
Kindly refer to the section ***Generate Entity Access Token API*** in the link <https://developer.sahamati.org.in/token-service/apis>

## Entity Secret Rotation

**Q: Is the Client Secret the same as the Entity Secret? NEW**\
Yes. Both terms refer to the same secret used with your Entity ID to generate Entity Access Tokens.

**Q: What is the Entity Secret Rotation policy?**\
Entity secrets expire every 180 days and must be rotated before expiry. Secret Rotation has been mandatory since October 2024. A custom expiry duration for the Secret can be set using the optional *secretExpiryDays* parameter (not more than 180 days) in the Reset Secret API. If this *secretExpiryDays* parameter is not set, it defaults to a maximum of 180 days. The old secret will be automatically revoked once its configured validity period expires. If the *Old Secret Validity Days parameter* is set to a non-zero value but up to 7 days maximum in the Reset Secret API, the old secret will be retained until the expiry of *Old Secret Validity Days* (for supporting Secret Transition). However, as of now, the API does not provide a way to read the old secret during the secret transition after generating a new secret.

**Q: Who is responsible for secret rotation in my organization?**\
The AA Program SPOC submitted by RE to Sahamati during Entity Onboarding. To change the SPOC, kindly write to <memberservices@sahamati.org.in>.

**Q: What are the mechanisms through which I can reset the secret?**\
Kindly refer <https://developer.sahamati.org.in/how-to-guides/how-to-rotate-entity-secret>

**Q: How do I check whether my secret needs rotation?**\
2 options available

* Log in to <https://data.sahamati.org.in/self-service/check-secret-status> with your Entity ID and secret to see its expiry date.
* Via the Read Secret API. Kindly refer to the section ***Read Secret API*** *in this link* <https://developer.sahamati.org.in/token-service/apis>

**Q: Can the secret APIs be called from any network?**\
No. They must be called from your entity's network IPs registered (whitelisted during onboarding) with Sahamati.

**Q: What should I do before resetting the secret?**\
Ensure your technical team is ready to deploy the new secret immediately after the reset. If *Old Secret Validity Days (for supporting secret transition)* is set to 0, the old secret expires immediately; otherwise, update the new secret across all systems before the Old *Secret Validity Days* period ends.

**Q: Can I specify a custom validity period for the new secret?**\
Yes, via the optional *secretExpiryDays* parameter (not more than 180 days). If this parameter is not set, it defaults to a maximum of 180 days.

**Q: What is the response format for a successful secret reset?**\
Kindly refer to the section ***Reset Secret API*** in the link <https://developer.sahamati.org.in/token-service/apis>

**Q: Will my old secrets be automatically revoked?**\
Yes. The old secret will be automatically revoked once its configured validity period expires. If the *Old Secret Validity Days parameter* is set to a non-zero value but up to 7 days maximum in the Reset Secret API, the old secret will be retained until the expiry of *Old Secret Validity Days*. However, the API does not currently provide a way to read the old secret during the secret transition after generating a new secret.

**Q: What happens if I don't rotate my secret before expiration?**\
The Entity token generation API would return HTTP status 401 Unauthorized when the expired secret is used to generate entity tokens. So, it is highly recommended to rotate the secret well before it expires.


# Release Calendar

## AA Ecosystem Release Calendar by Sahamati

The Release Calendar outlines the updates and improvements introduced by Sahamati in the common services provided to the Account Aggregator (AA) ecosystem. It highlights key feature deployments and their scheduled timelines for both UAT and Production environments, enabling participants to stay aligned with regulatory and ecosystem-related enhancements. By adhering to the deployment dates, participants can seamlessly integrate these updates into their own release cycles, ensuring they stay up to date with the evolving changes.

**2024 - Q4**

<table data-full-width="true"><thead><tr><th width="204">Release Item</th><th>Description</th><th>Details</th></tr></thead><tbody><tr><td><strong>Customisable Client Secret Expiry Duration</strong></td><td>Ecosystem members can specify the expiry duration for secrets' rotation within regulator-defined boundaries.</td><td>Members can set expiry duration value via the API request, with a default value of 180 days or a customised value using the <strong><code>secretExpiryDays</code></strong> parameter defined by the entity itself.</td></tr><tr><td><strong>Grace Period for Expired Secrets</strong></td><td>A grace period allows access token generation with expired secrets, accompanied by a warning.</td><td>Tokens can still be generated during the 5-day grace period after expiry, with a warning that the secret has expired.</td></tr><tr><td><strong>Error Reduction in Automated Secret Reset</strong></td><td>Changes to reduce errors in the automated secret reset process, even if environment configurations change.</td><td>Reduces errors during the secret reset process, ensuring compatibility with updated expiry durations or other configuration changes.</td></tr><tr><td><strong>Human Readable Expiry Date Format</strong></td><td>The expiry date is now visible in a human-readable ISO format.</td><td>The expiry date is now provided in the response attribute <strong><code>expirationDate</code></strong> along with <code>expiresOn</code> in the secret API, formatted in an easily readable ISO format.</td></tr></tbody></table>

For detailed information on the API changes, do refer to the API documentation [link here](https://developer.sahamati.org.in/technical-specifications/identity-and-access-management#member-secret-management-apis)

**2024 - Q3**

<table><thead><tr><th width="415">Description</th><th width="147">UAT Status</th><th width="186">Production Status</th></tr></thead><tbody><tr><td><a href="https://developer.sahamati.org.in/release-calendar/deprecation-of-v1-api-endpoint-urls">Deprecation of V1 API Endpoint URLs in Base URL of Entities in Central Registry</a> </td><td>Deployed<br>(August 2024)</td><td>Deployed<br>(Oct 2024)</td></tr><tr><td><a href="https://developer.sahamati.org.in/release-calendar/client-secret-rotation">Client Secret Rotation for Participants in Token Service (Identity &#x26; Access Management)</a></td><td>Deployed<br>(August 2024)</td><td>Deployed<br>(Oct 2024)</td></tr><tr><td><a href="https://developer.sahamati.org.in/release-calendar/deactivation-of-deprecated-v1-apis">Deactivation of deprecated V1 APIs of Central Registry</a></td><td>Deployed<br>(July 2024)</td><td>Deployed<br>(Oct 2024)</td></tr></tbody></table>

**Update on Client Secret Rotation:**

Based on the UAT feedback regarding client secret rotation, we will be updating the validity period for newly generated tokens to 180 days. As a result, the planned deployment, **originally scheduled for 3rd October 2024, has been deployed on 16th October 2024**, following the next round of UAT.

The next release will also include changes that allow entities to parameterise and configure the expiry period themselves, based on their respective regulatory guidelines.


# Deprecation of V1 API Endpoint URLs

This is to inform all participants of the Account Aggregator (AA) ecosystem about the deprecation of the ReBIT API V1 in the Central Registry and the necessary steps for transitioning to the V2 API.

### Key Updates:

* **Deprecation of ReBIT API V1:**\
  As per the notification from ReBIT on 12th May 2024, the ReBIT V1 API has been officially deprecated. All ecosystem participants, including FIPs, FIUs, and AAs, must complete their transition to the ReBIT V2 API by 30th June 2024.
* **For Participants Using V1:**\
  You are required to update your API Endpoint URLs to V2 in the Central Registry. Please share your V2 endpoint details with the Sahamati Services team.
* **For Participants Supporting Both V1 and V2:**\
  To ensure a smooth transition, it is recommended to deprecate the V1 endpoint URL by updating it to **/v1/nonexistent-resource** in the Central Registry. This will signal to users that the V1 endpoint is no longer valid, ensuring they switch to V2 seamlessly.
* **Best Practices:**\
  As a best practice, participants should refresh the Entities Endpoint URL from the Central Registry daily. This ensures that any updates made by other participants transitioning to V2 are reflected in your system, helping avoid miscommunication or errors.

### Implementation Timelines:

* The ReBIT V1 API deadline has already passed. Participants must ensure that their V1 API Base URLs are updated in the Central Registry to V2 to avoid disruptions.

### Action Required:

* **Update your Base URLs**\
  Please reach out to **<services@sahamati.org.in>** to update your application Endpoint Base URLs from V1 to V2 in the Central Registry.


# Client Secret Rotation

This is to inform all participants in the Account Aggregator (AA) ecosystem about the new Client Secret Rotation policy, following the recommendations from market participants.

### Key Updates

* **Best Practice Recommendation:**\
  Following feedback from market participants, it was recommended that the Client Secret Token used for authentication of Token Service should be rotated periodically to enhance security and mitigate risks related to token misuse or compromise.
* **Current Observations:**\
  A substantial number of participants have not rotated the Client Secret provided during their initial onboarding with the Central Registry (CR). To address this, Sahamati is introducing a Client Secret Rotation feature that enables participants to rotate their secrets efficiently and securely.
* **Designated Authorised Users:**\
  Each participant organisation must designate an authorised user who will be responsible for managing the Client Secret rotation. This user will be onboarded into the **Token Service (Identity & Access Management)** and tasked with rotating the secret using new APIs. The SPOC (Single Point of Contact) must also ensure that the newly generated secret token is securely integrated into their organisation's systems. It is recommended to use a **service account email** associated with the **participant organisation.** This ensures the account remains under the organisation's control for long-term management, providing consistency and seamless operation over time.
* **Secret Token Expiration:**\
  Moving forward, Client Secret Tokens set by Entities will expire every 180 days. All participants are required to rotate their Client Secrets before the expiration date to ensure uninterrupted access to the network. This regular rotation is essential to maintaining the security of the AA ecosystem.

### Implementation Timelines

* **UAT Environment:**\
  The Client Secret Rotation feature is now live in the UAT environment, allowing participants to begin testing the process immediately.
* **Production Environment:**\
  The feature is now available in the Production environment post deployment on 16th October 2024.

### Action Required

1. **Onboard Your Designated User:**\
   Each participant must onboard a designated user to the Central Registry, ensuring they are responsible for secret rotations. You can share the designated user's details, along with your current entity information in the Central Registry, with **<services@sahamati.org.in>**.
2. **Generate and Rotate Client Secrets:**\
   Once the designated user is onboarded by Sahamati, they will receive an email to set a password. Using this email and the newly set password, the designated user can generate a user token for the **Token Service (IAM)** through [User Token Generate API](https://developer.sahamati.org.in/technical-specifications/identity-and-access-management#user-token-generate). They can retrieve the existing secret using the[ Secret - Read API ](https://developer.sahamati.org.in/technical-specifications/identity-and-access-management#entity-secret-read)and reset it using the [Secret - Reset API](https://developer.sahamati.org.in/technical-specifications/identity-and-access-management#entity-secret-reset) to generate a new client secret. The new secret should be rotated into your application. Please refer to the [API documentation](https://developer.sahamati.org.in/technical-specifications/identity-and-access-management) for further details.
3. **Update Systems for Token Expiration:**\
   Ensure that your systems and applications are prepared to handle the periodic 180-day token expiration. Implement a token rotation mechanism using the new APIs to automate this process.
4. **Manual Rotation Option:**\
   If automation is not yet ready, you can still rotate the token manually by directly calling Sahamati’s API.

Please ensure these changes are incorporated into your applications and processes by the given deadlines to maintain uninterrupted access to the AA ecosystem.

**Update on Client Secret Rotation:**

Based on feedback from UAT on client secret rotation, we have extended the validity period for newly generated tokens to **180 days**. Consequently, the deployment, initially scheduled for 3rd October 2024, was completed on **16th October 2024**.

Please note that there will be **NO automatic expiration** of existing secret tokens in the Central Registry. Entities must **initiate and set** the expiration themselves, using the process outlined above.

In the upcoming release, entities will also be able to **parameterise and configure** the expiry period of their secrets, in line with their specific regulatory guidelines.


# Deactivation of Deprecated V1 APIs

As part of Sahamati’s ongoing enhancements, the Central Registry APIs have transitioned to Version 2 (V2), following the ReBIT V2 standard. The V2 APIs upgrades done in Jan 2024 are aimed to improve the discovery of entities and streamline the retrieval of endpoints and certificates.

&#x20;The v1 APIs of Central Registry had been deprecated since Jan 2024.

### Key Update:

* **Transition to V2 APIs:**\
  While most ecosystem participants have successfully migrated to the V2 APIs of Central Registry, some are still using the now deprecated V1 APIs. To enforce this transition, V1 APIs are scheduled for decommissioning with this release.&#x20;
* **Impact on V1 API Users:**\
  Starting from the decommissioning date, any requests made to the deprecated V1 APIs will return a 410 HTTP Status Code, indicating that the requested resource is no longer available and that users must switch to the V2 endpoint.

### Implementation Timelines:

* **UAT Environment:**\
  These changes have already been deployed in the UAT environment.
* **Production Environment:**\
  The decommissioning will take effect in the Production environment post deployment in October 2024.

### Action Required:

* **For Participants Still Using V1 APIs:**\
  If you are among the participants still using the V1 API to access the Central Registry, you need to transition to the V2 APIs of Central Registry immediately.\
  Any attempt to use the V1 version after decommissioning will result in a 410 HTTP response code.
* **Update your application** accordingly to ensure compatibility with the V2 APIs.


# Onboarding to Saans

Saans stands for “Swasthya of AA Network as a Service”.

This AA API health dashboard service aims to provide a transparent view into the real-time health of “Live” AA APIs offered by each network participant.

#### How does Saans v1.0.0 work? <a href="#h-how-does-saans-v1-0-0-work" id="h-how-does-saans-v1-0-0-work"></a>

Saans is based on AAs streaming real-time statistically-derived health metrics of each FIP to a central time-series database managed by Sahamati, for the community.

Each AA computes these real-time metrics by summarising individual request-response health signals, typically over a duration of 10 minutes, and then applying appropriate statistical measures on the aggregate (such as percentile functions).

Saans collects such statistical measures from each live AA. It then further applies a statistical interpretation across all the health signals thus collected, to provide an “aggregated” view of the health of each API.

#### Does Saans provide an AA-wise view of the health measured? <a href="#h-does-saans-provide-an-aa-wise-view-of-the-health-measured" id="h-does-saans-provide-an-aa-wise-view-of-the-health-measured"></a>

No. Saans aggregates health signals from all the AAs into a common database. It then treats each signal received as equally representative of an FIP’s health. A statistical measure is applied across all the signals collected over time. There is no way to filter signals by AA once it is aggregated into the common database.

We have no reason to believe that an FIP’s health will show up as significantly different between one AA and the other – given the standard protocol followed in the AA specs for AA-FIP integration.

#### Does Saans collect counts of transactions or individual transaction details from AAs?

No. Saans only collects summaries of health metrics from AAs, by design. It does not collect counts or individual transaction details from AAs.

#### What are the health metrics that Saans v1.0.0 collects and presents? <a href="#h-what-are-the-health-metrics-that-saans-v1-0-0-collects-and-presents" id="h-what-are-the-health-metrics-that-saans-v1-0-0-collects-and-presents"></a>

In the first version of Saans (v1.0.0), it offers a transparent view of the health of each FIP’s APIs’ health, plotted as two dashboards.

#### **What are the metrics covered under AA SLAs?**

Draft [AA SLAs v0.9.1](https://sahamati.org.in/wp-content/uploads/2023/06/AA-Ecosystem-SLAs_-Version-0.9.1-draft-07-04-23.pdf) can be found here for all AA network participants.

#### What are the APIs hosted by the FIPs? <a href="#h-what-are-the-apis-hosted-by-the-fips" id="h-what-are-the-apis-hosted-by-the-fips"></a>

FIPs host the following APIs, and Saans provides the performance indicators for these APIs:

* Consent Post Response: Used by AAs to send a copy of signed consent to the FIP
* FI Fetch Response: Used by AA to receive the encrypted data from the FIP
* FI Request Response: Used by the AA to request the encrypted FI Data
* User Confirm LInking Response: Used by AAs to submit the linking OTPs the customer received from the FIP
* User Discovery Response: AAs pass the identifier and FIP returns the list of masked account numbers
* User Linking Response: This is used by AAs to communicate with the FIP about the intent of the customer to link their account.
* User UnLinking Response: Used by AAs to notify the FIP about the act of delinking of accounts of the customer


# Publish Data to Sahamati

How is data to be created by the AA:

AAs are expected to report two forms of data called events:

* Each synchronous API call such as FIP Discovery, FIP Linking, FI request etc. are to be reported every 10 min. .
* Async functions such as FI notifications for FIPs are to be reported every 10 mins

Each report is referred to as signals. Signals contain multiple events- Sync API call data aggregated every 10 mins for each FIP.

For Sync API:

**NOTE**: If there are no events that take place in the 10 min duration for an API , do not send a signal. It can be completely omitted. Do not send 0 or any value other than null if you do not have the data. Sending 0 will skew the charts.

**Base URL**

```
https://api.sahamati.org.in/saans/v1/push
```

**Error Codes**

| Type             | Status    | Action                      |
| ---------------- | --------- | --------------------------- |
| Authentication   | 401       | Refresh token               |
| Validation       | 400       | Fix request payload         |
| External Service | 400 / 500 | Retry / Disable integration |
| Internal Error   | 500       | Restart service             |

<br>


# Push metric

### Input Parameters

| Parameter                                                                | Description                                                                                                                                                                                                   |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aa\_id                                                                   | entity ID (Same as CR entry)                                                                                                                                                                                  |
| timestamp                                                                | The date and time when the events occurred. The format must follow ISO 8601 (YYYY-MM-DDTHH:MM:SS.mmmZ).                                                                                                       |
| headers                                                                  | The headers of the events data.                                                                                                                                                                               |
| events                                                                   | <p>FIP:AA:UserDiscoveryResponse - User account discover API call                                                                                                                                              |
| <br>FIP:AA:UserLinkingResponse - Account linking API call                |                                                                                                                                                                                                               |
| <br>FIP:AA:UserConfirmLinkingResponse - Confirm Account linking API call |                                                                                                                                                                                                               |
| <br>FIP:AA:ConsentPostResponse - Consent creation API call               |                                                                                                                                                                                                               |
| <br>FIP:AA:FIRequestResponse - FI data request creation API call         |                                                                                                                                                                                                               |
| <br>FIP:AA:FIFetchResponse - Get FI data API call                        |                                                                                                                                                                                                               |
| <br>FIP:AA:UserUnLinkingResponse - User unlinking API call</p>           |                                                                                                                                                                                                               |
| fip\_id                                                                  | The unique identifier for the financial information provider (FIP) that generated the event.                                                                                                                  |
| latency\_avg\_ms                                                         | The average latency for the event, in milliseconds.                                                                                                                                                           |
| success\_percent                                                         | The percentage of successful API calls made in that 10 min time period. Exclude 4xx errors from the total number of API calls when reporting.                                                                 |
| timeout\_percent                                                         | The percentage of API Calls that take longer than 30 seconds to respond.                                                                                                                                      |
| notfound\_percent                                                        | The percentage of events that resulted in a "not found" error. This will be passed ONLY for the discover API. Percent of 404 status codes. For the rest of the events it should be ‘null’                     |
| server\_error\_percent                                                   | The percentage of events that resulted in a server error.                                                                                                                                                     |
| client\_error\_percent                                                   | The percentage of events that resulted in a client error. Exclude 404 error for discover API event (since 404 is being counted as notfound\_percent)                                                          |
| latencyP99\_ms                                                           | Lets say the AA made 100 calls to an FIP in the past 10 mins. Arrange the response times for these calls in ascending order and share the 99th percentile response time(i.e. 99th response time in this case) |
| latencyP95\_ms                                                           | Lets say the AA made 100 calls to an FIP in the past 10 mins. Arrange the response times for these calls in ascending order and share the 95th percentile response time(i.e. 95th response time in this case) |
| latencyP50\_ms                                                           | Lets say the AA made 100 calls to an FIP in the past 10 mins. Arrange the response times for these calls in ascending order and share the 50th percentile response time(i.e. 50thresponse time in this case)  |


# Push notification metric

For FI notifications,

The event is setup with the name: FIP:AA:FINotificationResponse

Default to null wherever the metric is not applicable.

### Input Parameters

| Parameter                  | Description                                                                                                                                                                                                                                                                 |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aa\_id                     | entity ID (Same as CR entry)                                                                                                                                                                                                                                                |
| timestamp                  | The date and time when the events occurred. The format must follow ISO 8601 (YYYY-MM-DDTHH:MM:SS.mmmZ).                                                                                                                                                                     |
| headers                    | The headers of the events data.                                                                                                                                                                                                                                             |
| fip\_id                    | The unique identifier for the financial information provider (FIP) that generated the event.                                                                                                                                                                                |
| notification\_event\_name  | The name of the notification event.: FIP:AA:FINotificationResponse                                                                                                                                                                                                          |
| success\_response\_percent | The percentage of FI Request calls for which the FI Notification is received and FI Status is marked as Ready. That is, total number of success notifications by total number of notifications received in the last 10 min.                                                 |
| failure\_response\_percent | The percentage of FI Request calls for which the FI Notification is received and FI Status is marked as DENIED or TIMEOUT. That is, total number of failure notifications by total number of notifications received in the last 10 min.                                     |
| no\_response\_percent      | The percentage of FI Request calls for which the FI Notification is not received. That is, total number of notifications received per FIP by total number of data requests created per FIP. NOTE: This metric is sent only once in 24hrs at midnight. It is null otherwise. |
| latency\_avg\_ms           | Average time taken between receiving 200 OK and FI Notification across all transactions                                                                                                                                                                                     |
| latencyP99\_ms             | 99th percentile of time taken between 200 OK and FI Notification, calculated from all values recorded in the time window.                                                                                                                                                   |
| latencyP95\_ms             | 95th percentile of time taken between 200 OK and FI Notification, calculated from all values recorded in the time window                                                                                                                                                    |
| latencyP50\_ms             | 50th percentile of time taken between 200 OK and FI Notification, calculated from all values recorded in the time window.                                                                                                                                                   |

Note: Latency should be calculated using the FI Notification in which all associated FIStatus entries have reached terminal states (**READY**, **DENIED**, or **TIMEOUT**), while excluding notifications that contain accounts still in transient states such as **DELIVERED** or **PENDING**.


# Access Aggregated Data from Sahamati

## FIP Health API V1.0.0

### Introduction

FIUs want to access SAANS Data during their user journeys. This allows them to manage the user expectations and Lending FIUgate the user through the AA flow depending upon the health status of the APIs. This could lead to a higher success percentage by only raising a consent request when the likelihood of the consent's success is much higher.

### Target Users

* FIUs
* AA Client apps
* FIP Health monitoring systems
* Real-time alert systems - both central and FIP specific

### How the solution works

The solution requires a system that can identify FIUs that have subscribed to the service. These FIUs will expose endpoints that receive data from the API on a 30 min frequency. This data will be calculated based on the performance of FIP over the last 30 min. The data will be pushed to the exposed endpoint.

### API Broad Specs

API Specs: [View Specs](https://github.com/Sahamati/FIP-Health-API-Specs/blob/main/Health%20API%20Specs.json)

Sample JSON: [View Sample](https://github.com/Sahamati/FIP-Health-API-Specs/blob/main/Sample%20response.json)

SLAs: [View SLAs](https://docs.google.com/spreadsheets/d/1T4qzwGPfqCxM-910HTZDkkikEezxUrU1/edit?usp=sharing\&ouid=102688648237312172000\&rtpof=true\&sd=true)

\
**Status Criteria**&#x20;

The status value is derived from two metrics, Success % and P50 Latency, using the following logic:

| Status   | Condition                                                       |
| -------- | --------------------------------------------------------------- |
| `GOOD`   | `Success %` **> 95%** AND `P50 Latency` **< 5000 ms**           |
| `BAD`    | `Success %`**≤ 95%** OR `P50 Latency`**≥ 5000 ms**              |
| `UNSURE` | No data available or metrics are incomplete for the time window |


# How to access the SAANS API

1. **Create a public endpoint:** Set up an endpoint to receive notifications from the SAANS Health API service as per the specs mentioned below.
2. **Whitelist IPs on your Firewall:** Whitelist the following IP addresses on your Firewall:
   * "20.204.209.246"
   * "13.71.48.89"
3. **Authenticate the Request:** To further authenticate the request from the SAANS health API:
   * The API sends an `Authorization` header in the request with a bearer token.
   * Validate the token with the Sahamati token service’s public certificate. The validation works same way as the signing of the API request body in the AA Specs
   * Refer to [this guide](https://github.com/Sahamati/FIP-Health-API-Specs/blob/main/Release%20Note.md#link-to-validation-guide) for instructions on validating JWT with a public key.
4. **Fill in the Form:** Complete the information in the following form: [Form Link](https://forms.gle/F3fhxHzQzeEZUKBx6)
5. After filling the form send email to <memberservices@sahamati.org.in>
6. **Deploy on your endpoint:** You will start receiving notifications on your configured endpoint on a T+1 basis.


# FAQ SaaNs

Frequently asked questions on Saans, Sahamati’s FIP API health monitoring service, covering onboarding, data publishing, signals, data access and rate limits.

**Q: What is Saans, and why is it important?**\
Saans (Swasthya of AA Network as a Service) is Sahamati's dashboard for FIP API health in real-time, built from metrics reported by AAs. Kindly refer [Onboarding to Saans | SahamatiNet](https://developer.sahamati.org.in/onboarding-to-saans) for more information.

**Q: How does Saans data collection work?**\
Each AA summarises request/response signals over 10-minute windows into percentiles and pushes them to Sahamati, which aggregates across all AAs.

**Q: Which FIP APIs does Saans monitor?**\
Consent Post, FI Request, FI Fetch, Account Discovery, Account Linking, Confirm Linking, and Delinking.

**Q: What is the Saans onboarding process?**\
Expose a public endpoint, whitelist 20.204.209.246 and 13.71.48.89, validate JWTs with Sahamati's certificate, and submit the onboarding form to <memberservices@sahamati.org.in>. Notifications start T+1.

**Q: What data should AAs publish to Saans?**\
Synchronous API metrics (discovery, linking, FI request) per FIP and asynchronous FI notification metrics, each every 10 minutes.

**Q: What are signals and events in Saans?**\
A signal aggregates all events for one FIP in a 10-minute window. If there were no events, skip the signal.

**Q: How can I access aggregated health data from Saans?**\
Through the SAANS API (see How to access the SAANS API on the developer portal); your registered endpoint also receives FIP health notifications.

**Q: Does Saans share individual FIP data across AAs?**\
No. Signals from all AAs are pooled and cannot be filtered by AA.

**Q: Does Saans collect transaction counts or transaction details?**\
No. Saans collects only summarised health metrics, never counts or individual transactions.

**Q: Is there any rate limit on the Saans API that AAs use to publish data?**\
Yes, 300 requests per 24 hours; beyond that, the API returns HTTP 429.


# Glossary

**Member / Entity**

* **Definition**: Refers to a Financial Information User (FIU), Financial Information Provider (FIP), or Account Aggregator (AA) within the Account Aggregator ecosystem and Sahamati Network.


# Guidelines

* [Security Standards](https://sahamati.gitbook.io/security-standards/layered-security)
* [AA Redirection Guidelines](https://sahamati.gitbook.io/aa-redirection-guidelines)
* [AA Common Service](https://sahamati.gitbook.io/aa-common-service)


# Frequently Asked Questions

This FAQ section summarises the key technical aspects of the Sahamati Services.

## Sahamati Service-Specific FAQs

<table data-card-size="large" data-view="cards"><thead><tr><th data-type="content-ref"></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><a href="https://developer.sahamati.org.in/central-registry/faq-central-registry">FAQ Central Registry</a></td><td>Frequently asked questions on the Sahamati Central Registry, covering listing requirements, entity metadata, access control, API endpoints and rate limits.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FXIksMES9KnKkXounhl54%2FCentral%20Registry%401x.png?alt=media&amp;token=8d4422ee-df1e-453f-8118-61ba4066d0dd">Central Registry@1x.png</a></td></tr><tr><td><a href="https://developer.sahamati.org.in/token-service/faq-token-service">FAQ Token Service</a></td><td>Frequently asked questions on Sahamati’s Token Service, covering token types, token generation, rate limits, error responses and Entity Secret rotation.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2F28MX3B018bRksIYwPJUw%2FToken%20Service%401x.png?alt=media&amp;token=bd60366f-a2c5-4b2f-9f98-8c7d4df0457f">Token Service@1x.png</a></td></tr></tbody></table>

<table data-card-size="large" data-view="cards"><thead><tr><th data-type="content-ref"></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><a href="https://developer.sahamati.org.in/onboarding-to-saans/faq-saans">FAQ SaaNs</a></td><td>Frequently asked questions on Saans, Sahamati’s FIP API health monitoring service, covering onboarding, data publishing, signals, data access and rate limits.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FZxBJZmQFxP1NruPcUrw0%2FSaaNs%401x.png?alt=media&amp;token=6ec27e1a-1ab8-4475-8721-5451857784dc">SaaNs@1x.png</a></td></tr><tr><td><a href="https://developer.sahamati.org.in/sahamatinet-agent-sna/faq-sna">FAQ SNA</a></td><td>Frequently asked questions on the SahamatiNet Agent (SNA), covering deployment, data sharing, resource requirements, troubleshooting, logs and error handling.</td><td><a href="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FycFn0c8UTp6gXRVrfL2w%2FSNA%20(SahamatiNet%20Agent)%401x.png?alt=media&amp;token=83d11907-5b84-41c8-b08a-da4083d9d700">SNA (SahamatiNet Agent)@1x.png</a></td></tr></tbody></table>

## General

**Q: Where can I monitor the status of various Sahamati applications?**\
Live status is available at <https://uptime.sahamati.org.in/status/sahamati-api-status>.

## Environments and Testing

**Q: What are the base URLs for each environment?**\
Token Service: api.sandbox.sahamati.org.in, api.uat.sahamati.org.in, api.sahamati.org.in. Central Registry: api.sandbox.sahamati.org.in/cr, uatcr.sahamati.org.in, cr.sahamati.org.in.

**Q: How can I onboard an entity in the UAT environment?**\
Through the AA Commons self-service portal at <https://id.sahamati.org.in/>.

## Integration Steps & Best Practices

**Q: What is the recommended integration sequence?**

* Generate User Token
* Reset Secret
* Read Secret
* Generate Entity Token
* Fetch CR metadata
* Test ReBIT API flows
* Certify
* Get CR listing
* Then go live

**Q: Can I move directly from UAT to Production?**\
No. Movement to Production does not happen directly from UAT; Production has its own onboarding process. Kindly refer [Getting Started with Sahamati | Sahamati](https://membersuccess.sahamati.org.in/) for more information.

**Q: What are the environment endpoints?**

* Sandbox: api.sandbox.sahamati.org.in/iam, api.sandbox.sahamati.org.in/cr
* UAT: api.uat.sahamati.org.in/iam and api.uat.sahamati.org.in/cr

**Q: What data should I use in UAT vs production?**\
UAT must use only dummy data, with no PII or real or replica accounts. Real customer data belongs only in Production.

**Q: How should I handle API errors?**\
Handle each HTTP status, log error bodies with the txnId, and retry with exponential backoff.

**Q: What support is available during integration?**\
Kindly write to <memberservices@sahamati.org.in> for onboarding and technical queries.

## Key Contacts & Resources

**Member Services** (Central Registry *- Onboarding/Offboarding* and Token Service, Technical queries, SPOC changes, Secret Rotation, Saans)**:** <memberservices@sahamati.org.in>

**Developer portal:** <https://developer.sahamati.org.in>

**Self Service Portal:** <https://data.sahamati.org.in/self-service/welcome>

**API status:** <https://uptime.sahamati.org.in/status/sahamati-api-status>


# How To Guides

This section offers simple instructions for performing essential tasks within the Sahamati ecosystem. These guides aim to help participants easily navigate and complete key technical processes

* [How To Onboard to Sandbox ? ](broken://pages/q324tDPwoXspKJHoocej)
* [How To Decide on an Entity ID ?](https://developer.sahamati.org.in/how-to-guides/do-not-use-old-format-how-to-decide-on-an-entity-id)
* [How To Create a Certificate ? ](https://developer.sahamati.org.in/how-to-guides/how-to-generate-a-certificate)
* [How To Generate Tokens ?](https://developer.sahamati.org.in/how-to-guides/how-to-generate-tokens)


# \[Do Not Use - Old Format] - How To Decide on an Entity ID ?

Note: This page is outdated. Please refer to the new Entity ID Naming Convention https\://membersuccess.sahamati.org.in/member-services/cr-pre-onboarding-guide/entity-id-naming-convention

**How To create or decide on an Entity ID value in the onboarding request ?**

* An **Entity ID** is a unique identifier that represents a specific entity such as an FIU (Financial Information User), AA (Account Aggregator), or FIP (Financial Information Provider). It should follow a clear, readable naming convention that helps identify the entity.
* Best practice for naming Entity IDs:\
  Use a suffix-based naming convention like:
  * **For FIUs: XYZ\_FIU**
  * **For AAs: ABC\_AA**
  * **For FIPs: AXBYCZ\_FIP**
* For Lower environments you can even add the environment name as well&#x20;
  * **For FIU : XYZ\_UAT\_FIU or XYX\_SANDBOX\_FIU**
  * **For AA : ABC\_UAT\_AA or ABC\_SANDBOX\_AA**
  * **For FIP : AXBYCZ\_UAT\_FIP or AXBYCZ\_SANDBOX\_FIP**
* Ensure that the Entity ID is a unique and easily recognisable name of the organisation that is getting onboarded. It can include letters, numbers, or symbols, but a simple and meaningful string is recommended.
* **Do note,** the above examples and recommendations **use an underscore** ( \_ ) as the **delimiter**. You **can also use hyphens** ( - ) if preferred.


# How To Generate a Certificate ?

**How to create a certificate using**[ **https://mkjwk.org/**](https://mkjwk.org/)

To generate a certificate, follow these steps:

* **Go to**[ **https://mkjwk.org/**](https://mkjwk.org/)
* **Select the required fields:**
  * **Key Use** (**use**): Choose sig (for signature).
  * **Algorithm** (**alg**): Select RS256 (RSA Signature with SHA-256).
  * **Key ID** (**kid**): This is a unique identifier for the key. You can enter any random string or a specific identifier that you would like to use.
  * **Key Type** (**kty**): RSA is recommended, so ensure RSA is selected.
  * **Modulus** (**n**): This will be automatically generated when you create the key.
  * **Exponent** (**e**): This will also be generated automatically.
* **Generate the Key Pair:**
  * Click the “**Generate**” button to create your public and private key pair. Make sure to save both the public and private keys securely as the private key will be required later for signing requests.
* **Validate the certificate**: Ensure the generated certificate contains the following properties:
  * **kty**: Key Type (e.g., RSA)
  * **e**: Exponent (e.g., AQAB)
  * **use**: Key Use (e.g., sig)
  * **kid**: Key ID (your unique key identifier)
  * **alg**: Algorithm (e.g., RS256)
  * **n**: Modulus (the base64 encoded string representing the modulus of the RSA key)

Example **json** output:

```
{
  "kty": "RSA",
  "e": "AQAB",
  "use": "sig",
  "kid": "<your-key-id>",
  "alg": "RS256",
  "n": "<your-modulus>"
}
```

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXepNbN8q89iGGbWnOQ38HCWdzAwIGEyz4rCiCK_J6kN_-YBpb48RDNSwCyygiMvok0NC7nKU9RkT0AnMPQR-4bHTBNA5v_iH4TqtVu-R5yrEJhKG6VuLX43gsy6A-UyoT-KZ1Q1AW5sB92UuD0btnH4lpnq?key=oovCSK4Ia9I56Bv9KLxKzQ" alt=""><figcaption></figcaption></figure>

Screenshot for your reference


# How To Generate Tokens ?

**How to generate and validate tokens using APIs (using curl)**

To generate and validate access tokens from Sahamati, here are sample curl commands for User Token and Entity Token APIs. It is recommended to use Postman for quicker and more efficient testing. However, the following curl commands are helpful for direct implementation within code.

**User Access Token API:**\
This API generates a token for a user (email/password-based authentication). To generate a User Access Token, the user must provide their username (email) and the password configured during the account activation process. **This access token is necessary for interacting with the member's secret management APIs**. The access token has an expiry of 24 hrs.

Example curl &#x20;

```
curl -X 'POST' \
  'https://api.sandbox.sahamati.org.in/iam/v1/user/token/generate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'username=<your-email>&password=<your-password>
```

**Entity Access Token API**:\
This API generates a token for an entity based on its ID and secret. The generation of a Member (Entity) Access Token requires the ID (client ID) and the Secret. **This access token is used for the interaction with other members**. The access token has an expiry of 24 hrs.

Example curl

```
curl -X 'POST' \
  'https://api.sandbox.sahamati.org.in/iam/v1/entity/token/generate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'id=<entityId>&secret=<entitySecret>'
```

Ensure you replace `<your-email>`, `<your-password>`, `<entityId>`, and `<entitySecret>` mentioned in above curl with actual values when running these commands.

**Postman Collection**:\
You can also download the [**Postman collection**](broken://pages/Ivx87BIb1DDfn2aAFskU#api-postman-collection) from the Sahamati developer portal. The Postman collection includes pre-configured API requests and is ideal for rapid testing and validation of token generation.


# How to Rotate Entity Secret

This is to inform all participants in the Account Aggregator (AA) ecosystem about the Client Secret Rotation policy that has been in existence since October 2024. The participants are mandated to implement this policy.

### Key Updates

* **Best Practice Recommendation:**\
  Following feedback from market participants, it was recommended that the Client Secret used for authentication on Token Service should be rotated periodically to enhance security and mitigate risks related to token misuse or compromise.
* **Current Observations:**\
  A substantial number of participants have not rotated the Client Secret provided during their initial onboarding with the Central Registry (CR). To address this, Sahamati provides a Client Secret Rotation feature that enables participants to rotate their secrets efficiently and securely.
* **Designated Authorised Users:**\
  Each participant organisation must designate an authorised user who will be responsible for managing the Client Secret rotation. This user will be onboarded into the **Token Service (Identity & Access Management)** and tasked with rotating the secret using APIs. The SPOC (Single Point of Contact) must also ensure that the newly generated secret token is securely integrated into their organisation's systems. It is recommended to use a **service account email** associated with the **participant organisation.** This ensures the account remains under the organisation's control for long-term management, providing consistency and seamless operation over time.
* **Secret Token Expiration:**\
  Client Secrets set by entities will expire every 180 days. All participants are required to rotate their Client Secrets before the expiration date to ensure uninterrupted access to the network. This regular rotation is essential to maintaining the security of the AA ecosystem.

### <mark style="color:$success;">Do I need to rotate my secret?</mark>

1. Before proceeding with the rotation steps, please verify whether your Entity Secret requires rotation.
2. You can log in to the [Check Secret Status](https://data.sahamati.org.in/self-service/check-secret-status) page using your Entity ID and Entity Secret to check the current secret expiry date.
3. If your secret is nearing expiry or has expired, you should proceed with rotating the secret.
4. If rotation is required, follow the steps below to rotate the secret either through the API method or through the Portal.

### Action Required

1. **Onboard Your Designated User:**\
   The "AA program SPOC" of your entity will be the "designated user" to rotate the secret. In case you want to update the SPOC, please reach out to **<memberservices@sahamati.org.in>**.

   Once the designated user is onboarded by Sahamati, they will receive an email to set a password.

2. **Generate and Rotate Entity Secrets:**

{% hint style="info" %}
**Important Note:** Before proceeding with the secret reset, ensure that your technical team is informed and prepared to update and start using the new secret in the system immediately after rotation.
{% endhint %}

### Rotating the Secret

There are two methods to rotate the secret. One is via the web portal (Method 1), and the other is using the API (Method 2).

#### Method 1: Rotate Secret Using the Portal

You can also rotate the entity secret directly through the portal.

1. Visit the Sahamati [Self Service Portal](https://data.sahamati.org.in/self-service/welcome)
2. Click on Login to Self Service Portal.&#x20;
3. Enter your Entity ID.
4. Enter the SPOC Email ID registered with the entity.
5. Enter the OTP received on the SPOC email ID.
6. Enter the SPOC Password to log in to the portal.

After logging in, navigate to the "**Reset Secret**" section and proceed with the Secret Rotation. Once the secret is rotated, copy the new secret from the “**View Secret**” section after the reset. Share the new secret with your technical team to update it in your system configuration.

#### Method 2: Rotate Secret Using API

{% hint style="info" %}
**Important Note:** The APIs referred below must be accessed from your entity's network IPs registered with Sahamati.&#x20;
{% endhint %}

1. **Step-1**: Generate a User-Token

   Use the email and the newly set password to generate a user token from the Token Service through the [User Token Generate API](https://developer.sahamati.org.in/how-to-guides/token-service-apis-production#post-user-token-generate).&#x20;
2. **Step-2**: Read existing secret (if needed)

   Use the user-token to read the secret of your entity using the [Secret - Read API ](https://developer.sahamati.org.in/how-to-guides/token-service-apis-production#post-entity-secret-read)
3. **Step-3**: Reset the entity secret

   Use the user-token to reset the secret of your entity using the [Secret - Reset API](https://developer.sahamati.org.in/how-to-guides/token-service-apis-production#post-entity-secret-reset).&#x20;
4. **Step-4**: The new secret should be applied to your system. Please refer to the [API documentation](https://developer.sahamati.org.in/how-to-guides/token-service-apis-production) for further details.
5. **Update Systems for Token Expiration:**\
   Ensure that your systems and applications are prepared to handle the periodic 24-hour token expiration. Implement a token rotation mechanism using the [Entity Token Generation API](https://developer.sahamati.org.in/how-to-guides/token-service-apis-production#post-entity-token-generate) to automate this process.
6. **Manual Rotation Option:**\
   If automation is not yet ready, you can still rotate the token manually by directly calling Sahamati’s API.

Please ensure these changes are incorporated into your applications and processes by the given deadlines to maintain uninterrupted access to the AA ecosystem.


# Token Service APIs - Production

Identity and Access Management ( Token Service) APIs

Each member of the Sahamati Network will be onboarded with a designated user who holds an admin role to manage the entity’s profile and secret.

* During the onboarding process, the designated user will receive an email containing a verification link. After email verification, **the user will be prompted to set a password**, completing the account activation process.
* Once the password is set, **the user can generate the User Access Token** by providing their email and the new password. This token is used for authenticating the entity’s secrets.
* The designated user can then use the User Access Token to **access the entity’s secret** and, if necessary, **reset the secret**.
* Finally, the entity secret is used to **generate the Entity Access Token**, which is needed for interactions with the ReBIT APIs within the AA network.

### Entity Token Generation use case&#x20;

The Regulated Entities (REs) should generate the Access Token using the Token API from Sahamati for accessing and authentication of any APIs in the AA ecosystem including Sahamati APIs.

Here is the sequence diagram for the Token Generation Process.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdc4HeMCiC89Fdmj_Xf0Nv3AZZKB6BuqMxBUGRt41o73HkYfBchfZOQ9S_a5dg6nK32KXqo44LBDV1AhjU_IyorOrAk0PFyphQuHLr0k3ilJwrjo2xbHH6XFFhwJB0hZWZuW62-0Q?key=3aTz-3SKYP0rOCX7DFnLglx6" alt=""><figcaption><p>Token Generation use case diagram</p></figcaption></figure>

Below are the Base URL of each environment to use IAM APIs.

<table><thead><tr><th width="213.489501953125">Environment</th><th>Base URL</th></tr></thead><tbody><tr><td>Production</td><td>https://api.sahamati.org.in/iam</td></tr></tbody></table>

Please note that the following documentation displays the Base URLs from the Production environment. Ensure you use the appropriate Base URLs depending on the environment you are working in.

## Generate User Access Token API

> To generate a User Access Token, the user must provide their username (email) and the password configured during the account activation process. This access token is necessary for interacting with the member's secret management APIs. The access token has an expiry of 180 days. Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"User APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/user/token/generate":{"post":{"tags":["User APIs"],"summary":"Generate User Access Token API","description":"To generate a User Access Token, the user must provide their username (email) and the password configured during the account activation process. This access token is necessary for interacting with the member's secret management APIs. The access token has an expiry of 180 days. Below is the API specification.\n","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"User email."},"password":{"type":"string","description":"The password associated with the user."}},"required":["username","password"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"TokenResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"accessToken":{"type":"string"},"expiresIn":{"type":"integer"},"tokenType":{"type":"string"}}}}}}
```

## Read Secret API

> The Read Secret API enables admin to retrieve the current secret for a specific member. To access this information, a user access token with administrative rights must be provided. Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/secret/read":{"post":{"tags":["Entity APIs"],"summary":"Read Secret API","description":"The Read Secret API enables admin to retrieve the current secret for a specific member. To access this information, a user access token with administrative rights must be provided. Below is the API specification.\n","parameters":[{"name":"Authorization","in":"header","required":true,"description":"User Bearer token for authorization","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretReadRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretReadResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"EntitySecretReadRequest":{"type":"object","required":["entityId"],"properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"}}},"EntitySecretReadResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secret":{"type":"string"},"expiresOn":{"type":"number"},"expirationDate":{"type":"string"},"oldSecretValidity":{"type":"number"},"oldSecretExpirationDate":{"type":"string"}}}}}}
```

## Reset Secret API

> The Reset Secret API is used to reset the entity’s secret.  To perform this action, a user access token with administrative privileges must be provided.  Once reset, the generated secret will have a validity period (default and max value of 180 days) as specified in the request payload.  The SPOC will have to ensure that it is renewed well before the expiry.\
> An entity’s secret can be reset up to 5 times per day. There will be a waiting period of 5 mins applied after each reset API call.\
> Below is the API specification.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/secret/reset":{"post":{"tags":["Entity APIs"],"summary":"Reset Secret API","description":"The Reset Secret API is used to reset the entity’s secret.  To perform this action, a user access token with administrative privileges must be provided.  Once reset, the generated secret will have a validity period (default and max value of 180 days) as specified in the request payload.  The SPOC will have to ensure that it is renewed well before the expiry.\nAn entity’s secret can be reset up to 5 times per day. There will be a waiting period of 5 mins applied after each reset API call.\nBelow is the API specification.\n","parameters":[{"name":"Authorization","in":"header","required":true,"description":"User Bearer token for authorization","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretResetRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitySecretResetResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"EntitySecretResetRequest":{"type":"object","required":["entityId"],"properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secretExpiryDays":{"type":"integer","description":"Specifies the number of days before the secret expires. This field is optional; if not provided, a default value will be used."},"oldSecretValidity":{"type":"integer","description":"Specifies the number of days (a max of 7) for which the previous secret remains valid.  The old and new secret, both, can be used to generate token during this period.  This field is optional. If not provided or set to 0, the old secret will be invalidated immediately.   We advise the REs to use this judiciously."}}},"EntitySecretResetResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"entityId":{"type":"string"},"secret":{"type":"string"},"expiresOn":{"type":"number"},"expirationDate":{"type":"string"},"oldSecretValidity":{"type":"number"}}}}}}
```

## Generate Entity Access Token API

> To generate a Member (Entity) Access Token, the client ID and Secret are required. The API generates the token with a warning if the secret is within the grace period, but it will fail once the grace period has ended. This token is used for interactions with other members and has a validity of 24 hours. The API specification is detailed below.<br>

```json
{"openapi":"3.0.0","info":{"title":"Token Service APIs","version":"2.1.0"},"tags":[{"name":"Entity APIs"}],"servers":[{"url":"https://api.sahamati.org.in/iam/v1"}],"paths":{"/entity/token/generate":{"post":{"tags":["Entity APIs"],"summary":"Generate Entity Access Token API","description":"To generate a Member (Entity) Access Token, the client ID and Secret are required. The API generates the token with a warning if the secret is within the grace period, but it will fail once the grace period has ended. This token is used for interactions with other members and has a validity of 24 hours. The API specification is detailed below.\n","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The entity ID."},"secret":{"type":"string","description":"The secret associated with the entity."}},"required":["id","secret"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"errorCode":{"type":"string"},"errorMsg":{"type":"string"}}}}}}}}}},"components":{"schemas":{"TokenResponse":{"type":"object","properties":{"ver":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"txnId":{"type":"string"},"accessToken":{"type":"string"},"expiresIn":{"type":"integer"},"tokenType":{"type":"string"}}}}}}
```

## Token Generation APIs:

#### API Postman Collection:&#x20;

{% hint style="info" %}
We recommend you to use below postman collection to try out our Token-Service\[IAM] APIs
{% endhint %}

{% file src="/files/LrPZkvetWRM9Un9XGz41" %}

## Member Secret Management APIs

#### API Collection:

{% file src="/files/nymDUvFE3Ay3pAtIgcs4" %}
Token-Service\[IAM] - API Collection
{% endfile %}


# Central Registry JSON Template

## CR Entity Registration

**API Parameter Reference · FIP / FIU / AA**

This document describes every parameter in the Central Registry entity registration JSON payload. Fields marked **Required** must be present for all entity types. Fields marked **FIP only** / **AA only** apply exclusively to that entity type. Fields marked **Ignore** are reserved for future use.

### Root-Level Parameters

<table><thead><tr><th width="152.111083984375">Field / Parameter</th><th width="132.111083984375">Type</th><th>Required</th><th>Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>ver</code></td><td>String</td><td><strong>Required</strong></td><td>Version of the API/schema being used.</td><td><code>2.0</code></td></tr><tr><td><code>timestamp</code></td><td>String (ISO 8601)</td><td><strong>Required</strong></td><td>UTC timestamp of the request in ISO 8601 format.</td><td><code>2026-03-18T08:04:50.314Z</code></td></tr><tr><td><code>txnid</code></td><td>String (UUID)</td><td><strong>Required</strong></td><td>Unique transaction ID for tracking this request.</td><td><code>407a70dd-88dd-423d-97a6-edbc0d0694da</code></td></tr><tr><td><code>type</code></td><td>String (Enum)</td><td><strong>Required</strong></td><td>Entity type being registered. One of: <code>FIP</code>, <code>FIU</code>, <code>AA</code>.</td><td><code>FIU</code></td></tr></tbody></table>

### `requester` — Identifies the party submitting the request

<table><thead><tr><th width="151.66668701171875">Field / Parameter</th><th width="104.5555419921875">Type</th><th width="122.666748046875">Required</th><th>Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>requester.name</code></td><td>String</td><td><strong>Required</strong></td><td>Display name of the entity submitting the request.</td><td><code>Sahamati FIU Test</code></td></tr><tr><td><code>requester.id</code></td><td>String</td><td><strong>Required</strong></td><td>Unique ID of the requesting entity as registered in the CR.</td><td><code>sahamati-fiu-test-new</code></td></tr></tbody></table>

### `entityinfo` — Core entity registration details

<table><thead><tr><th width="149">Field / Parameter</th><th width="105.44439697265625">Type</th><th width="131.111083984375">Required</th><th width="202.3333740234375">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>entityinfo.tags</code></td><td>String</td><td>Optional</td><td>Environment tag for the entity (e.g. <code>Sandbox</code>, <code>Production</code>).</td><td><code>Sandbox</code></td></tr><tr><td><code>entityinfo.name</code></td><td>String</td><td><strong>Required</strong></td><td>Name of the entity as submitted while listing itself in the CR. <br>Note: <strong>Ensure this matches exactly as mentioned in your Certificate of Registration (CoR) issued by your regulator</strong>.</td><td><code>Sahamati Foundation</code></td></tr><tr><td><code>entityinfo.id</code></td><td>String</td><td><strong>Required</strong></td><td>Unique ID issued by the CR to the entity.<br>Note: <strong>Please refer to</strong> <a href="https://membersuccess.sahamati.org.in/member-services/cr-pre-onboarding-guide/entity-id-naming-convention"><strong>this page</strong></a> <strong>for your Entity ID naming convention.</strong></td><td><code>sahamati-fiu-test-new</code></td></tr><tr><td><code>entityinfo.code</code></td><td>String</td><td><strong>Required</strong></td><td>ID issued by the financial sector regulator governing this entity.<br>Note: <strong>Ensure this matches exactly as mentioned in your Certificate of Registration (CoR) issued by your regulator.</strong></td><td></td></tr><tr><td><code>entityinfo.entityhandle</code></td><td>String</td><td>AA only</td><td>Handle suffix for user profiles managed by the AA (e.g. <code>@aa</code>). Leave blank for FIU/FIP.</td><td></td></tr></tbody></table>

### `entityinfo.Identifiers` — Account discovery identifiers

*(FIP only; present here for schema completeness)*

| Field / Parameter        | Type          | Required | Description                                                                                   | Example Value |
| ------------------------ | ------------- | -------- | --------------------------------------------------------------------------------------------- | ------------- |
| `Identifiers[].category` | String (Enum) | FIP only | Category of identifier accepted for account discovery. Values: `STRONG`, `WEAK`, `ANCILLARY`. | `STRONG`      |
| `Identifiers[].type`     | String (Enum) | FIP only | Type of identifier (e.g. `MOBILE`, `PAN`, `DOB`). At least one must be `STRONG`.              | `MOBILE`      |

### `entityinfo` — Connectivity & Endpoints

| Field / Parameter          | Type           | Required     | Description                                                                                                            | Example Value                                       |
| -------------------------- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `entityinfo.baseurl`       | String (URL)   | **Required** | URL hosting all ReBIT-compliant API endpoints. Prefix with version e.g. `v2:` for versioned URLs.                      | `v2:https://data.sahamati.com/fiu/sahamati-test/v2` |
| `entityinfo.webviewurl`    | String (URL)   | AA only      | URL of the AA web app for FIUs to redirect users to. `null` for FIU/FIP.                                               | `null`                                              |
| `entityinfo.fitypes`       | Array\<String> | FIP only     | Financial information types from the ReBIT master list that the entity supports. Present here for schema completeness. | `DEPOSIT, MUTUAL_FUNDS, EQUITIES...`                |
| `entityinfo.inboundports`  | Array\<String> | **Required** | Ports on the entity that counterparties (AA/FIP/FIU) can connect to.                                                   | `["443"]`                                           |
| `entityinfo.outboundports` | Array\<String> | **Required** | Ports from which the entity will make outbound requests.                                                               | `["443"]`                                           |
| `entityinfo.ips`           | Array\<String> | **Required** | IP addresses counterparties may send and receive requests to/from.                                                     | `["13.127.138.226"]`                                |

### `entityinfo.certificate` — Public key in JSON Web Key (JWK) format

| Field / Parameter | Type   | Required     | Description                                              | Example Value                          |
| ----------------- | ------ | ------------ | -------------------------------------------------------- | -------------------------------------- |
| `certificate.alg` | String | **Required** | Algorithm used. Typically `RS256`.                       | `RS256`                                |
| `certificate.kty` | String | **Required** | Key type. Must be `RSA`.                                 | `RSA`                                  |
| `certificate.use` | String | **Required** | Intended use of the key. `sig` = signature verification. | `sig`                                  |
| `certificate.kid` | String | **Required** | Key ID — unique identifier for this key.                 | `ed9c4269-96de-4a62-b057-e2dd628d359c` |
| `certificate.e`   | String | **Required** | RSA public exponent (Base64url encoded).                 | `AQAB`                                 |
| `certificate.n`   | String | **Required** | RSA modulus — the public key value (Base64url encoded).  | `ngB4ScutfK6776QK...`                  |

### `entityinfo.gsp` — Gateway Service Provider

(Leave these Field/Parameter values as null — Reserved for future use)

| Field / Parameter | Type | Required | Description                                                                                    | Example Value |
| ----------------- | ---- | -------- | ---------------------------------------------------------------------------------------------- | ------------- |
| `gsp`             | null | null     | GSP details when a gateway sits between AAs and the FIP (e.g. GSTN). Set to `null` for FIU/AA. | `null`        |

### `entityinfo.tokeninfo` — Token issuance details

(Leave these Field/Parameter values as empty — Reserved for future use)

| Field / Parameter | Type         | Required   | Description                                                          | Example Value |
| ----------------- | ------------ | ---------- | -------------------------------------------------------------------- | ------------- |
| `tokeninfo.url`   | String (URL) | Keep Empty | URL of the entity's Token Issuance Service. Reserved for future use. | `""`          |
| `tokeninfo.desc`  | String       | Keep Empty | Description field. Reserved for future use.                          | `""`          |

### `entityinfo.signature` — Request signature

(Leave these Field/Parameter values as empty — Reserved for future use)

| Field / Parameter     | Type   | Required   | Description                                                              | Example Value |
| --------------------- | ------ | ---------- | ------------------------------------------------------------------------ | ------------- |
| `signature.signValue` | String | Keep Empty | Cryptographic signature of the request payload. Reserved for future use. | `""`          |

***

### Notes

* `baseurl` will be prefixed with a version tag (e.g. v2:https\://...) to indicate the supported API version.
* `certificate` fields follow the JSON Web Key (RFC 7517) specification.
* `tokeninfo` and `signature` fields are present in the schema but should be left empty / ignored until further notice.
* `gsp` must be set to `null` for FIU and AA entity types.
* `entityhandle` and `webviewurl` are AA-specific and should be omitted or set to null/blank for FIP and FIU.

### Template

> **Note**: The base JSON structure is identical for all RE types. The tabs below are provided for clarity — each view highlights the relevant fields and example values as applicable to that entity type (FIU, FIP, or AA).

{% tabs %}
{% tab title="FIU" %}

```json
{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "FIU",
  "requester": {
    "name": "Sahamati FIU Test",
    "id": "sahamati-fiu-test-new"
  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati FIU Test",
    "id": "sahamati-fiu-test-new",
    "code": "sahamati-fiu-test-new",
    "entityhandle": "",
    "Identifiers": [],
    "baseurl": "v2:https://data.sahamati.com/fiu/sahamati-test/v2",
    "webviewurl": null,
    "fitypes": [],
    "certificate": {
      "e": "AQAB",
      "n": "<RSA modulus here>",
      "alg": "RS256",
      "kid": "<key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["<ip-address>"]
  }
}

```

{% endtab %}

{% tab title="FIP" %}

<pre class="language-json"><code class="lang-json">{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "FIP",
  "requester": {
    "name": "Sahamati FIP Test",
<strong>    "id": "sahamati-fip-test"
</strong>  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati FIP Test",
    "id": "sahamati-fip-test",
    "code": "sahamati-fip-test",
    "entityhandle": "",
    "Identifiers": [
      { "category": "STRONG", "type": "MOBILE" },
      { "category": "STRONG", "type": "PAN" }
    ],
    "baseurl": "v2:https://data.sahamati.com/fip/sahamati-test/v2",
    "webviewurl": null,
    "fitypes": [
      "DEPOSIT", "TERM_DEPOSIT", "RECURRING_DEPOSIT", "SIP", "CP",
      "EQUITIES", "MUTUAL_FUNDS"
    ],
    "certificate": {
      "e": "AQAB",
      "n": "&#x3C;RSA modulus here>",
      "alg": "RS256",
      "kid": "&#x3C;key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["&#x3C;ip-address>"]
  }
}
</code></pre>

{% endtab %}

{% tab title="AA" %}

```json
{
  "ver": "1.0",
  "timestamp": "2026-03-18T08:04:50.314Z",
  "txnid": "407a70dd-88dd-423d-97a6-edbc0d0694da",
  "type": "AA",
  "requester": {
    "name": "Sahamati AA Test",
    "id": "sahamati-aa-test"
  },
  "entityinfo": {
    "tags": "Sandbox",
    "name": "Sahamati AA Test",
    "id": "sahamati-aa-test",
    "code": "sahamati-aa-test",
    "entityhandle": "@sahamati-aa-test",
    "Identifiers": [],
    "baseurl": "v2:https://data.sahamati.com/aa/sahamati-test/v2",
    "webviewurl": "https://webview.sahamati.com/aa/sahamati-test",
    "fitypes": [],
    "certificate": {
      "e": "AQAB",
      "n": "<RSA modulus here>",
      "alg": "RS256",
      "kid": "<key-id-uuid>",
      "kty": "RSA",
      "use": "sig"
    },
    "tokeninfo": {
      "url": "",
      "desc": ""
    },
    "gsp": null,
    "signature": {
      "signValue": ""
    },
    "inboundports": ["443"],
    "outboundports": ["443"],
    "ips": ["<ip-address>"]
  }
}

```

{% endtab %}
{% endtabs %}


# Overview

SahamatiNet Agent (SNA) is a lightweight, standalone agent developed by Sahamati and deployed within an Account Aggregator's (AA's) own infrastructure. SNA is responsible for aggregating and sending required metrics to Sahamati's endpoint on behalf of the AA, without requiring the AA's to write or maintain code that implements complex metric-capture logic.

### Key Capabilities

* Runs entirely within the AA's infrastructure; no data leaves unless pushed to Sahamati's endpoint.
* Captures request and notification metrics across all FIP-side and FIU-side AA APIs.
* Aggregates data and pushes structured JSON payloads to Sahamati every 10 minutes.
* Is versioned and upgradeable; AAs simply redeploy a new Helm chart version; no code changes needed.
* Provides uniform, schema-consistent data across all AAs for fair SLA benchmarking and billing.

### Current Phase of Deployment

Sahamati is currently requesting all AAs to:

1. Deploy the latest SNA image to the UAT environment
2. Integrate at the AA-FIP interface.
3. Integrate at the AA-FIU interface.
4. Send the additional attributes (`addlAttr`) applicable to each API, on both interfaces.
5. Validate the integration in UAT, then deploy to Production.

📌 **AAs already integrated at the AA-FIP interface:** your existing A–D integration must also be updated. The `eventTime` attribute is now required on every `sna.dispatch()` call, including AA-FIP calls. Other attributes, such as `consentTypes` and `fiFetchEncDataLen`, apply to specific AA-FIP APIs as well.


# Why SNA?

Sahamati evaluated two options for how AAs should report SLA metrics. The following comparison, agreed upon with the AA community, guided the decision to build and distribute SNA:

| Option 1: AA Gathers & Reports Independently          | Option 2: AA Uses SNA (Recommended)              |
| ----------------------------------------------------- | ------------------------------------------------ |
| ✔ AA-controlled changes                               | ✔ Uniform interpretation across all AAs          |
| ✘ Interpretations may vary across AAs                 | ✔ Minimal integration effort for AAs             |
| ✘ Each AA must implement all reporting logic          | ✔ Future changes: redeploy SNA, no code changes  |
| ✘ Future schema changes require AA engineering effort | \~ AAs maintain one additional cluster component |

The SNA approach ensures that Sahamati can centrally update calculation logic, definitions, schema, and all AAs benefit immediately by simply deploying the new version of SNA.

This leads to:

* Faster ecosystem-level consistency
* Lower engineering burden on individual AAs.

#### Extending SNA to Billing

The same approach now applies to billing. Rather than each AA building separate reporting logic for billing, AAs capture transaction metadata at the AA-FIU interface through the same `sna.dispatch()` method already used at the AA-FIP interface. SNA provides a single, uniform source of data for billing across all AAs.

For data fetches, the AA passes the consent types of the approved consent to SNA. This lets SNA identify whether a fetch is for transactions or for profile and summary only, since these may be billed differently.

#### Accurate Latency Measurement

The AA passes its own timestamp for every request and response it sends or receives. Latency calculations therefore do not depend on the clock of the peer FIP or FIU being in sync.

#### Minimal Data Sharing

AAs that prefer not to share the encrypted FI payload with SNA can redact the `encryptedFI` field in FI/fetch responses and send only its length. SNA uses this length to calculate data volumes


# How SNA Works

SNA is deployed as a microservice within the AA's Kubernetes cluster. It receives API requests and response data from the AA's service, aggregates SLA metrics according to Sahamati's schema, and pushes aggregated JSON payloads to the Sahamati SLA endpoint every 10 minutes.

### High-Level Data Flow

The data flows through the following stages:

1. AA's service sends and receives API calls to/from FIPs and FIUs.
2. The AA service captures key metadata for every request and response at each integration point (A-H)
3. It sends this information to the SNA running in its cluster.
4. SNA aggregates the required metrics (counts, response times, percentiles, statuses) for each 10-minute window.
5. SNA pushes two JSON payloads to the Sahamati SLA endpoint every 10 minutes: one for Request metrics and one for Notification metrics.

### What SNA Aggregates

| Category             | Type             | Description                                                            |
| -------------------- | ---------------- | ---------------------------------------------------------------------- |
| Request Metrics      | Counts           | Total requests sent per API type, response code counts (2xx, 4xx, 5xx) |
| Request Metrics      | Response Times   | Percentiles (p50, p95, p99, p100) per API type in milliseconds         |
| Request Metrics      | Data Size        | Sum of FI/fetch encrypted data packet sizes                            |
| Notification Metrics | Counts           | Total notifications received per type (FI, Account Link, Consent)      |
| Notification Metrics | Status Breakdown | Ready, Delivered, Denied, Timeout, Pending count for FI notifications  |


# Integration Guide

This section covers everything you need to integrate your AA service with SNA — from understanding integration points to deploying the Helm chart and adding the snalib library to your service.

### In This Section

* **Integration Points** — understand the 8 integration points (A–H) and which ones are required for the current phase.
* **Step-by-Step Integration** — a guided walkthrough of all integration steps.
* **Deploying SNA** — how to deploy and upgrade SNA using the Helm chart.
* **SNA Library (snalib)** — how to add snalib to your AA service code.


# Integration Points

SNA defines 8 integration points, labeled A through H, corresponding to the 4 interface points: one on the AA-FIP side and one on the AA-FIU side of AA's service. Each point represents a direction of data flow that SNA monitors.

<figure><img src="https://2423266439-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKUjTKikPLYOjZEtClEd%2Fuploads%2FnVSeKrhhl4CQ4YcjaxoY%2Fimage.png?alt=media&amp;token=2eaafd49-193a-4221-83b7-f32fef79b9cb" alt=""><figcaption></figcaption></figure>

### Integration Points Summary

| Point | Direction   | Side   | SLA        | Billing    | SaaNs      | MIS        |
| ----- | ----------- | ------ | ---------- | ---------- | ---------- | ---------- |
| A     | requestOut  | AA-FIP | ✔ Required |            | ✔ Required | ✔ Required |
| B     | responseIn  | AA-FIP | ✔ Required |            | ✔ Required | ✔ Required |
| C     | requestIn   | AA-FIP | ✔ Required |            | ✔ Required | ✔ Required |
| D     | responseOut | AA-FIP | ✔ Required |            | ✔ Required | ✔ Required |
| E     | requestOut  | AA-FIU |            | ✔ Required |            | ✔ Required |
| F     | responseIn  | AA-FIU |            | ✔ Required |            | ✔ Required |
| G     | requestIn   | AA-FIU |            | ✔ Required |            | ✔ Required |
| H     | responseOut | AA-FIU |            | ✔ Required |            | ✔ Required |

### Integration Point Details (AA-FIP Side)

<table><thead><tr><th width="145.66668701171875">Point</th><th width="124">Direction</th><th>What to Capture</th></tr></thead><tbody><tr><td>A) requestOut</td><td>AA → FIP</td><td>Capture outgoing request data: API type, timestamp, target FIP ID, request size</td></tr><tr><td>B) responseIn</td><td>FIP → AA</td><td>Capture incoming response data: HTTP status code, response time (ms), response body size</td></tr><tr><td>C) requestIn</td><td>FIP → AA</td><td>Capture incoming FIP notifications: API type, timestamp, source FIP ID</td></tr><tr><td>D) responseOut</td><td>AA → FIP</td><td>Capture outgoing response data: HTTP status code, timestamp</td></tr></tbody></table>

### Integration Point Details (AA-FIU Side)

| Point          | Direction | Applicable APIs                                                                                              | What to Capture                                           |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| E) requestOut  | AA → FIU  | /Consent/Notification, /FI/Notification, /Heartbeat                                                          | Outgoing request data: API type, timestamp, target FIU ID |
| F) responseIn  | FIU → AA  | Responses to the APIs at point E                                                                             | Incoming response data: HTTP status code, timestamp       |
| G) requestIn   | FIU → AA  | /Consent, /Consent/handle, /Consent/fetch, /FI/request, /FI/fetch, /Consent/Notification¹, /FI/Notification¹ | Incoming request data: API type, timestamp, source FIU ID |
| H) responseOut | AA → FIU  | Responses to the APIs at point G                                                                             | Outgoing response data: HTTP status code, timestamp       |

> ¹ ReBIT specifications allow these notifications to be sent to the AA by an FIU. Capture them only if your AA supports receiving them

📌 Some APIs also require additional attributes (`addlAttr`) on both the AA-FIP and AA-FIU interfaces


# Step-by-Step Integration

Follow these steps to integrate your AA service with SNA. The integration is designed to be minimal.

The AA application communicates with SNA via HTTP APIs. Sahamati will share a library, snalib, that AAs can use to set up the interface with SNA and perform the API calls.

### Step 1: Deploy SNA to your cluster

Deploy the latest version of SNA in your environment. SNA can be deployed in either of two ways:

* **Helm chart:** for REs running Kubernetes.
* **Docker:** for REs running containers without Kubernetes.

Refer to [Deploying SNA](https://developer.sahamati.org.in/sahamatinet-agent-sna/integration-guide/deploying-sna) for detailed deployment instructions.

### Step 2: Add snalib to your service

Include the snalib library in your AA service code. The library is available for Node, Go, dotnet, and Java on Sahamati's GitHub. Refer to [SNA Library (snalib)](https://developer.sahamati.org.in/sahamatinet-agent-sna/integration-guide/sna-library-snalib) for integration steps.

#### Step 3: Set up a connection with SNA

During AA application initialization, call the snalib function to initialize the connection to SNA.

#### Step 4: Instrument your AA-FIP interface

Call the `sna.dispatch()` method at each of the 4 AA-FIP integration points (A, B, C, D):

* **Point A (requestOut):** Call sna.dispatch() before sending a request to a FIP, with the required parameters.
* **Point B (responseIn):** Call sna.dispatch() after receiving a response from a FIP, with the required parameters. If a Point A call was made to SNA, ensure a matching Point B call is made. Handle all cases, including client failures, server timeouts, and connection failures.
* **Point C (requestIn):** Call sna.dispatch() when your AA service receives an incoming notification from a FIP, with the required parameters.
* **Point D (responseOut):** Call sna.dispatch() after your AA service sends a response back to a FIP, with the required parameters.

> 📌 **Already integrated at points A–D?** Update your existing calls to include the additional attributes (`addlAttr`) now required on the AA-FIP interface, such as `eventTime`. See Step 6.

#### Step 5: Instrument your AA-FIU interface

Call the same `sna.dispatch()` method at each of the 4 AA-FIU integration points (E, F, G, H):

* **Point E (requestOut):** Call sna.dispatch() before sending a request to an FIU, such as a consent notification, FI notification, or heartbeat.
* **Point F (responseIn):** Call sna.dispatch() after receiving a response from an FIU. If a Point E call was made to SNA, ensure a matching Point F call is made. Handle all cases, including client failures, server timeouts, and connection failures.
* **Point G (requestIn):** Call sna.dispatch() when your AA service receives a request from an FIU, such as a consent, consent fetch, FI request, or FI fetch.
* **Point H (responseOut):** Call sna.dispatch() after your AA service sends a response back to an FIU.

#### Step 6: Send additional attributes

For each `sna.dispatch()` call, on both interfaces, include the additional attributes (`addlAttr`) that apply to that API:

* `eventTime` is required on every call.
* `consentTypes` is required on FI/request calls.
* Other attributes apply to specific APIs, and some are optional.

If you prefer not to share the encrypted FI payload with SNA, you can redact the `encryptedFI` field in FI/fetch responses and send its length as `fiFetchEncDataLen` instead.

For details, see Additional Attributes (addlAttr).

> 📌 SNA is designed to be non-blocking and has minimal performance impact. All aggregation is done asynchronously inside the SNA agent. It is not done in your service.

#### Anomalous FIP behaviour

<table><thead><tr><th width="95.66668701171875">Case #</th><th width="143.6666259765625">Name</th><th width="239.9998779296875">Description</th><th>AA Action</th></tr></thead><tbody><tr><td>1</td><td>Server side send error</td><td>AA client informs SNA about a request to FIP. AA fails to connect to FIP, due to server down at FIP.</td><td>AA report httpStatus "-1" to SNA</td></tr><tr><td>2</td><td>Client side send error</td><td>AA client informs SNA about a request to FIP. AA fails to connect to FIP due to client side error</td><td>AA report httpStatus "-2" to SNA</td></tr><tr><td>3</td><td>FIP signature issue</td><td>AA sent a request to FIP. FIP sends 200OK in the response. But AA finds that the x-jws-signature is invalid</td><td>AA report httpStatus "701" to SNA, instead of 200</td></tr><tr><td>4</td><td>FIP payload format issue</td><td>AA sent a request to FIP. FIP sends 200OK in the response. But AA finds that the data format is invalid.</td><td>AA report httpStatus "702" to SNA, instead of 200</td></tr><tr><td>5</td><td>FIP payload content issue</td><td>AA sent a request to FIP. FIP sends 200OK in the response. But AA finds that the data content is wrong.</td><td>AA report httpStatus "703" to SNA, instead of 200</td></tr></tbody></table>

### Step 7: Configure the SNA endpoint

Ensure your SNA deployment is configured with the correct Sahamati endpoint.

### Step 5: Validate in UAT

Before deploying to Production, validate the integration in your UAT environment:

* Confirm that SNA is running and healthy in the cluster.
* Trigger a few AA-FIP API calls and a few AA-FIU API calls, and verify that SNA is receiving the data from both interfaces.
* After 10 minutes, check with Sahamati's team to confirm that metric payloads are being received at the UAT endpoint.
* Review the response from the endpoint for any validation errors or warnings.

### Step 6: Deploy to Production

Once UAT validation is complete, deploy SNA to your Production cluster and point it at the Production SLA endpoint.


# Deploying SNA

SNA runs as a standalone agent inside your own infrastructure. You can deploy it in either of two ways:

<table><thead><tr><th width="131.3333740234375">Option</th><th>Use when</th></tr></thead><tbody><tr><td>Helm chart</td><td>Your AA services run on Kubernetes</td></tr><tr><td>Docker</td><td>Your AA services run on containers without Kubernetes</td></tr></tbody></table>

Both options run the same SNA image and behave identically. Choose the one that matches your environment.

> 📌 Always deploy the latest version of SNA.

### GitHub Repository

The SNA downloadables repository contains the Helm chart and the snalib distribution:

<https://github.com/Sahamati/sahamatinet-agent-downloadables>

### Helm Chart Deployment Steps

1. Download the contents from the repository: <https://github.com/Sahamati/sahamatinet-agent-downloadables.git>
2. Refer to the README.md file in the repository root for an overview.
3. Follow the instructions in the SETUP.md file for deployment of the container. This includes configuring the required settings and running the Helm charts.
4. After installation, test the ping API to confirm the SNA container is up and running.

### Upgrading SNA

When Sahamati releases a new version of SNA (e.g., to update schema definitions or metric logic), the upgrade process is straightforward:

1. Download the new Helm chart version from the GitHub repository.
2. Run a Helm upgrade command:


# SNA Library (snalib)

Sahamati provides sna libraries to reduce the integration effort with SNA. The snalib-dist directory in the GitHub repository can be used by your AA service to push the api transaction details to the SNA agent. Libraries for Node, Go, dotnet and Java are available, along with example source code and a Java JAR.

### Steps to Integrate

1. Pull the latest main branch from the repository:

<https://github.com/Sahamati/sahamatinet-agent-downloadables>

2. Find the snalib source code, example source, and Java JAR under the following path in the repository: sahamatinet-agent-downloadables/snalib-dist
3. Use the library for your AA service stack:
   * **Node:** `snalib-dist/node/`
   * **Go:** `snalib-dist/go/`
   * **Dotnet:** `snalib-dist/dotnet/`
   * **Java:** `snalib-dist/java/` (source and JAR)
4. Refer to the example source code in the repository to see how to call `sna.dispatch()` at each integration point.

> 📌 SNA is designed to be non-blocking. Metric data is sent asynchronously to the SNA agent to avoid adding latency to your AA service's API response times.


# Dispatch Input Reference

Your AA service sends API transaction details to SNA by calling the snalib `sna.dispatch()` method at each integration point. snalib sends these details to the SNA agent running in your infrastructure.

**SNA API:** `POST /sna/v1/aa` **snalib method:** `sna.dispatch()`

The same method and input structure are used on both the AA-FIP and AA-FIU interfaces.

#### Input Fields

| Key        | Type    | Required                   | Description                                                                                           |
| ---------- | ------- | -------------------------- | ----------------------------------------------------------------------------------------------------- |
| callType   | string  | Yes                        | Type of transaction call. See Call Types.                                                             |
| route      | string  | Yes                        | ReBIT API endpoint route, e.g. `/FI/request`                                                          |
| peerId     | string  | Yes                        | Entity ID of the peer: the FIP on the AA-FIP interface, the FIU on the AA-FIU interface               |
| peerType   | string  | Yes                        | Entity type of the peer: `FIP` or `FIU`                                                               |
| txnCorId   | string  | Yes                        | UUID correlating a request with its response. The request and its response must carry the same value. |
| customerId | string  | No                         | Customer ID related to the transaction                                                                |
| httpStatus | integer | Responses only             | HTTP status code of the response. Applies only to `responseIn` and `responseOut`.                     |
| addlAttr   | json    | Yes (at least `eventTime`) | Additional attributes. See Additional Attributes (addlAttr).                                          |
| body       | json    | Yes                        | The actual request or response body. The `encryptedFI` field may be redacted; see below.              |

#### Call Types

| callType    | Meaning                             | AA-FIP point | AA-FIU point |
| ----------- | ----------------------------------- | ------------ | ------------ |
| requestOut  | AA sends a request to the peer      | A            | E            |
| responseIn  | AA receives the peer's response     | B            | F            |
| requestIn   | AA receives a request from the peer | C            | G            |
| responseOut | AA sends its response to the peer   | D            | H            |

For every `requestOut`, call `sna.dispatch()` with a matching `responseIn` carrying the same `txnCorId`, including when the call fails, times out, or the connection drops. For every `requestIn`, call `sna.dispatch()` with a matching `responseOut`.

#### Additional Attributes Summary

| Attribute         | Required    | Applies to                                               |
| ----------------- | ----------- | -------------------------------------------------------- |
| eventTime         | Yes         | All calls, both interfaces                               |
| consentTypes      | Yes         | FI/request (AA-FIU); AA-FIP for future use               |
| cnsCorId          | Optional    | Consent APIs, both interfaces (for future use)           |
| fiuCnsId          | Optional    | Consent APIs on the AA-FIP interface (for future use)    |
| ssnCorId          | Optional    | Data-fetch APIs, both interfaces (for future use)        |
| fiuSsnId          | Optional    | Data-fetch APIs on the AA-FIP interface (for future use) |
| fiFetchEncDataLen | Conditional | FI/fetch responses, when `encryptedFI` is redacted       |

For full details of each attribute, see Additional Attributes (addlAttr).

#### Redacting encryptedFI

If you prefer not to share the encrypted FI payload with SNA, you can redact or mask the `encryptedFI` field in FI/fetch responses. Continue to send the rest of the body, and add the length of the original `encryptedFI` string as `fiFetchEncDataLen` in `addlAttr`.

#### Example: FI/request received from an FIU (Point G)

All values below are synthetic and for illustration only.

```json
{
  "callType": "requestIn",
  "route": "/FI/request",
  "peerId": "fiu-test-001",
  "peerType": "FIU",
  "txnCorId": "00000000-0000-0000-0000-000000000001",
  "customerId": "customer-test-001",
  "addlAttr": {
    "eventTime": "2026-01-01T10:00:00.000Z",
    "consentTypes": ["PROFILE", "SUMMARY", "TRANSACTIONS"],
    "ssnCorId": "session-uuid-test-001"
  },
  "body": { "...": "FI/request body as received" }
}
```

#### Example: Response sent to the FIU (Point H)

```json
{
  "callType": "responseOut",
  "route": "/FI/request",
  "peerId": "fiu-test-001",
  "peerType": "FIU",
  "txnCorId": "00000000-0000-0000-0000-000000000001",
  "httpStatus": 200,
  "addlAttr": {
    "eventTime": "2026-01-01T10:00:00.250Z",
    "consentTypes": ["PROFILE", "SUMMARY", "TRANSACTIONS"]
  },
  "body": { "...": "FI/request response as sent" }
}
```


# Additional Attributes (addlAttr)

The `addlAttr` field in `sna.dispatch()` carries additional attributes that SNA needs for accurate latency measurement, billing, and correlation across the AA-FIP and AA-FIU interfaces. Which attributes apply depends on the API and the interface.

#### Structure

All values below are synthetic and for illustration only.

```json
"addlAttr": {
  "eventTime": "2026-01-01T10:00:00.000Z",
  "consentTypes": ["PROFILE", "SUMMARY", "TRANSACTIONS"],
  "cnsCorId": "consent-uuid-test-001",
  "fiuCnsId": "fiu-consent-id-test-001",
  "ssnCorId": "session-uuid-test-001",
  "fiuSsnId": "fiu-session-id-test-001",
  "fiFetchEncDataLen": 2131
}
```

Send only the attributes that apply to the API being dispatched.

#### Applicability

**AA-FIU Interface**

| API                              | eventTime | consentTypes | cnsCorId | ssnCorId | fiFetchEncDataLen           |
| -------------------------------- | --------- | ------------ | -------- | -------- | --------------------------- |
| /Consent                         | Required  |              | Optional |          |                             |
| /Consent/handle                  | Required  |              | Optional |          |                             |
| /Consent/fetch                   | Required  |              | Optional |          |                             |
| /Consent/Notification (AA → FIU) | Required  |              | Optional |          |                             |
| /FI/request                      | Required  | Required     |          | Optional |                             |
| /FI/Notification (AA → FIU)      | Required  |              |          | Optional |                             |
| /FI/fetch                        | Required  |              |          | Optional | Conditional (response only) |
| /Consent/Notification (FIU → AA) | Required  |              |          |          |                             |
| /FI/Notification (FIU → AA)      | Required  |              |          |          |                             |
| /Heartbeat                       | Required  |              |          |          |                             |

**AA-FIP Interface**

| API                              | eventTime | consentTypes   | cnsCorId | fiuCnsId | ssnCorId | fiuSsnId | fiFetchEncDataLen           |
| -------------------------------- | --------- | -------------- | -------- | -------- | -------- | -------- | --------------------------- |
| /Consent                         | Required  |                | Optional | Optional |          |          |                             |
| /Consent/Notification (FIP → AA) | Required  |                | Optional | Optional |          |          |                             |
| /FI/request                      | Required  | For future use |          |          | Optional | Optional |                             |
| /FI/Notification (FIP → AA)      | Required  |                |          |          | Optional | Optional |                             |
| /FI/fetch                        | Required  |                |          |          | Optional | Optional | Conditional (response only) |
| All other AA-FIP APIs            | Required  |                |          |          |          |          |                             |

Each attribute applies to both the request and the response of the API, unless marked otherwise.

> 📌 **Optional** attributes are for future use. **Conditional** means required only when `encryptedFI` is redacted.

#### eventTime

**Required** on every `sna.dispatch()` call, on both interfaces.

**What to send:** The UTC timestamp, in ISO 8601 format with milliseconds, at which the AA:

* received a request (`requestIn`) or response (`responseIn`), or
* is sending a request (`requestOut`) or response (`responseOut`).

**Why:** SNA calculates latencies from the AA's own timestamps. This keeps latency measurement accurate and independent of whether the peer's clock is in sync.

#### consentTypes

**Required** on /FI/request on the AA-FIU interface. On the AA-FIP interface, it is for future use.

**What to send:** The array of consent types from the `consentTypes` field of the approved, signed consent that the AA returned to the FIU in the /Consent/fetch response.

**Why:** SNA uses the consent types to determine whether a data fetch is for transactions or only for profile and summary, since these may be billed differently. SNA does not store consents for long periods, so it relies on the AA to provide this context with each data fetch.

#### cnsCorId (Consent Correlation ID)

**Optional.** For future use.

**What to send:** A UUID that the AA creates when it first receives a /Consent request from an FIU. It is different from the consent ID. Send the same value on all consent APIs related to that consent, on both interfaces.

**Why:** In future, this may be used to map a consent requested by an FIU from the AA to the corresponding consent sent by the AA to the FIP. AAs can send either `cnsCorId` or `fiuCnsId`.

#### fiuCnsId (FIU Consent ID)

**Optional.** For future use. AA-FIP interface only.

**What to send:** The consent ID from the FIU side, sent on the consent APIs to and from the FIP.

**Why:** Serves the same purpose as `cnsCorId`. If you already send `cnsCorId`, this is not required.

#### ssnCorId (Session Correlation ID)

**Optional.** For future use.

**What to send:** A UUID that the AA creates when it first receives an /FI/request from an FIU. It is different from the session ID. Send the same value on all data-fetch APIs related to that session, on both interfaces.

**Why:** In future, this may be used to map a data fetch by an FIU from the AA to the corresponding data fetch by the AA from the FIP. AAs can send either `ssnCorId` or `fiuSsnId`.

#### fiuSsnId (FIU Session ID)

**Optional.** For future use. AA-FIP interface only.

**What to send:** The session ID from the FIU side, sent on the data-fetch APIs to and from the FIP.

**Why:** Serves the same purpose as `ssnCorId`. If you already send `ssnCorId`, this is not required.

#### fiFetchEncDataLen (FI Fetch Encrypted Data Length)

**Conditional.** Required only when the `encryptedFI` field is redacted. Applies to /FI/fetch responses on both interfaces.

**What to send:** The length of the original `encryptedFI` string in the /FI/fetch response.

**Why:** SNA uses the length of `encryptedFI` to calculate the volume of data exchanged. AAs that prefer not to share the encrypted payload with SNA can redact or mask `encryptedFI` in the body and send its length here instead. Continue to send the rest of the body as usual.


# SLA

This section covers the SLA data that SNA captures and submits to Sahamati on behalf of the AA, including the API endpoints, payload schemas, and response codes.

### In This Section

* **SLA Overview** — what SLA data SNA captures and how it is reported.
* **Endpoints & Authentication** — the Sahamati SLA endpoint URLs and how authentication works.
* **SLA Request Payload** — schema reference for the request metrics payload.
* **SLA Notification Payload** — schema reference for the notification metrics payload.
* **Response Codes** — HTTP responses returned by the Sahamati SLA endpoint.


# API Reference

This section covers the Sahamati SLA endpoint that SNA pushes data to, including endpoint URLs, authentication, payload schemas, and response codes.

### In This Section

* **Endpoints & Authentication** — the Sahamati SLA endpoint URLs and how authentication works.
* **SLA Request Payload** — schema reference for the request metrics payload.
* **SLA Notification Payload** — schema reference for the notification metrics payload.
* **Response Codes** — HTTP responses returned by the Sahamati SLA endpoint.


# Endpoints & Authentication

SNA pushes data to a Sahamati-hosted HTTPS endpoint. Sahamati provides two variants of this endpoint, one for UAT (for testing your integration) and one for Production.

### SLA Push Endpoints

| Environment | Endpoint URL                                            |
| ----------- | ------------------------------------------------------- |
| Production  | <https://api.sahamati.org.in/sla-inputs/aa/v1/push>     |
| UAT         | <https://api.uat.sahamati.org.in/sla-inputs/aa/v1/push> |

### Authentication

The SLA push endpoint uses token-based authentication. The authentication token will be generated by SNA and stored securely. As part of the SNA deployments the admin will have to configure the entityId and the secret as a Kubernetes secret file for the SNA to generate the token. SNA handles the token injection into request headers automatically.

> 📌 Authentication credentials are issued per AA by Sahamati. Tokens must be stored securely in your cluster and must not be committed to version control.


# SLA Request Payload

SNA pushes a Request metrics payload to the Sahamati endpoint every 10 minutes. This payload captures all API calls sent by the AA to each FIP, including counts and response time percentiles. The tag for this payload is req-fipMetrics-aa.

### Schema Reference

| Field                                     | Type           | Description                                                                                                   |
| ----------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------- |
| agentVersion                              | string         | Version of the SNA agent generating this payload                                                              |
| jsonVersion                               | string         | Version of the JSON schema (e.g. "1.0.0")                                                                     |
| tag                                       | string         | "req-fipMetrics-aa" identifies this as a request-metrics payload from AA perspective of FIP                   |
| txnId                                     | string         | Unique transaction ID for this push request                                                                   |
| metricCollectionId                        | string         | Unique identifier for this metric collection window (e.g. "1769760600-REQ")                                   |
| fromDateTime                              | string         | Start of the 10-minute reporting window (ISO 8601, UTC). E.g. 2026-09-30T04:30:00Z                            |
| toDateTime                                | string         | End of the 10-minute reporting window (ISO 8601, UTC). E.g. 2026-09-30T04:40:00Z                              |
| duration                                  | int            | Duration in seconds of the reporting window (600 for 10 minutes)                                              |
| aaId                                      | string         | Entity ID of the Account Aggregator                                                                           |
| enums.metricTypes                         | array\[string] | Enumerated list of metric type codes included in this payload (see Metric Types table below)                  |
| enums.responseTimeFields                  | array\[string] | Enumerated list of response time percentile labels: \["p50", "p95", "p99", "p100"]                            |
| enums.countFields                         | array\[string] | Enumerated list of count field names, positionally aligned to the counts array (see Count Fields table below) |
| fips\[].fipId                             | string         | Entity ID of the FIP for which metrics are reported in this block                                             |
| fips\[].metrics\[].type                   | string         | Metric type code (e.g. adisc, alink, adlink, alinkv, cns, cnot, fireq, sfireqfif, fif, hbt)                   |
| fips\[].metrics\[].pxx                    | array\[int]    | Response time percentiles in milliseconds: \[p50, p95, p99, p100]                                             |
| fips\[].metrics\[].counts                 | array\[int]    | Count values aligned to countFields enum in the payload                                                       |
| fips\[].metrics\[].sumOfSizeOfDataPackets | string         | Sum of encrypted FI/fetch packet sizes (only for type "fif")                                                  |
| fips\[].metrics\[].noOfAccounts           | int            | Number of accounts included in the fetch (only for type "fif")                                                |
| fips\[].metrics\[].avgLatencyPerKB        | string         | Average latency per KB of data fetched, in seconds (only for type "fif")                                      |

### Metric Types (metricTypes enum)

| Code      | Full Name                                  | Description                                                          |
| --------- | ------------------------------------------ | -------------------------------------------------------------------- |
| adisc     | accountsDiscoverSent\_adisc                | Account discovery requests sent to FIP (POST /Accounts/discover)     |
| alink     | accountsLinkSent\_alink                    | Account link requests sent (POST /Accounts/link)                     |
| adlink    | accountsDelinkSent\_adlink                 | Account delink requests sent (POST /Accounts/delink)                 |
| alinkv    | accountsLinkVerifySent\_alinkv             | Account link verification requests sent (POST /Accounts/link/verify) |
| cns       | consentSent\_cns                           | Consent requests sent to FIP (POST /Consent)                         |
| cnot      | consentNotificationSent\_cnot              | Consent notification messages sent (POST /Consent/Notification)      |
| fireq     | fiReqSent\_fireq                           | FI requests sent (POST /FI/request)                                  |
| sfireqfif | fiReq200OkToFISuccFetchTimeDiff\_sfireqfif | Time difference from FI request 200 OK to successful FI fetch        |
| fif       | fiFetchSent\_fif                           | FI fetch requests sent (POST /FI/Fetch)                              |
| hbt       | heartBeatSent\_hbt                         | Heartbeat messages sent to check FIP connectivity (GET /Heartbeat)   |

### Count Fields (countFields enum)

The counts array in each metric entry is positionally aligned to the following fields in this exact order:

| Field Name                       | Description                                                               |
| -------------------------------- | ------------------------------------------------------------------------- |
| apiTotalSentCnt                  | Total number of requests sent                                             |
| api200OKRecdCnt                  | HTTP 200 OK responses received                                            |
| api400BadReqRecdCnt              | HTTP 400 Bad Request responses received                                   |
| api401UnauthorizedReqRecdCnt     | HTTP 401 Unauthorized responses received                                  |
| api403ForbiddenReqRecdCnt        | HTTP 403 Forbidden responses received                                     |
| api404NotFoundRecdCnt            | HTTP 404 Not Found responses received                                     |
| api409IdempotencyErrorReqRecdCnt | HTTP 409 Idempotency Error responses received                             |
| api412PreConditionFailedRecdCnt  | HTTP 412 Precondition Failed responses received                           |
| api429TooManyReqsRecdCnt         | HTTP 429 Too Many Requests (rate limited) responses received              |
| api4xxOtherErrorsRecdCnt         | All other 4xx error responses received                                    |
| api500InternalServerErrorRecdCnt | HTTP 500 Internal Server Error responses received                         |
| api501NotImplementedRecdCnt      | HTTP 501 Not Implemented responses received                               |
| api502BadGatewayRecdCnt          | HTTP 502 Bad Gateway responses received                                   |
| api503ServiceUnavailableRecdCnt  | HTTP 503 Service Unavailable responses received                           |
| api504GatewayTimeoutRecdCnt      | HTTP 504 Gateway Timeout responses received                               |
| api5xxOtherErrorsRecdCnt         | All other 5xx error responses received                                    |
| apiOtherErrorsRecdCnt            | Responses received with any other/non-standard status code                |
| 2xxRecdCnt                       | Total 2xx-class responses received (rollup)                               |
| 3xxRecdCnt                       | Total 3xx-class responses received (rollup)                               |
| 429RecdCnt                       | Total 429 responses received (rollup)                                     |
| 4xxRecdCnt                       | Total 4xx-class responses received (rollup)                               |
| 5xxRecdCnt                       | Total 5xx-class responses received (rollup)                               |
| otherRecdCnt                     | Total responses received with any other/non-standard status code (rollup) |

#### Sample Payload

```json
{
  "agentVersion": "1.2",
  "jsonVersion": "1.0.0",
  "tag": "req-fipMetrics-aa",
  "txnId": "b3f1c2a4-1234-5678-9abc-def012345678",
  "metricCollectionId": "1769760600-REQ",
  "fromDateTime": "2026-09-30T04:30:00Z",
  "toDateTime": "2026-09-30T04:40:00Z",
  "duration": 600,
  "aaId": "sample-aa-handle",
  "enums": {
    "metricTypes": [
      "accountsDiscoverSent_adisc",
      "accountsLinkSent_alink",
      "accountsDelinkSent_adlink",
      "accountsLinkVerifySent_alinkv",
      "consentSent_cns",
      "consentNotificationSent_cnot",
      "fiReqSent_fireq",
      "fiReq200OkToFISuccFetchTimeDiff_sfireqfif",
      "fiFetchSent_fif",
      "heartBeatSent_hbt"
    ],
    "responseTimeFields": ["p50", "p95", "p99", "p100"],
    "countFields": [
      "apiTotalSentCnt",
      "api200OKRecdCnt", "api400BadReqRecdCnt", "api401UnauthorizedReqRecdCnt",
      "api403ForbiddenReqRecdCnt", "api404NotFoundRecdCnt", "api409IdempotencyErrorReqRecdCnt",
      "api412PreConditionFailedRecdCnt", "api429TooManyReqsRecdCnt", "api4xxOtherErrorsRecdCnt",
      "api500InternalServerErrorRecdCnt", "api501NotImplementedRecdCnt", "api502BadGatewayRecdCnt",
      "api503ServiceUnavailableRecdCnt", "api504GatewayTimeoutRecdCnt", "api5xxOtherErrorsRecdCnt",
      "apiOtherErrorsRecdCnt",
      "2xxRecdCnt", "3xxRecdCnt", "429RecdCnt", "4xxRecdCnt", "5xxRecdCnt", "otherRecdCnt"
    ]
  },
  "fips": [
    {
      "fipId": "SAMPLE-FIP-01",
      "metrics": [
        { "type": "adisc", "pxx": [120, 340, 480, 900],
          "counts": [50,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0] },
        { "type": "alink", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] },
        { "type": "adlink", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] },
        { "type": "alinkv", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] },
        { "type": "cns", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] },
        { "type": "cnot", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] },
        { "type": "fireq", "pxx": [200, 500, 700, 1200],
          "counts": [300,280,5,0,0,0,0,0,0,0,2,0,0,0,0,0,0,10,0,0,3,0,0] },
        { "type": "sfireqfif", "pxx": [500, 1200, 2000, 5000] },
        { "type": "fif", "pxx": [800, 1500, 2200, 4000],
          "counts": [280,270,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,3,0,0],
          "sumOfSizeOfDataPackets": "10485760",
          "noOfAccounts": 270,
          "avgLatencyPerKB": "0.04" },
        { "type": "hbt", "pxx": [0, 0, 0, 0],
          "counts": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] }
      ]
    }
  ]
}
```


# SLA Notification Payload

SNA also pushes a Notification metrics payload to the Sahamati endpoint every 10 minutes. This payload captures incoming notification traffic from FIPs to the AA, including notification counts and FI notification status breakdowns. The tag for this payload is not-fipMetrics-aa.

### Schema Reference

Notification Metric Types

<table><thead><tr><th width="89.66668701171875">Code</th><th>Full Name</th><th>Description</th></tr></thead><tbody><tr><td>finot</td><td>fiNotificationRecd_finot</td><td>FI notifications received from FIP counts and status breakdown (READY, DELIVERED, DENIED, TIMEOUT, PENDING)</td></tr><tr><td>alnot</td><td>accountLinkNotificationRecd_alnot</td><td>Account link notifications received from FIP</td></tr><tr><td>cnot</td><td>consentNotificationRecd_cnot</td><td>Consent notifications received from FIP</td></tr></tbody></table>

### Notification Count Fields

The counts array is positionally aligned to these fields:

<table><thead><tr><th width="64.333251953125">Index</th><th>Field</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>apiTotalRecdCnt</td><td>Total notifications received. For FI notifications: count only the last /FI/Notification where all FIStatus states are terminal (READY, DELIVERED, DENIED, TIMEOUT).</td></tr><tr><td>2</td><td>api200OKSentCnt</td><td>HTTP 200 OK responses sent back</td></tr><tr><td>3</td><td>api400BadReqSentCnt</td><td>HTTP 400 Bad Request responses sent</td></tr><tr><td>4</td><td>api401UnauthorizedReqSentCnt</td><td>HTTP 401 Unauthorized responses sent</td></tr><tr><td>5</td><td>api403ForbiddenReqSentCnt</td><td>HTTP 403 Forbidden responses sent</td></tr><tr><td>6</td><td>api404NotFoundSentCnt</td><td>HTTP 404 Not Found responses sent</td></tr><tr><td>7</td><td>api409IdempotencyErrorReqSentCnt</td><td>HTTP 409 Idempotency Error responses sent</td></tr><tr><td>8</td><td>api412PreConditionFailedSentCnt</td><td>HTTP 412 Precondition Failed responses sent</td></tr><tr><td>9</td><td>api429TooManyReqsSentCnt</td><td>HTTP 429 Too Many Requests responses sent</td></tr><tr><td>10</td><td>api4xxOtherErrorsSentCnt</td><td>All other 4xx error responses sent</td></tr><tr><td>11</td><td>api500InternalServerErrorSentCnt</td><td>HTTP 500 Internal Server Error responses sent</td></tr><tr><td>12</td><td>api501NotImplementedSentCnt</td><td>HTTP 501 Not Implemented responses sent</td></tr><tr><td>13</td><td>api502BadGatewaySentCnt</td><td>HTTP 502 Bad Gateway responses sent</td></tr><tr><td>14</td><td>api503ServiceUnavailableSentCnt</td><td>HTTP 503 Service Unavailable responses sent</td></tr><tr><td>15</td><td>api504GatewayTimeoutSentCnt</td><td>HTTP 504 Gateway Timeout responses sent</td></tr><tr><td>16</td><td>api5xxOtherErrorsSentCnt</td><td>All other 5xx error responses sent</td></tr><tr><td>17</td><td>apiOtherErrorsSentCnt</td><td>Responses sent with any other, non-standard status code</td></tr><tr><td>18</td><td>2xxSentCnt</td><td>All 2xx responses sent at the connection/stack level, where no parseable response body was present</td></tr><tr><td>19</td><td>3xxSentCnt</td><td>All 3xx responses sent at the connection/stack level, where no parseable response body was present</td></tr><tr><td>20</td><td>429SentCnt</td><td>HTTP 429 responses sent at the connection/stack level, where no parseable response body was present</td></tr><tr><td>21</td><td>4xxSentCnt</td><td>All other 4xx responses sent at the connection/stack level, where no parseable response body was present</td></tr><tr><td>22</td><td>5xxSentCnt</td><td>All 5xx responses sent at the connection/stack level, where no parseable response body was present</td></tr><tr><td>23</td><td>otherSentCnt</td><td>Any other response sent at the connection/stack level, uncategorized</td></tr></tbody></table>

### &#x20;Account Statuses (enums.accountStatuses)&#x20;

<table><thead><tr><th width="79">Code</th><th>Full Name</th><th>Description</th></tr></thead><tbody><tr><td>pnd</td><td>pending_pnd</td><td>Account not yet resolved to a terminal state.</td></tr><tr><td>rdy</td><td>ready_rdy</td><td>Account reached terminal state READY.</td></tr><tr><td>dnd</td><td>denied_dnd</td><td>Account reached terminal state DENIED.</td></tr><tr><td>timo</td><td>timeoutCountsOnly_timo</td><td>Account reached terminal state TIMEOUT. Carries counts only — never a pxx, since a timeout has no notification latency to measure.</td></tr><tr><td>dlv</td><td>delivered_dlv</td><td>Account reached terminal state DELIVERED.</td></tr></tbody></table>

### **Period Buckets (enums.periodBuckets)**&#x20;

| Code  | Full Name                      | Description                              |
| ----- | ------------------------------ | ---------------------------------------- |
| le365 | fiDataRangeUpto365Days\_le365  | Requested data span of 365 days or less. |
| gt365 | fiDataRangeAbove365Days\_gt365 | Requested data span above 365 days.      |

## Sample Payload

```json
{
  "agentVersion": "1.2",
  "jsonVersion": "1.0.0",
  "tag": "not-fipMetrics-aa",
  "txnId": "c4a2d3b5-2345-6789-abcd-ef0123456789",
  "metricCollectionId": "1769760600-NTF",
  "fromDateTime": "2026-09-30T04:30:00Z",
  "toDateTime": "2026-09-30T04:40:00Z",
  "duration": 600,
  "aaId": "sample-aa-handle",
  "enums": {
    "metricTypes": [
      "fiNotificationRecd_finot",
      "accountLinkNotificationRecd_alnot",
      "consentNotificationRecd_cnot"
    ],
    "countFields": [
      "apiTotalRecdCnt",
      "api200OKSentCnt", "api400BadReqSentCnt", "api401UnauthorizedReqSentCnt",
      "api403ForbiddenReqSentCnt", "api404NotFoundSentCnt", "api409IdempotencyErrorReqSentCnt",
      "api412PreConditionFailedSentCnt", "api429TooManyReqsSentCnt", "api4xxOtherErrorsSentCnt",
      "api500InternalServerErrorSentCnt", "api501NotImplementedSentCnt", "api502BadGatewaySentCnt",
      "api503ServiceUnavailableSentCnt", "api504GatewayTimeoutSentCnt", "api5xxOtherErrorsSentCnt",
      "apiOtherErrorsSentCnt",
      "2xxSentCnt", "3xxSentCnt", "429SentCnt", "4xxSentCnt", "5xxSentCnt", "otherSentCnt"
    ],
    "periodBuckets": [
      "fiDataRangeUpto365Days_le365",
      "fiDataRangeAbove365Days_gt365"
    ],
    "accountStatuses": [
      "pending_pnd",
      "ready_rdy",
      "denied_dnd",
      "timeoutCountsOnly_timo",
      "delivered_dlv"
    ],
    "finotBucketFields": [
      "accountCount_counts",
      "notifLatencyPercentiles_pxx"
    ],
    "responseTimeFields": ["p50", "p95", "p99", "p100"]
  },
  "fips": [
    {
      "fipId": "SAMPLE-FIP-01",
      "metrics": [
        {
          "type": "finot",
          "counts": [420,400,5,0,0,0,0,0,0,0,3,0,0,0,0,0,2,6,0,0,2,2,0],
          "buckets": {
            "le365": {
              "pnd": { "pxx": [100, 200, 300, 400], "counts": 20 },
              "rdy": { "pxx": [150, 300, 450, 600], "counts": 180 },
              "dnd": { "pxx": [180, 350, 500, 700], "counts": 5 },
              "timo": { "counts": 3 },
              "dlv": { "pxx": [200, 400, 600, 900], "counts": 190 }
            },
            "gt365": {
              "rdy": { "pxx": [400, 700, 900, 1200], "counts": 15 },
              "dlv": { "pxx": [450, 800, 1000, 1400], "counts": 12 }
            }
          }
        },
        {
          "type": "alnot",
          "counts": [150,145,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0]
        },
        {
          "type": "cnot",
          "counts": [80,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0]
        }
      ]
    }
  ]
}
```

> 📌 Time difference between FIReq 200 OK and failure notification (Note: All accounts are marked as DENIED or TIMEOUT in the final /FI/Notification, i.e., none of the states are READY.)


# Response Codes

The Sahamati SLA endpoint returns the following HTTP responses for each push request made by SNA:

<table><thead><tr><th width="96.3333740234375">Code</th><th width="143.6666259765625">Status</th><th>Response Body</th></tr></thead><tbody><tr><td>200</td><td>OK</td><td>{ "success": true, "message": "Successfully pushed metric", "warning": "Agent upgrade available..." }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "errorCode": "Bad request", "errorMsg": "JSON validation failed" }</td></tr><tr><td>401</td><td>Unauthorized</td><td>{ "errorCode": "Unauthorized", "errorMsg": "Auth token is invalid/expired" }</td></tr><tr><td>404</td><td>Not Found</td><td>{ "errorCode": "Not Found", "errorMsg": "Agent version incompatible" }</td></tr><tr><td>500</td><td>Server Error</td><td>{ "errorCode": "Server Error", "errorMsg": "Internal Server Error" }</td></tr></tbody></table>


# Billing

This section covers the billing data that SNA captures and submits to Sahamati on behalf of the AA, including the API endpoints, payload schema, and response codes.

SNA captures billing data at the AA-FIU interface (integration points E, F, G, H). No separate integration is needed: AAs call `sna.dispatch()` at these points and send the applicable additional attributes. SNA aggregates the data and pushes it to Sahamati automatically. See Integration Points and Additional Attributes (addlAttr).

#### What SNA Uses for Billing

* **FIU-side API transactions:** consent and data-fetch requests received from FIUs, and the AA's responses to them.
* **Consent types:** the `consentTypes` attribute sent with each /FI/request lets SNA identify whether a data fetch is for transactions or only for profile and summary, since these are billed differently.

Billing data is reported per FIU and per FIP.

#### In This Section

* **Endpoints & Authentication** - the Sahamati billing endpoint URLs and how authentication works.
* **Billing Payload** - schema reference for the billing payload.
* **Response Codes** - HTTP responses returned by the Sahamati billing endpoint.


# API Reference

This section covers the Sahamati billing endpoint that SNA pushes data to, including endpoint URLs, authentication, payload schema, and response codes.

> 📌 AAs do not call this endpoint directly. SNA pushes the billing payload on the AA's behalf. This reference is provided for transparency and troubleshooting.

#### In This Section

* **Endpoints & Authentication** - the Sahamati billing endpoint URLs and how authentication works.
* **Billing Payload** - schema reference for the billing payload.
* **Response Codes** - HTTP responses returned by the Sahamati billing endpoint.


# Endpoints & Authentication

SNA pushes billing data to a Sahamati-hosted HTTPS endpoint. Sahamati provides two variants of this endpoint, one for UAT (for testing your integration) and one for Production.

#### Billing Push Endpoints

| Environment | Endpoint URL                                               |
| ----------- | ---------------------------------------------------------- |
| Production  | <https://data.sahamati.org.in/metrics/billing/v1/push>     |
| UAT         | <https://data.uat.sahamati.org.in/metrics/billing/v1/push> |

Method: `POST`

#### Request Headers

| Header         | Required | Description                     |
| -------------- | -------- | ------------------------------- |
| `x-api-key`    | Yes      | Authentication token for the AA |
| `Content-Type` | Yes      | `application/json`              |

#### Authentication

The billing push endpoint uses token-based authentication. SNA generates the authentication token using the entityId and secret configured during deployment, and adds it to the `x-api-key` header automatically.

The `aaId` in the payload must match the AA identified by the token. Otherwise, the request is rejected.

#### IP Whitelisting

Requests are accepted only from IP addresses whitelisted for the AA. Share the outbound IP addresses of your SNA deployment with Sahamati before testing in UAT and before going live in Production. Requests from other IP addresses are rejected with HTTP 403.

> 📌 Authentication credentials are issued per AA by Sahamati. They must be stored securely and must not be committed to version control.


# Billing Payload

SNA pushes a billing payload to the Sahamati endpoint every 10 minutes. The payload captures billable data fetches for each FIU, broken down by FIP and by period. The tag for this payload is `req-billing-aa`.

#### Schema Reference

| Field                                      | Type           | Description                                                                        |
| ------------------------------------------ | -------------- | ---------------------------------------------------------------------------------- |
| agentVersion                               | string         | <p>Version of the SahamatiNet Agent generating data for the Sahamati API endpoint. |
| <br>Note: Required only when using SNA</p> |                |                                                                                    |
| jsonVersion                                | string         | Version of the JSON schema used for the Sahamati API endpoint. (e.g. "1.0.0")      |
| tag                                        | string         | `req-billing-aa` identifies this as a billing payload                              |
| txnId                                      | string         | Unique transaction ID for this push request                                        |
| metricCollectionId                         | string         | <p>Identifier for the input request                                                |
| <br>Note: Required only when using SNA</p> |                |                                                                                    |
| fromDateTime                               | string         | Start of the 10-minute reporting window (ISO 8601, UTC)                            |
| toDateTime                                 | string         | End of the 10-minute reporting window (ISO 8601, UTC)                              |
| duration                                   | int            | Duration in seconds of the reporting window (600 for 10 minutes)                   |
| aaId                                       | string         | Entity ID of the Account Aggregator. Must match the authenticated AA.              |
| enums.period                               | array\[string] | Ordered list of period buckets. See Period Enum.                                   |
| fius\[].fiuId                              | string         | Entity ID of the FIU for which billing data is reported in this block              |
| fius\[].fips\[].fipId                      | string         | Entity ID of the FIP from which data was fetched for this FIU                      |
| fius\[].fips\[].counts                     | array\[int]    | Counts positionally aligned to `enums.period`                                      |

The `counts` array must have the same length as `enums.period`. `fius` may be an empty array if there is no billable activity in the reporting window.

#### Period Enum

The `counts` array for each FIU–FIP pair is positionally aligned to the following periods, in this exact order. Each count is the number of FI/fetch requests whose data range falls within that period.

<table><thead><tr><th width="89.66668701171875">Position</th><th width="90.3333740234375">Period</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>13mo</td><td>Count of accounts in FI/fetch with data range ≥ 13 months</td></tr><tr><td>2</td><td>7mo</td><td>Count of accounts in FI/fetch with data range ≥ 7 months and &#x3C; 13 months</td></tr><tr><td>3</td><td>4mo</td><td>Count of accounts in FI/fetch with data range ≥ 4 months and &#x3C; 7 months</td></tr><tr><td>4</td><td>1mo</td><td>Count of accounts in FI/fetch with data range ≥ 1 month and &#x3C; 4 months</td></tr><tr><td>5</td><td>1w</td><td>Count of accounts in FI/fetch with data range ≥ 1 week and &#x3C; 1 month</td></tr><tr><td>6</td><td>5d</td><td>Count of accounts in FI/fetch with data range ≥ 5 days and &#x3C; 1 week</td></tr><tr><td>7</td><td>1d</td><td>Count of accounts in FI/fetch with data range ≥ 1 day and &#x3C; 5 days</td></tr><tr><td>8</td><td>ps</td><td>Count of accounts in FI/fetch with profile and summary fetches.</td></tr><tr><td>9</td><td>other</td><td>Count of accounts in FI/request that could not be mapped to a profile and summary fetch or a transaction fetch</td></tr></tbody></table>

#### Sample Payload

All values below are synthetic and for illustration only.

```json
{
  "agentVersion": "1.0.0",
  "jsonVersion": "1.0.0",
  "tag": "req-billing-aa",
  "txnId": "00000000-0000-0000-0000-000000000001",
  "metricCollectionId": "mc-test-0001",
  "fromDateTime": "2026-01-01T10:00:00Z",
  "toDateTime": "2026-01-01T10:10:00Z",
  "duration": 600,
  "aaId": "aa-test-001",
  "enums": { "period": ["13mo", "7mo", "4mo", "1mo", "1w", "5d", "1d", "ps", "other"] },
  "fius": [
    {
      "fiuId": "fiu-test-001",
      "fips": [
        {
          "fipId": "fip-test-001",
          "counts": [12, 3, 4, 5, 6, 13, 1, 3, 0]
        }
      ]
    }
  ]
}
```


# Response Codes

The Sahamati billing endpoint returns the following HTTP responses for each push request made by SNA:

<table><thead><tr><th width="96.3333740234375">Code</th><th width="143.6666259765625">Status</th><th>Response Body</th></tr></thead><tbody><tr><td>200</td><td>OK</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "status": "accepted", "blob_file": "aa-test-001/mc-test-0001" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Bad request", "errorMsg": "Please provide a valid API key" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "", "errorCode": "Bad request", "errorMsg": "Required field(s) missing: metricCollectionId" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Bad request", "errorMsg": "aaId does not match the authenticated caller" }</td></tr><tr><td>401</td><td>Unauthorized</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "auth_error", "errorMsg": "Auth token is invalid/expired" }</td></tr><tr><td>403</td><td>Forbidden</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "ip_not_whitelisted", "errorMsg": "Access denied. Your IP is not whitelisted" }</td></tr><tr><td>429</td><td>Too Many Requests</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Rate limit exceeded", "errorMsg": "Rate limit exceeded. Try again in 5 minutes." }</td></tr><tr><td>502</td><td>Bad Gateway</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "processing_error", "errorMsg": "ingest failed, retry is safe" }</td></tr></tbody></table>

A 429 response includes a `Retry-After` header with the wait time in seconds. For a 400 validation failure, `txnId` may be empty if the payload could not be parsed far enough to read it.

> 📌 A billing payload resubmitted with the same `txnId` is accepted with HTTP 200, so retrying after a 429 or 502 is safe.


# GitHub Resources

All SNA resources are hosted in a single GitHub repository. This repository contains all the artifacts you need to deploy and integrate with SNA.

<table><thead><tr><th width="157.6666259765625">Resource</th><th width="288.6666259765625">Description</th><th>Location in Repo</th></tr></thead><tbody><tr><td>SNA Helm Chart</td><td>Kubernetes Helm chart for deploying SNA to your cluster</td><td>helmchart/</td></tr><tr><td>Docker</td><td>Docker for deploying SNA to your system</td><td>docker/</td></tr><tr><td>snalib dotnet</td><td>Dotnet client library for integrating your AA service with SNA</td><td>snalib-dist/dotnet/</td></tr><tr><td>snalib Go</td><td>Go client library for integrating your AA service with SNA</td><td>snalib-dist/go/</td></tr><tr><td>snalib Java</td><td>Java client library for integrating your AA service with SNA</td><td>snalib-dist/java/</td></tr><tr><td>snalib Node</td><td>Node client library for integrating your AA service with SNA</td><td>snalib-dist/node/</td></tr><tr><td>README</td><td>Overview, setup, and quick-start guide</td><td>README.md</td></tr></tbody></table>

### Repository Link

<https://github.com/Sahamati/sahamatinet-agent-downloadables>

### Access

If you are an AA and want to get access to the repository, send an email to <jithesh.kumar@sahamati.org.in>


# FAQ SNA

Frequently asked questions on the SahamatiNet Agent (SNA), covering deployment, data sharing, resource requirements, troubleshooting, logs and error handling.

**Q: Does SNA send any raw API request or response data to Sahamati?**

No. SNA sends only aggregated metric counts and percentile values. No FI payload data, consent data, customer PII, or raw request/response bodies are ever transmitted to Sahamati.

***

**Q: What if my AA serves multiple FIPs? Does SNA handle that?**

Yes. The JSON payload supports a "fips" array where you can include metrics for each FIP separately. SNA aggregates per-FIP metrics automatically once the integration points are instrumented.

***

**Q: How do we handle the case where no transaction was done with a particular FIP?**

SNA reports only for FIPs for which it has received data. If an FIP has zero interactions in a 10-minute window, it will be omitted from that window's payload.

***

**Q: What happens if SNA is down or cannot reach the Sahamati endpoint?**

SNA includes retry logic for endpoint failures. Metrics that could not be pushed will be retried. If SNA itself is down, metrics for that window will be lost. Ensure that SNA has a health check configured in your cluster's liveness/readiness probes.

***

**Q: Do we need to make code changes to our AA service when Sahamati updates the SLA schema?**

No. Schema updates and logic changes are packaged inside new SNA versions. You only need to redeploy the updated Helm chart. Your AA service code does not need to change.

In very rare cases, if there is a change that warrants an snalib upgrade, you (AA) will have to recompile your code. If there is a change in the signature of the snalib method, you may have to make a corresponding change in your code.

***

**Q: How do we know if our integration is working correctly?**

You can validate your integration in UAT by monitoring the SNA logs in your cluster for push success/failure status and checking the response from the Sahamati SLA endpoint.

***

**Q: What languages does snalib support?**

Currently, Go, Node, .NET, and Java libraries are available. Additional language support may be planned based on ecosystem demand.

***

**Q: How are the synchronous transactions and asynchronous notifications correlated?**

Synchronous operations: API Request and API Response - They are correlated using a "transaction correlation id" (txnCorId). This is a uuid that the AA will have to generate for every RequestIn and RequestOut, when sending to SNA. This same correlation id will have to be included when sending the corresponding ResponseOut and ResponseIn to SNA.


# BuildAAthon 2024

Sahamati BuildAAthon 2024 is a hackathon organised as a part of our annual Account Aggregator (AA) community event, SamvAAd 2024.

The hackathon promises to be an exciting event, with innovative themes, masterclasses led by esteemed industry leaders, and the opportunity to develop cutting-edge solutions for India’s financial ecosystem. Participants will also have the chance to interact with a panel of distinguished judges and compete for exciting awards.

The Sahamati BuildAAthon invites participants to leverage the AA ecosystem to build innovative financial products and services. The BuildAAthon is an exciting platform for young entrepreneurs, builders, and technology enthusiasts to envision the future of Open finance in the country. The AA ecosystem is poised to catalyze the next wave of financial innovation and inclusion in India. Don’t miss out on the chance to be part of this movement!

More details about the Hackathon are available [here](https://sahamati-buildaathon-2024.devfolio.co).


# Participant Onboarding

This page is no longer relevant.

Participants in the Sahamati Buildaathon 2024 hackathon are required to assume the role of an ecosystem member from the Account Aggregator (AA) ecosystem to build innovative financial products and services. To begin this journey, teams must first onboard to the **Sahamati Sandbox environment** as one of the ecosystem members. This sandbox will serve as the platform where they can experiment, test, and bring their innovative ideas to life.

The onboarding process is a crucial step, as it ensures that the participants can simulate real-world AA ecosystem interactions and leverage the available data infrastructure to build their solutions.

## Steps for Onboarding:

#### **1. Select Ecosystem Member Type**

The participating teams need to specify the **type of ecosystem member** they wish to represent. In the AA ecosystem, there are typically four major types of members:

* **Account Aggregators (AA):** Entities that facilitate the secure sharing of user financial data between financial information providers (FIPs) and financial information users (FIUs).
* **Financial Information Providers (FIP):** Entities that hold user financial data, such as banks, NBFCs, etc.
* **Financial Information Users (FIU):** Entities that seek user financial data to provide value-added services like loans, wealth management, and more.

Based on your hackathon project’s goals and innovation focus, select the most suitable type of ecosystem member to mimic during your development process.

#### 2. Provide Details for Onboarding

After selecting the member type, the participating teams must share details about the ecosystem member they wish to simulate. This includes:

* **Ecosystem Member Type:** Specify whether you are mimicking an AA, FIP, or FIU.
* **Details of the Ecosystem Member:** Outline any specific features, services, or characteristics that define the role you plan to replicate. For example, if you are simulating an FIU, describe the type of financial data services or user needs you intend to focus on.
* **Primary Contact Information:** Share the contact details of the team lead or primary point of contact. This should include their **name** and **email address**, which will be used for communication and support throughout the hackathon.

#### **3. Complete the Onboarding Form**

To officially onboard as an ecosystem member in the hackathon, participants must complete the provided Google form. This form will capture all the necessary details required to set up the team in the Sahamati Sandbox environment. Ensure that all fields are filled accurately to avoid delays in the onboarding process.

You can access the form using the following link:\
[Google Form - Onboarding for Hackathon](https://docs.google.com/forms/d/e/1FAIpQLScMsjVgSGNwKY84a3ymm2llu-yb5wQe_x3VVeaCDMoB_qb-nw/viewform)

For more detailed information on the onboarding process and requirements, please refer to the following link:\
[Onboarding Process Details](https://developer.sahamati.org.in/sahamatinet/proxy#onboarding-process)

By following these steps, the participating teams will gain access to the Sahamati Sandbox, where they can test their innovative ideas and create financial products and services that could reshape the future of the AA ecosystem.


# Network - Scenarios

This page is no longer relevant.

In the Account Aggregator (AA) ecosystem, secure data sharing is facilitated through three key workflows, each governed by standardized ReBIT APIs. The process begins with **User Login to AA for Account Discovery & Linking**, where users provide identifiers such as mobile numbers to identify and connect their financial accounts across multiple institutions; the linking is authorized via a One-Time Password (OTP). Following this, the **Consent Workflow** enables Financial Information Users (FIUs) to obtain explicit user consent for accessing their financial data from various Financial Information Providers (FIPs), ensuring compliance with stringent privacy standards. Finally, once consent is granted, the **Financial Information (FI) Request Workflow** allows FIUs to securely request financial data from FIPs through the AA, ensuring that only authorized data is retrieved and shared, thereby maintaining privacy and data integrity throughout the process.

## [**Account Discovery & Linking**](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/account-discovery-and-linking)

**Account Discovery & Linking** allows users to identify and link their accounts across multiple financial institutions. This process is initiated when a user provides their mobile number or other identification, which the Account Aggregator uses to query Financial Information Providers (FIPs) for linked accounts. Upon identification, the user is prompted to authorize the linking via an OTP (One-Time Password). ReBIT APIs facilitate the communication and data flow between the AA, FIU, and FIP during the discovery and linking phases.

## [**Consent Workflow**](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/consent-workflow)

The **Consent Workflow** is at the core of the Account Aggregator (AA) ecosystem. It governs how a Financial Information User (FIU) obtains explicit consent from the user to access their financial data held by various Financial Information Providers (FIPs). This workflow ensures that data sharing is fully authorized by the user, adhering to stringent data privacy regulations. The consent mechanism follows a standardized flow, involving the FIU, AA, and FIP, where ReBIT APIs are used to securely request, manage, and process user consent.

## [**Financial Information (FI) Request Workflow**](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/fi-request-workflow)

The **FI Request Workflow** outlines how a Financial Information User (FIU) requests data from Financial Information Providers (FIPs) via the Account Aggregator. Once consent is granted, the FIU can initiate a financial information request, and the AA retrieves the required data from the FIP. ReBIT APIs are integral in transmitting these requests securely and ensuring that only authorized data is shared with the FIU.


# Account Discovery & Linking

This page is no longer relevant.

The Account Discovery & Linking process involves identifying the financial accounts a user holds across various institutions (FIPs) and linking them to the Account Aggregator for easy management and data access.

### **Steps Involved in Account Discovery & Linking:**

<figure><img src="https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/hiSWDQ6bMXa5D2lcJZVn/account-linking-scenario.png" alt=""><figcaption><p>Account Discovery &#x26; Linking</p></figcaption></figure>

#### **1. User Login and Identity Verification:**

The user logs into the AA application and provides their mobile number or other identity verification details. The AA then queries the FIPs to discover accounts associated with the user.

***API (Internal API Spec):*** ***/user/send-otp (POST)*****:** The user login process after entering the phone number sends an OTP for login.

***API (Internal API Spec):*** ***/user/verify-otp (POST)*****:** The user enters the OTP sent in the previous step to verify and login.

#### **2. Request to FIPs for Account Discovery:**

Upon receiving the request, each FIP searches its records for accounts associated with the provided identity (e.g., mobile number or email).

***ReBIT API Involved (FIP 2.1.0 Spec):*****&#x20;/Accounts/discover (POST)**: The FIP returns details about the user's accounts to the AA.

#### **3. User Confirms Accounts to Link:**

Once the AA receives the list of accounts from various FIPs, it presents this information to the user. The user selects the accounts they wish to link with the AA. To authorize the linking, the user receives a One-Time Password (OTP).

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/Accounts/link (POST)**: The AA sends a request to FIP to initiate linking of the account with the AA customer account.

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/Accounts/link/verify (POST)**: The user needs to provide the OTP sent with the previous step to complete the account linking.

#### **4. Accounts Linked Successfully:**

After successful OTP verification, the user’s selected accounts are linked to the AA. The FIP will send a notfication to the AA on successful OTP verification for the account linking. These accounts can now be used for data sharing in future consent workflows.

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/Account/link/Notification (POST)**: The AA confirms that the accounts have been successfully linked and communicates this to the user.

### Reference Implementation Guide & Using Simulator

For the above use case implementation, AA need to implement a few internal APIs for hanlding the user registration, login and accounts data along with the ReBIT API Specification.

In this scenario, the AA need to have a mock FIP to support the integration testing with mock response for the API requests to FIP. Below are the APIs from Simulator helpful for the implementation and integration.

* [Create a Mock FIP for Integration](broken://pages/2n5GNFvhF8mpufIuwyBV#entity-mock-register)
* [Composing Mock Response for](broken://pages/2n5GNFvhF8mpufIuwyBV#response-add)
  * Accounts Discovery
  * Accounts Linking


# Consent Workflow

This page is no longer relevant.

The consent workflow is a fundamental part of the Account Aggregator (AA) ecosystem. It ensures that Financial Information Users (FIUs) can access user data from Financial Information Providers (FIPs) only after obtaining explicit consent from the user. This workflow is governed by a series of secure and standardized interactions using the ReBIT APIs.

### **Steps Involved in Consent Workflow:**

#### Pre-requisites:

The [Account Discovery & Linking](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/account-discovery-and-linking) is handled by the user to execute the Consent workflow.

<figure><img src="https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/VDMmjrp96kbxl86Yt0mK/consent-workflow.png" alt=""><figcaption><p>Consent Workflow</p></figcaption></figure>

#### **1. FIU Initiates Consent Request:**

The FIU initiates the process by sending a consent request to the Account Aggregator (AA). The request specifies the type of financial data, the duration, and the purpose for which it is being requested. This consent request is made by the FIU to the AA.

***ReBIT API Involved (FIU 2.0.0 Spec): /Consent (POST)**:* The FIU sends the consent request to the AA using this API. The request includes the data access requirements, purpose, and duration for which access is required.

***API (AA Internal Spec): /Consent/create (POST):*** The AA create the consent artefact and stores for future use with pending status.

#### **2. AA Presents Consent to User:**

After receiving the consent request, the AA communicates with the user via its mobile app or web portal, presenting the consent details. The user reviews and either approves or denies the request.

***API (AA Internal Spec): /Consent/read (GET)**:* The AA retrieves the consent artefact details to present to the user for approval.

#### **3. User Grants Consent:**

If the user approves the consent request, the AA generates a consent artefact. This artefact is a formal document containing all the details of the user’s consent, such as the scope, purpose, and validity.

***API (AA Internal Spec): /Consent/accept (POST)**:* The AA update the status and stores the consent artefact after the user grants approval.

#### **4. AA Shares Consent with FIU & FIP:**

Once consent is granted, the AA sends the consent artefact to both the FIU and the relevant FIP. The FIP uses this consent artefact to validate requests for financial data.

***ReBIT API Involved (FIP 2.1.0 Spec): /Consent/Notification (POST)**:* The FIP is notified about the granted consent via this API, allowing it to validate the future data requests from the FIU.

#### **5. Consent Revocation (Optional):**

The user has the ability to revoke consent at any time, cutting off access to their data.

***API  (AA Internal Spec): /Consent/revoke (POST)**:* This API allows the user to revoke previously granted consent.


# FI Request Workflow

This page is no longer relevant.

The Financial Information (FI) Request Workflow allows a Financial Information User (FIU) to request data from a Financial Information Provider (FIP) via the Account Aggregator (AA), based on user consent.

### **Steps Involved in FI Request Workflow:**

#### Pre-requisites:

The [Account Discovery & Linking](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/account-discovery-and-linking), [Consent Workflow](https://developer.sahamati.org.in/no-longer-relevent/buildaathon-2024/network-scenarios/consent-workflow) are handled by the user to execute the FI request.

<figure><img src="https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/xLkxBpsWsSmsSCCdh3NH/fi-request-workflow.png" alt=""><figcaption><p>FI Request Workflow</p></figcaption></figure>

#### **1. FIU Sends FI Request to AA:**

After the user’s consent is obtained, the FIU sends a Financial Information (FI) request to the AA to retrieve the data from the relevant FIPs. This request contains the details of the data required (such as bank account statements, loan details, etc.).

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/FI/Request (POST)**: The FIU sends the FI request to the AA specifying the type of financial data required and the consent artefact.

#### **2. AA Forwards FI Request to FIP:**

The AA validates the request against the consent artefact and forwards it to the relevant FIP. The FIP retrieves the requested data from its system.

***ReBIT API Involved (FIP 2.1.0 Spec):*****&#x20;/FI/Request (POST)**: The AA forwards the FI request to the FIP, including the consent artefact and data requirements.

#### **3. FIP Shares the Session Id with AA:**

Upon receiving the request and validating it against the consent artefact, the FIP provides a session Id to use as reference to fetch the data once it is ready.

#### **4. FIP sends a Notification to AA:**

FIP asyncronously compose the requested FI data and sends a notification to AA about the readiness to trigger the FI fetch request to get the data.

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/FI/Notification (POST)**: The FIP sends a notification once the FI data composed and available to fetch.

#### **5. AA Fetches FI data from FIP & Sends a Notification to FIU:**

Once the AA receives the notification from the FIP, it fetches the financial information from the FIP. This data is provided in the agreed format and scope as per the consent.

Once the FI data is ready, AA sends a notification to FIU about the readiness of FI data to fetch by FIU from AA.

***ReBIT API Involved (FIP 2.1.0 Spec):*****&#x20;/FI/fetch (POST)**: The AA sends a FI fetch request to FIP to receive the FI data for the specific Session Id.

***ReBIT API Involved (FIU 2.0.0 Spec):*****&#x20;/FI/Notification (POST)**: The AA sends a notification once the FI data available to fetch.

#### **4. AA Delivers Data to FIU:**

Once the AA receives the data from the FIP, it delivers the financial information to the FIU. This data is provided in the agreed format and scope as per the consent.

***ReBIT API Involved (AA 2.1.0 Spec):*****&#x20;/FI/fetch (POST)**: The AA delivers the financial information to the FIU based on the initial request.

#### **5. FI Request Completion:**

After the FIU receives the data, the FI request workflow is marked as complete. The FIU can now process the data in line with the consent provided by the user.


# SahamatiNet

**SahamatiNet** is the technological infrastructure developed and maintained by Sahamati to support the Account Aggregator (AA) ecosystem. It comprises a set of specifications, Application Programming Interfaces (APIs), and services aimed at improving the ecosystem's performance, trust, and reliability. By establishing a robust infrastructure, SahamatiNet addresses key challenges such as interoperability, data compliance, data quality, and operational efficiency, thereby ensuring a seamless and trustworthy experience for AA ecosystem entities involved.

Below are the current focus areas of SahamatiNet:

* **Interoperability**: Move from the current “bilateral-trust” model to a “network-trust” framework that guarantees interoperability between all members of the AA ecosystem.
* **Fair Use Compliance**: Enable a policy-based automated framework that ensures compliance to fair use of consumer's consent and data in the AA ecosystem.
* **Network Observability**: Digital infrastructure to observe operational & technical aspects of the AA ecosystem, and to discover actionable insights.


# Fair Use Compliance

### Fair Use Parameters

Fair Use Parameters establish guidelines for data collection practices within the AA ecosystem, ensuring transparency, fairness, and compliance. They define the bounds for attributes of consent artefact that can be employed for a specific use case. They are collaboratively defined by FIUs, AAs, the Fair Use Committee, and the Sahamati Governing Council.

Each use case is mapped to one Purpose Code and the AA ecosystem is collaborating with ReBIT to expand the list of purpose codes to ensure comprehensive coverage of various use cases at a granular level.

#### Fair Use Parameters Sample

```javascript
{
  "Purpose Code": "103",
  "Use Case": "Underwriting Risk: Underwriting a loan application",
  "License Types": "Bank, NBFC, HFC",
  "Fair Use Parameters": {
    "FITypes": [
      "DEPOSIT", "TERM_DEPOSIT", "RECURRING_DEPOSIT", "SIP", "CP",
      "GOVT_SECURITIES", "EQUITIES", "BONDS", "DEBENTURES", "MUTUAL_FUNDS",
      "ETF", "IDR", "CIS", "AIF", "INSURANCE_POLICIES", "NPS", "INVIT",
      "REIT", "GSTR1_3B", "LIFE_INSURANCE", "GENERAL_INSURANCE", "OTHER"
    ],
    "Consent Types": ["Profile", "Summary", "Transactions"],
    "FetchType": "ONETIME",
    "MaximumFrequency": {
      "unit": "MONTH",
      "value": 1
    },
    "MaximumFIDataRange": {
      "unit": "MONTH",
      "value": 14
    },
    "Maximum Consent Expiry": {
      "unit": "MONTH",
      "value": 1
    },
    "Maximum Data Expiry": {
      "unit": "MONTH",
      "value": 1
    },
    "Consent Mode": ["Store", "View"]
  }
}
```

### FIUs & AAs are expected to align their usage of consents within the bounds of these parameters, ensuring consistency and adherence to established parameters.

### Role of AA Ecosystem Members

* **ReBIT**
  * Publish expanded list of purpose codes
* **Sahamati**
  * Fair Use Parameters APIs
  * Fair Use Policies
  * Provide Common Infrastructure
  * Fair Use Reporting to relevant parties
* **FIUs**
  * Adopt new purpose code definitions and fair use parameters
* **AAs**
  * Fair Use Policy enforcement for consent & FI requests
  * Report Fair Use data
* **FIPs**
  * No Changes required

### Fair Use Policy Framework

A policy-based automated framework that ensures compliance to fair use of consumer's consent and data in the AA ecosystem. AAs must enforce the Fair Use Policy for consent on all "Consent Request" and “FI Request” APIs.&#x20;

<figure><img src="https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/2AMeHe0YMAlzRYKTtSk3/fairuse-policy-framework.png" alt=""><figcaption><p>AA Fair Use Policy Architecture</p></figcaption></figure>

The fair use policy framework consists of three main Policy components and a Policy Agent:

#### Policy Components

1. **Input**: The payload of the consent/FI request API
2. **Data**: Fair Use parameters and Fair use policies.
3. **Policy**: A set of rules applied to the consent/FI request API to ensure the fair use of consent and data. These rules primarily define the logic to evaluate the applicability of a given purpose code for the FIU by validating the consent parameters sent in the input against the parameters in the Fair Use parameters data. Policy rules should be defined as per a standard specification agreed and adopted by the Sahamati ecosystem.

#### Policy Agent

Policy Agent is responsible for evaluating the policy rules, as defined in the policy, against the API input using the data component of the policy. Output of the policy agent will be one of the output values defined in the policy rules. For example, the output of evaluating the fair use policy could be:

* **accept**: accept the incoming consent request and process it further (i.e. present to the consumer normally)
* **reject**: reject the incoming consent request and return an appropriate error to the FIU (e.g.: if the consent parameters are out of range by a large value)
* **report**: accept the request and report non-compliance


# Network Observability

Observability is a widely recognized practice within the realm of digital payments, enabling stakeholders such as payment processors, banks, merchants, and regulatory bodies to monitor transactions, detect anomalies, optimize performance, and ensure compliance. This practice has been instrumental in enabling the digital payments ecosystem to swiftly detect, manage, and resolve issues in real-time, contributing significantly to its growth and maturity.

In open & decentralized networks, critical factors that contribute to the success of networks include:

* **Adherence to Protocols:** for seamless integration among all members
* **High Success Rate:** for continuous growth of network, its members and consumers
* **Operational Efficiency:** for becoming scale efficient and drive population scale adoption
* **Policy Compliance:** for improving trust, and fostering fair & competent ecosystem

Network Observability is a structured approach to observe business, operational, & technical aspects of a network, and to discover actionable insights. Network observability provides a shared understanding among all members regarding the network's growth and health by identifying key metrics and establishing standard definitions. This fosters compliance with API protocols, facilitates the observation and improvement of operational efficiency, and encourages adherence to network policies.

**Network Observability plays a pivotal role in monitoring and achieving the key objectives of the network, thereby ensuring optimal Network Performance, Health & Growth**

<figure><img src="https://content.gitbook.com/content/CKUjTKikPLYOjZEtClEd/blobs/aBfrtUcX9eOtynkofNjo/Observability%20in%20AA%20context.png" alt=""><figcaption><p>Observability in AA context</p></figcaption></figure>

## Network Observability in the AA context:

At this point in time, most data that is reported to Sahamati’s current network monitoring system (SAANS V2.0) is coming from AAs and includes:&#x20;

1. Daily MIS information about accounts linked, consents raised, consents fulfilled etc.&#x20;
2. FIP Technical Health information reported to SAANS

While both systems have been crucial for the ecosystem, they have notable shortcomings, such as:

1. They provide only 10-minute summaries rather than precise counts.
2. They offer only an indicative view of performance.
3. Data is reported only by the AAs for the AA<>FIP leg of transactions, offering only a partial transaction view.
4. Blind spots occur at the end of each day.
5. They do not address failures caused by scheduled downtimes and end-of-day processes.

These limitations underscore the importance of network observability, and Sahamati Network Observability aims to address these shortcomings, with the following as its primary objectives:

1. **A unified view of truth that all parties involved can agree with:** With the limitations in SAANS V2.0, where the system only captures 10-minute summaries of the FIP technical health, a significant dimension of the information gets dropped and hence starts to cause blind corners in the ecosystem.&#x20;
2. **A source of truth for automated support and dispute resolution:** Currently, the support system and dispute resolution rely heavily on bilateral sharing of transaction data for identification and resolution of transactions and failures, Sahamati Network Observability will allow for pinpointing of failure points and, in most scenarios, automated identification.&#x20;
3. **A mechanism for automated recon and billing:** With the pricing framework coming into the picture now, Sahamati Network Observability will enable automated reconciliation and billing for all members based on the data reported to telemetry
4. **Input into fraud engine:** As Sahamati is currently working on a fraud detection engine to protect customers, Sahamati Network Observability will play an integral role in its design and implementation.&#x20;
5. **Regulatory reporting:** Sahamati Network Observability will provide end-to-end visibility and allow entities to create regulatory reports and insights through the system itself for their reporting plus it will allow regulators to observe the performance and growth of the AA ecosystem.&#x20;
6. **Fair Use of AA:** Sahamati Network Observability will enable the detection and reporting of Fair Use violations and will allow for Sahamati as network facilitators to enable a smooth ecosystem.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXf2GWN2akhoz9r8JNCvTh__F7R-cALhNm1ET42wUeuL0dzGISfrfJFM1ZEZBSVe5bb4qjvDhOASD-0bMkskk5B0MR_-B0R5yyituv38Y2sGPA7huyoHRyhMdk9aDB9xldRkwSnNsRwa1Eh722i1jjrnApSy?key=4nAz-0z2zgBDJlwmnL9SeQ" alt=""><figcaption><p>Sahamati Network Observability</p></figcaption></figure>

### What problems does it solve in the AA ecosystem?

Over the past year, the AA ecosystem has grown significantly, processing over 60 million consents. However, this growth has revealed several gaps and challenges:

1. **Multiple Versions of the Truth**: Different members have conflicting data, leading to inconsistencies.
2. **Poor Network Visibility**: Difficulties in reconciling data across the network due to limited visibility.
3. **Transparency Issues**: Lack of transparency for both internal and external stakeholders.
4. **Fragmented Datasets**: Data is scattered and hard to access.
5. **Long Debugging Cycles**: Extended time required for debugging and resolving issues.
6. **Regulatory Reporting Delays**: Slow data collection for regulatory compliance.
7. **Lack of Actionable Insights**: Insufficient generation of actionable insights.
8. **Poor Customer Experience**: Inadequate visibility leading to subpar customer experience.
9. **Hard-to-Trace Failures**: Failures are difficult to trace and often identified only after they occur.
10. **Decision-Making Transparency**: Lack of clarity in decision-making regarding technical retries.
11. **High Customer Drop-Off Rates**: Significant loss of customers due to these issues.

## Key design principles

It’s important that there is a strong foundation setup with the help of principles that allow only relevant information to flow transparently across members while protecting the rights of each member to maintain their unique business propositions and interests protected. Therefore, Sahamati Network Observability has been designed keeping in mind following design principles:

* Minimalism, simplicity and efficiency in design, emphasizing the importance of minimizing unnecessary complexity and features to achieve optimal performance and usability.
* Rather than imposing strict regulations or mandates, encourage voluntary participation and collaboration among members, fostering a sense of ownership and cooperation within the ecosystem.
* View the network as a collaborative effort involving all members, where each member contributes to the overall success and functionality of the network, promoting a sense of shared responsibility and mutual benefit.
* Sahamati, in this context, serves as a facilitator for establishing standardized protocols and frameworks within the network, providing guidelines and support to ensure interoperability and consistency across different components and members.
* Prioritize anonymity and the exclusion of sensitive information in the collection and analysis of business metrics, safeguarding privacy and confidentiality while still enabling effective monitoring and evaluation of network performance.
* Extend anonymity to technical metrics and logs at the individual member level, ensuring that network monitoring and troubleshooting activities do not compromise the privacy or security of members' data.
* Adopt open standards for data specification, promoting interoperability, accessibility, and collaboration among different stakeholders and systems.


# Telemetry

Telemetry refers to the automated communication process by which measurements and other data are collected at remote or inaccessible points and then transmitted to receiving equipment for monitoring and analysis. In simpler terms, telemetry involves gathering data from sensors or instruments and transmitting it to a central location for analysis or observation.

Telemetry, particularly in the context of network observability, can help address the outlined requirements in the following ways:

1. **Unified Source of Truth:**
   * Telemetry allows for the collection of real-time data from various network components, providing a consistent and centralized source of information.
   * By aggregating telemetry data from different members, it becomes easier to reconcile discrepancies and establish a unified view of truth through analytics and visualization tools.
2. **Real-Time Access to Data:**
   * Telemetry systems capture and transmit data in real-time, enabling immediate access to critical information for all members.
   * With telemetry, members can monitor network performance metrics, detect anomalies, and respond promptly to issues, thereby improving operational visibility and decision-making.
3. **Sensitivity of Data, Access Control, and Reciprocity:**
   * Telemetry solutions can be designed with built-in security features such as encryption, access controls, and role-based authentication to safeguard sensitive data.
   * Access to telemetry data can be restricted based on predefined permissions and agreements, ensuring that only authorized users with verified identities can access relevant information.
   * Reciprocity can be enforced by making data sharing a prerequisite for accessing shared telemetry insights, promoting collaboration and transparency among members.
4. **Development Efforts and Deployment Cycles:**
   * Telemetry frameworks and platforms often offer standardized interfaces and APIs, simplifying integration and deployment across diverse environments.
   * Modular telemetry architectures allow for easy customization and scalability, accommodating the needs and resources of different members without disrupting existing systems.
   * Telemetry solutions can be deployed incrementally, allowing members to adopt and scale observability capabilities at their own pace while minimizing deployment complexities.

Overall, telemetry plays a crucial role in addressing the requirements of network observability by providing real-time insights, ensuring data privacy and security, and facilitating seamless collaboration among members.

Sahamati is adopting [Open Network telemetry specification](https://github.com/Sunbird-Obsrv/network-telemetry-spec) derived from the [OpenTelemetry](https://opentelemetry.io/docs/concepts/) standards, which is a globally adopted standard for observability.


# Observability Services

Sahamati Network Observability provides the following services (not exhaustive) by consuming the telemetry data:

1. **Realtime Network Health & Performance**
   * Sahamati continuously monitors network nodes, services, and traffic in real-time, providing insights into the health and performance of the network.
   * Alerts and notifications based on telemetry data enable proactive troubleshooting for members.
2. **Fraud Monitoring**
   * Sahamati uses telemetry to analyze transaction data, user behavior, and access patterns to identify potential fraudulent activities.
   * Machine learning algorithms are applied to telemetry data to detect suspicious patterns and anomalies indicative of fraud or security breaches.
   * Real-time alerts can be generated for immediate intervention, while historical telemetry data aids in forensic analysis and fraud prevention strategies.
3. **Dispute resolution**
   * Telemetry records and timestamps all network transactions and interactions, serving as a reliable source of evidence in dispute resolution scenarios.
   * Members can access telemetry data to reconstruct events, verify claims, and resolve discrepancies transparently.
   * Detailed telemetry logs and audit trails facilitate collaboration among stakeholders and expedite dispute resolution processes.
4. **Billing and reconciliation**
   * Telemetry captures usage data and transaction details, which are essential for accurate billing and reconciliation processes.
   * Automated billing systems can leverage telemetry data to generate invoices based on actual usage, minimizing billing errors and disputes.
   * Telemetry insights enable members to reconcile accounts and verify charges, ensuring transparency and accountability in financial transactions.
5. **Network Usage**
   * Sahamati provides granular visibility into network usage patterns, including application usage, user demographics, and geographic distribution.
   * Members can analyze telemetry data to understand resource consumption trends, optimize network capacity, and tailor services to user needs.
   * Usage analytics derived from telemetry data inform business decisions, marketing strategies, and service enhancements.
6. **Public Dashboards & Reports**
   * Sahamati offers customizable dashboards and reporting tools for visualizing and sharing network performance metrics and insights.
   * Public dashboards provide stakeholders with real-time access to key telemetry data, fostering transparency and accountability.
   * Reports generated from telemetry data serve as documentation for compliance, audits, and performance evaluations.
7. **Open Datasets**
   * Telemetry data can be anonymized and aggregated to create open datasets that facilitate research, analysis, and innovation.
   * Open datasets enable academic institutions, developers, and data scientists to conduct studies, develop applications, and contribute to the advancement of network technologies.
   * Sahamati may offer APIs or data sharing initiatives to make anonymized telemetry data accessible to the broader community.
8. **Data Exhaust**
   * Telemetry generates vast amounts of data exhaust, including logs, metrics, and event streams generated by network devices and applications.
   * Data exhausts serve as a valuable resource for data mining, anomaly detection, and predictive analytics.
   * Advanced analytics techniques, such as machine learning and artificial intelligence, can leverage telemetry data exhausts to derive actionable insights and drive continuous improvement initiatives.


# Data Governance

In the context of Network Observability, the guiding principles for data governance will be:

* **Data minimization:** Collecting the minimum data necessary to provide an independent view of network growth and health.
* **Privacy by Design:** All data collection for network observability will ensure that data privacy is implemented by design and to the extent feasible, anonymized or pseudonymized data shall be used for computing and reporting network growth and health metrics.
* **Principle of least privilege:** Even though the majority of the data for network observability is expected to have non-identifiable data, in exceptional scenarios where AA or the member has access to any data for computational purposes, the principle of least privilege shall be adopted.
* **Data as a shared asset:** The data submitted by members to enable network observability shall be treated as a shared asset of all members of the AA network and no single entity will have rights or privileges over the Network Observability data.

In line with the above principles, the network observability framework will ensure that minimal, non-identifiable data is utilized to compute and report network health and growth metrics and each stakeholder has the least or minimal set of privileges required to access or view the data. While establishing data governance, Sahamati will also consider various parameters like anonymized personally identifiable information (PII), aggregate, identity-less, non-business sensitive data and confidentiality, to ensure the protection and responsible handling of data.

Further, below data governance components have to be detailed out in the network data policy. This policy will be established during the implementation of Network Observability and may undergo several update cycles following its initial implementation.

* Receiving the data from members
* Storing of the data by Sahamati and members
* Backup schedules and duration
* Archiving old data
* Purging of expired data
* Sharing of data within and outside the network


# Page 1


