---
title: "Get Category Allocation"
method: POST
path: "/api/portfolio/category-allocation"
tags: ["Portfolio Analytics"]
---

# Get Category Allocation

`POST /api/portfolio/category-allocation`

## Request

- Base URL: `https://api.harmoney.in`
- URL: `https://api.harmoney.in/api/portfolio/category-allocation`
- Auth: API key in header `x-api-key`

Current allocation of an AMFI category and of its return deciles.

## Request body

- CategoryAllocationRequest: Request body for POST /api/portfolio/category-allocation. * **Mode A** — ``as_of`` + ``horizon``. * **Mode B** — ``start_date`` + ``end_date``. The window end is the as-of the snapshots are read at. The window itself also decides which cohort members the category row averages: only funds with a return over it, which is the same universe ``/category-analytics`` ranks and ships as ``members``.
  - `instrument_id` string, required: ``unique_id`` of the fund whose category defines the cohort.
  - `fund_ids` string[]: Reference funds to report individually, one row each, in the order given. Typically the ``instrument_id`` values off ``/category-analytics``'s series.
  - `group_by` string[]: Pivot dimensions, each reported as its own independent breakdown over the same holdings — not nested. Asking for several costs one resolver each and no extra holdings read, so a caller offering a dimension picker should request them all once and switch locally.
  - `as_of` string, date: Mode A: window end
  - `horizon` '1M' | '3M' | '6M' | 'YTD' | '1Y' | '3Y' | '5Y' | '10Y' | 'MAX': Mode A: window size back from ``as_of``
  - `start_date` string, date: Mode B: window start
  - `end_date` string, date: Mode B: window end

## Response `200`

Successful Response

- CategoryAllocationResponse
  - `instrument_id` string, required
  - `instrument_name` string, required
  - `category` string, required
  - `category_code` string, required
  - `plan_type` string, required
  - `requested_start` string, date, required
  - `requested_end` string, date, required
  - `effective_start` string, date, required
  - `effective_end` string, date, required
  - `cohort_size` integer, required: Funds the category row averages over — members with a return over the window, matching ``/category-analytics``'s ``members``.
  - `weighting` 'equal': How the category row combines its members. Equal means each fund counts once regardless of size.
  - `rows` AllocationRow[]: Named funds in request order, then the category row.
    - `key` string, required: The fund's ``unique_id``, or ``"category"`` for the average row.
    - `instrument_id` string: ``None`` on the category row.
    - `instrument_name` string
    - `aum_crores` number
    - `snapshot_date` string, date: The holdings disclosure this row is built from — the latest on or before the window end. Different funds disclose on different dates, so this is per-row and must be shown. ``None`` means the fund disclosed nothing in reach and the row has no allocation. On the category row this is the latest date any member contributed.
    - `fund_count` integer, required: 1 for a named fund; the cohort size for the category row.
    - `funds_with_holdings` integer, required: Funds behind this row that resolved a snapshot — the averaging denominator. Zero means the row's weights are unknown, not zero.
    - `dimensions` DimensionAllocation[]
      - `dimension` 'asset_class' | 'macro_sector' | 'sector' | 'industry' | 'rating' | 'tenor' | 'market_cap_category', required
      - `label` string, required
      - `buckets` AllocationBucket[]
        - `bucket` string, required
        - `weight_pct` number, required
        - `funds_present` integer, required: Funds behind this row carrying a non-zero weight here. Always 0 or 1 on a named-fund row; up to the cohort size on the category row.
      - `total_weight_pct` number, required: Sum of this dimension's buckets. Not renormalised: it falls short of 100 when the underlying disclosures do, and a caller drawing a stacked bar should let it fall short rather than rescale.
  - `null_reason` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/inferedge/apis/india-mutual-funds-data-feed.md) - [All operations](https://skmtc.dev/inferedge/apis/india-mutual-funds-data-feed/llms.txt) - [OpenAPI document](https://skmtc.dev/inferedge/apis/india-mutual-funds-data-feed/revisions/fe0d3be721c0?raw)
