API reference / CAS (portfolio fetch)

CAS provider matrix

Which RTAs can be requested server-side today (KFintech yes; NSDL/CDSL need an investor OTP, so use the mailbox scan instead).

GET/v1/cas/request/providers
Authentication
Bearer token
Scope
cas:request

Before you integrate

  • Check request_automatable before placing a request. For sources where it is false, use the mailbox scan or an upload instead.

Sample code

Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.

curl -sS -X GET 'https://grappi.ai/v1/cas/request/providers' \
  -H "Authorization: Bearer $GRAPPI_API_KEY"

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": {
    "sources": [
      {
        "source": "kfintech",
        "covers": "mutual_funds",
        "request_automatable": true
      },
      {
        "source": "cams",
        "covers": "mutual_funds",
        "request_automatable": true
      },
      {
        "source": "nsdl",
        "covers": "demat",
        "request_automatable": false,
        "reason": "Needs a one-time code sent to the investor, so read the statement from their mailbox instead."
      },
      {
        "source": "cdsl",
        "covers": "demat",
        "request_automatable": false,
        "reason": "Needs a one-time code sent to the investor, so read the statement from their mailbox instead."
      }
    ],
    "captcha_solver": {
      "available": true,
      "one_call_request": "POST /v1/cas/request/auto"
    }
  }
}

Response fields

FieldTypeDescription
sourcesarrayEvery statement issuer and whether a request can be placed with it from the server.
sources[].sourcestringkfintech, cams, nsdl or cdsl.
sources[].coversstringmutual_funds or demat.
sources[].request_automatablebooleanTrue if a request can be placed through the API.
sources[].reasonstringWhy it cannot, when request_automatable is false.
captcha_solverobjectWhether the one-call request is available.
captcha_solver.availablebooleanTrue if the one-call request works.
captcha_solver.one_call_requeststringThe one-call route when available, otherwise a pointer to the two-step flow.

Errors

Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.