> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mf-atlas.space/llms.txt
> Use this file to discover all available pages before exploring further.

# MF APIs for Developers

> Build custom onboarding, transaction, and reporting workflows with clean, well-documented APIs. Direct integration with BSE/NSE MFSS, KFin, and CAMS.

Build custom client portals, transaction pipelines, and reporting dashboards with REST APIs that connect directly to BSE/NSE MFSS, KFin, and CAMS. Clean responses, consistent error handling, and webhooks for every state change.

## What you can build

<CardGroup cols={2}>
  <Card title="Client Onboarding" icon="user-plus">
    e-KYC via Aadhaar OTP or biometric, PAN validation, and folio linking — all through a single API flow. Generate mandate forms and set up NACH e-Mandates programmatically.
  </Card>

  <Card title="Transactions" icon="arrow-right-left">
    Execute purchases, redemptions, switches, SIP registrations, and STP/SWP setups. Direct integration with BSE/NSE MFSS for order routing and status tracking.
  </Card>

  <Card title="Portfolio & Reporting" icon="bar-chart-3">
    Fetch real-time portfolio valuations, NAV data, capital gains statements, and XIRR reports. Generate client-ready PDFs with your branding through the API.
  </Card>

  <Card title="Webhooks" icon="webhook">
    Subscribe to real-time events — transaction status changes, SIP registrations, mandate approvals, NAV updates, and KYC status changes. Reliable delivery with retry and dead-letter queues.
  </Card>

  <Card title="Scheme Database" icon="database">
    Access the complete AMFI scheme master with NAV history, expense ratios, AUM, and fund manager details. Filter by category, AMC, or performance metrics.
  </Card>

  <Card title="Compliance & Audit" icon="shield-check">
    Generate compliance reports, audit trails, and suitability assessments through the API. Every transaction is logged with timestamps, IP addresses, and client consent records.
  </Card>
</CardGroup>

## Quick start

### Authentication

All API requests require an API key. You can generate keys from the Atlas dashboard under **Settings → API Keys**.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.anvitra.ai/v1/investors \
      -H "Authorization: Bearer atlas_sk_8a2f..." \
      -H "Content-Type: application/json"
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from atlas import Atlas

    client = Atlas(api_key="atlas_sk_8a2f...")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import { Atlas } from '@anvitra/atlas-sdk';

    const client = new Atlas({ apiKey: 'atlas_sk_8a2f...' });
    ```
  </Tab>
</Tabs>

### Onboard an investor

Create a new investor with e-KYC and link their existing folios.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.anvitra.ai/v1/investors \
      -H "Authorization: Bearer atlas_sk_8a2f..." \
      -H "Content-Type: application/json" \
      -d '{
        "pan": "ABCDE1234F",
        "kyc_mode": "aadhaar_otp",
        "email": "investor@example.com",
        "mobile": "+919876543210",
        "date_of_birth": "1985-03-15"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    investor = client.investors.create(
        pan="ABCDE1234F",
        kyc_mode="aadhaar_otp",
        email="investor@example.com",
        mobile="+919876543210",
        date_of_birth="1985-03-15"
    )

    print(f"Investor {investor.id} created — KYC: {investor.kyc_status}")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const investor = await client.investors.create({
      pan: 'ABCDE1234F',
      kycMode: 'aadhaar_otp',
      email: 'investor@example.com',
      mobile: '+919876543210',
      dateOfBirth: '1985-03-15'
    });

    console.log(`Investor ${investor.id} — KYC: ${investor.kycStatus}`);
    ```
  </Tab>
</Tabs>

### Execute a SIP transaction

