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)
| Field | Type | Required | Description |
|---|---|---|---|
file | string | Yes | The statement PDF, sent as the multipart form field named file. Up to 15 MB. |
password | string | No | The password chosen when the statement was requested (CAMS, KFintech); 1 to 64 characters. Send this or pan. |
pan | string | No | The investor's PAN, which opens NSDL and CDSL statements. Send this or password. |
dob | string | No | Date of birth as YYYY-MM-DD, for statements that need it. |
source | string | No | Who 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
| Field | Type | Description |
|---|---|---|
source | string | Who issued the statement: kfintech, cams, nsdl or cdsl; null if it could not be told. |
statement_type | string | summary or detailed; null if unknown. |
investor_name | string | Investor name printed on the statement. |
investor_email | string | Investor email printed on the statement. |
pan | string | The investor's PAN, masked. |
period_from | string | Statement period start. |
period_to | string | Statement period end. |
holding_count | integer | Number of mutual-fund folios plus demat holdings found. |
transaction_count | integer | Number of transactions found; 0 on a summary statement. |
total_value_minor | integer | Total market value in paise, when the statement prints one. |
folios | array | Mutual-fund folio lines. |
folios[].folio | string | Folio number. |
folios[].amc | string | Fund house name. |
folios[].scheme | string | Scheme name. |
folios[].isin | string | Scheme ISIN. |
folios[].units | number | Units held. |
folios[].nav_minor | integer | NAV per unit in paise. |
folios[].value_minor | integer | Market value in paise. |
folios[].cost_minor | integer | Cost of holding in paise, when printed. |
folios[].as_of | string | Valuation date. |
demat | array | Demat holding lines (NSDL and CDSL statements). |
demat[].dp_id | string | Depository participant id. |
demat[].client_id | string | Demat client id. |
demat[].isin | string | Security ISIN. |
demat[].security | string | Security name. |
demat[].quantity | number | Quantity held. |
demat[].price_minor | integer | Price per unit in paise. |
demat[].value_minor | integer | Market value in paise. |
demat[].asset_class | string | Asset class as printed on the statement. |
demat[].as_of | string | Valuation date. |
transactions | array | Transactions; only present on a detailed statement. |
transactions[].folio | string | Folio number, for mutual-fund transactions. |
transactions[].scheme | string | Scheme name. |
transactions[].isin | string | ISIN. |
transactions[].date | string | Transaction date. |
transactions[].description | string | Description as printed. |
transactions[].type | string | For example purchase, redemption, switch_in, switch_out or dividend. |
transactions[].amount_minor | integer | Amount in paise. |
transactions[].units | number | Units bought or sold. |
transactions[].nav_minor | integer | NAV per unit in paise. |
transactions[].balance_units | number | Unit balance after the transaction. |
confidence | number | How sure the reading is, from 0 to 1. |
review_required | boolean | True when confidence is low and a person should check the figures. |
warnings | array | Plain-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.