API reference / CAS (portfolio fetch)

3.3 CAS Auto Import — current portfolio

The latest imported CAS portfolio for this tenant.

GET/v1/cas/portfolio
Authentication
Bearer token
Scope
cas:import

Before you integrate

  • Returns the most recent import. If nothing has been imported yet, the result is only holding_count 0, an empty holdings list and a hint.

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/portfolio' \
  -H "Authorization: Bearer $GRAPPI_API_KEY"

Sample response

{
  "request_id": "req_01HZY3K8M2",
  "result": {
    "import_id": "casim_1a2b3c4d5e6f7a8b",
    "source": "cams",
    "imported_at": "2026-11-06T09:30:00.000Z",
    "holding_count": 1,
    "created": 1,
    "updated": 0,
    "unchanged": 0,
    "total_value_minor": 4412035,
    "total_cost_minor": 4000250,
    "total_gain_minor": 411785,
    "xirr_percent": null,
    "holdings": [
      {
        "key": "mutual_fund:INF123K01014:1234567/89",
        "kind": "mutual_fund",
        "name": "Sample Liquid Fund - Growth",
        "isin": "INF123K01014",
        "folio": "1234567/89",
        "units": 124.239,
        "value_minor": 4412035,
        "cost_minor": 4000250,
        "gain_minor": 411785,
        "as_of": "2024-03-31"
      }
    ],
    "warnings": []
  }
}

Response fields

FieldTypeDescription
import_idstringId of this import run.
sourcestringWho issued the statement, if known.
imported_atstringWhen the import ran, ISO 8601.
holding_countintegerNumber of positions in the portfolio after this import.
createdintegerPositions added by this import.
updatedintegerExisting positions whose figures changed.
unchangedintegerExisting positions that stayed the same.
total_value_minorintegerTotal market value in paise.
total_cost_minorintegerTotal cost in paise.
total_gain_minorintegerTotal gain in paise.
xirr_percentnumberAnnualised return in percent across all dated transactions; null unless the statement is detailed.
holdingsarrayThe positions.
holdings[].keystringStable id of the position; the same position gets the same key every month.
holdings[].kindstringmutual_fund or demat.
holdings[].namestringScheme or security name.
holdings[].isinstringISIN, if known.
holdings[].foliostringFolio or demat client id.
holdings[].unitsnumberUnits or quantity held.
holdings[].value_minorintegerMarket value in paise.
holdings[].cost_minorintegerCost in paise.
holdings[].gain_minorintegerGain in paise.
holdings[].as_ofstringValuation date.
warningsarrayPlain-text issues found, if any.
hintstringPresent only when nothing has been imported yet.

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.