Register a monthly SIP for a specific scheme via BSE MFSS.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.anvitra.ai/v1/transactions \
      -H "Authorization: Bearer atlas_sk_8a2f..." \
      -H "Content-Type: application/json" \
      -d '{
        "investor_id": "inv_8a2f3b8e",
        "scheme_code": "120503",
        "amount": 15000,
        "type": "SIP",
        "frequency": "monthly",
        "installments": 120,
        "mandate_id": "mand_9c1d..."
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    tx = client.transactions.create(
        investor_id="inv_8a2f3b8e",
        scheme_code="120503",
        amount=15000,
        type="SIP",
        frequency="monthly",
        installments=120,
        mandate_id="mand_9c1d..."
    )

    print(f"Transaction {tx.id} — {tx.status} via BSE MFSS")
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const tx = await client.transactions.create({
      investorId: 'inv_8a2f3b8e',
      schemeCode: '120503',
      amount: 15000,
      type: 'SIP',
      frequency: 'monthly',
      installments: 120,
      mandateId: 'mand_9c1d...'
    });

    console.log(`Transaction ${tx.id} — ${tx.status} via BSE MFSS`);
    ```
  </Tab>
</Tabs>

### Subscribe to webhooks

Register a webhook endpoint to receive real-time event notifications.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://api.anvitra.ai/v1/webhooks \
      -H "Authorization: Bearer atlas_sk_8a2f..." \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://your-app.com/webhooks/atlas",
        "events": [
          "transaction.status_changed",
          "mandate.approved",
          "kyc.status_changed",
          "nav.updated"
        ]
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    webhook = client.webhooks.create(
        url="https://your-app.com/webhooks/atlas",
        events=[
            "transaction.status_changed",
            "mandate.approved",
            "kyc.status_changed",
            "nav.updated"
        ]
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const webhook = await client.webhooks.create({
      url: 'https://your-app.com/webhooks/atlas',
      events: [
        'transaction.status_changed',
        'mandate.approved',
        'kyc.status_changed',
        'nav.updated'
      ]
    });
    ```
  </Tab>
</Tabs>

## API endpoints overview

| Endpoint                   | Method        | Description                            |
| -------------------------- | ------------- | -------------------------------------- |
| `/v1/investors`            | `GET` `POST`  | List and create investors              |
| `/v1/investors/:id`        | `GET` `PATCH` | Retrieve and update investor details   |
| `/v1/investors/:id/folios` | `GET`         | List folios linked to an investor      |
| `/v1/transactions`         | `GET` `POST`  | List and create transactions           |
| `/v1/transactions/:id`     | `GET`         | Get transaction status and details     |
| `/v1/portfolios/:id`       | `GET`         | Get portfolio valuation and holdings   |
| `/v1/schemes`              | `GET`         | Search AMFI scheme master              |
| `/v1/schemes/:code/nav`    | `GET`         | Get current and historical NAV         |
| `/v1/mandates`             | `GET` `POST`  | List and create NACH e-Mandates        |
| `/v1/webhooks`             | `GET` `POST`  | Manage webhook subscriptions           |
| `/v1/reports`              | `POST`        | Generate compliance and client reports |

## FAQ

<AccordionGroup>
  <Accordion title="What are the API rate limits?">
    Standard plans include 1,000 requests per minute and 50,000 requests per day. Enterprise plans offer custom rate limits. All responses include `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers.
  </Accordion>

  <Accordion title="Which transaction platforms are supported?">
    Atlas integrates with BSE StarMF and NSE MFSS for order routing. Both platforms are available through the same API — just specify the `platform` parameter in your transaction request.
  </Accordion>

  <Accordion title="Are SDKs available?">
    Yes. Official SDKs are available for Python (`pip install atlas-sdk`), JavaScript (`npm install @anvitra/atlas-sdk`), and Go (`go get github.com/anvitra/atlas-sdk-go`). All SDKs are open source.
  </Accordion>

  <Accordion title="How does webhook delivery work?">
    Atlas sends HTTPS POST requests to your registered webhook URL with a JSON payload. Failed deliveries are retried with exponential backoff for up to 24 hours. Each webhook includes an `X-Atlas-Signature` header for verification.
  </Accordion>

  <Accordion title="Is there a sandbox environment?">
    Yes. Use `atlas_sk_test_...` keys against `https://api.sandbox.anvitra.ai` for testing. The sandbox mirrors production behavior with mock data — no real transactions are executed.
  </Accordion>
</AccordionGroup>
