API reference / CAS (portfolio fetch)

3.2 CAS Auto Read: upload

Upload a statement PDF and get its folios, holdings and transactions as JSON.

POST/v1/cas/read
Authentication
Bearer token
Scope
cas:read

Before you integrate

  • Send as multipart/form-data, not JSON: the PDF in the file field and the other fields as form fields.
  • A statement is always locked: send password (CAMS, KFintech) or pan (NSDL, CDSL) or the call is refused.
  • When review_required is true, have a person check the figures before relying on them.

Form fields (multipart upload)

FieldTypeRequiredDescription
filestringYesThe statement PDF, sent as the multipart form field named file. Up to 15 MB.
passwordstringNoThe password chosen when the statement was requested (CAMS, KFintech); 1 to 64 characters. Send this or pan.
panstringNoThe investor's PAN, which opens NSDL and CDSL statements. Send this or password.
dobstringNoDate of birth as YYYY-MM-DD, for statements that need it.
sourcestringNoWho issued the statement, if you know it: kfintech, cams, nsdl or cdsl. Detected when left out.

Sample code

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

curl -sS -X POST 'https://grappi.ai/v1/cas/read' \
  -H "Authorization: Bearer $GRAPPI_API_KEY" \
  -F "file=@statement.pdf" \
  -F 'password=Sample@2026' \
  -F 'source=cams'

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": {
    "source": "cams",
    "statement_type": "detailed",
    "investor_name": "ASHA RAO",
    "investor_email": "asha.rao@example.com",
    "pan": "******234F",
    "period_from": "2023-04-01",
    "period_to": "2024-03-31",
    "holding_count": 1,
    "transaction_count": 1,
    "total_value_minor": 4412035,
    "folios": [
      {
        "folio": "1234567/89",
        "amc": "Sample Mutual Fund",
        "scheme": "Sample Liquid Fund - Growth",
        "isin": "INF123K01014",
        "units": 124.239,
        "nav_minor": 35512,
        "value_minor": 4412035,
        "cost_minor": 4000250,
        "as_of": "2024-03-31"
      }
    ],
    "demat": [],
    "transactions": [
      {
        "folio": "1234567/89",
        "scheme": "Sample Liquid Fund - Growth",
        "isin": "INF123K01014",
        "date": "2023-06-12",
        "description": "Purchase",
        "type": "purchase",
        "amount_minor": 4000250,
        "units": 124.239,
        "nav_minor": 32198,
        "balance_units": 124.239
      }
    ],
    "confidence": 0.97,
    "review_required": false,
    "warnings": []
  }
}

Response fields

FieldTypeDescription
sourcestringWho issued the statement: kfintech, cams, nsdl or cdsl; null if it could not be told.
statement_typestringsummary or detailed; null if unknown.
investor_namestringInvestor name printed on the statement.
investor_emailstringInvestor email printed on the statement.
panstringThe investor's PAN, masked.
period_fromstringStatement period start.
period_tostringStatement period end.
holding_countintegerNumber of mutual-fund folios plus demat holdings found.
transaction_countintegerNumber of transactions found; 0 on a summary statement.
total_value_minorintegerTotal market value in paise, when the statement prints one.
foliosarrayMutual-fund folio lines.
folios[].foliostringFolio number.
folios[].amcstringFund house name.
folios[].schemestringScheme name.
folios[].isinstringScheme ISIN.
folios[].unitsnumberUnits held.
folios[].nav_minorintegerNAV per unit in paise.
folios[].value_minorintegerMarket value in paise.
folios[].cost_minorintegerCost of holding in paise, when printed.
folios[].as_ofstringValuation date.
dematarrayDemat holding lines (NSDL and CDSL statements).
demat[].dp_idstringDepository participant id.
demat[].client_idstringDemat client id.
demat[].isinstringSecurity ISIN.
demat[].securitystringSecurity name.
demat[].quantitynumberQuantity held.
demat[].price_minorintegerPrice per unit in paise.
demat[].value_minorintegerMarket value in paise.
demat[].asset_classstringAsset class as printed on the statement.
demat[].as_ofstringValuation date.
transactionsarrayTransactions; only present on a detailed statement.
transactions[].foliostringFolio number, for mutual-fund transactions.
transactions[].schemestringScheme name.
transactions[].isinstringISIN.
transactions[].datestringTransaction date.
transactions[].descriptionstringDescription as printed.
transactions[].typestringFor example purchase, redemption, switch_in, switch_out or dividend.
transactions[].amount_minorintegerAmount in paise.
transactions[].unitsnumberUnits bought or sold.
transactions[].nav_minorintegerNAV per unit in paise.
transactions[].balance_unitsnumberUnit balance after the transaction.
confidencenumberHow sure the reading is, from 0 to 1.
review_requiredbooleanTrue when confidence is low and a person should check the figures.
warningsarrayPlain-text issues found while reading, if any.

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.