---
title: "Portfolio Summary"
method: POST
path: "/api/analytics/portfolio-summary"
tags: ["Portfolio Analytics"]
---

# Portfolio Summary

`POST /api/analytics/portfolio-summary`

## Request

- Base URL: `https://api.creditbenchmark.com`
- URL: `https://api.creditbenchmark.com/api/analytics/portfolio-summary`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/creditbenchmark/apis/credit-benchmark-api/docs/api/analytics/portfolio-summary/post.ts> (a function with typed inputs; its response is checked against the schema)

Return grouped portfolio metrics.

## Request body

- RequestEnvelopePortfolioSummaryRequest
  - `Parameters` PortfolioSummaryRequest, required
    - `portfolio` Portfolio, required
      - `name` string, required
      - `entities` FlexibleCBPortfolio, required
        - `CBId` string[]
    - `facet_column` string, required: Column to group by (e.g., ClientType, Sector, Industry)
    - `EffectiveDateId` integer
    - `rating_change_months` integer: Number of months to look back for rating changes (e.g., 24 for 2-year changes)
    - `use_client_scale` boolean
    - `use_oci` boolean

## Response `200`

Portfolio summary retrieved successfully

- PortfolioSummaryResponse: Response containing portfolio summary statistics by facet
  - `CBSector` string[], required: Values of the grouping column (matches facet_column parameter)
  - `entity_count` integer[], required: Total number of entities in each group
  - `benchmark_entity_count` integer[], required: Number of entities with credit ratings (benchmark coverage)
  - `CCR` string[], required: Aggregate credit ratings
  - `CCRPD100Mid` number[], required: Aggregate probability of default (mid)
  - `upgrades` integer[], required: Number of upgrades in period
  - `downgrades` integer[], required: Number of downgrades in period
  - `rating_change` integer[], required: Net rating change (upgrades - downgrades)

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - invalid or missing JWT token
- `403`: Forbidden - insufficient permissions or access denied
- `422`: Validation error - request parameters are invalid
- `500`: Internal server error

---

[API](https://skmtc.dev/creditbenchmark/apis/credit-benchmark-api.md) - [All operations](https://skmtc.dev/creditbenchmark/apis/credit-benchmark-api/llms.txt) - [OpenAPI document](https://skmtc.dev/creditbenchmark/apis/credit-benchmark-api/revisions/b357bbdb41e6?raw)
