> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creditbenchmark.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Credit Breakdown

> Credit quality snapshot broken down by a facet column — sector, country, industry, or any facetable field.



## OpenAPI

````yaml /openapi/consensus-data.yaml post /analytics/v2/data/creditbreakdown
openapi: 3.1.0
info:
  title: Credit Benchmark API
  description: |
    Authentication, entity resolution, data, analytics, and metadata endpoints.
  version: 1.0.0
  contact:
    name: Credit Benchmark API Support
    email: api-support@creditbenchmark.com
    url: https://creditbenchmark.com/support
  license:
    name: Proprietary
    url: https://creditbenchmark.com/terms
servers:
  - url: https://gateway.creditbenchmark.com
    description: Production gateway
security:
  - BearerAuth: []
tags:
  - name: authentication
    description: Token generation endpoints.
    x-group: Authentication
  - name: entity-resolution
    description: Entity name resolution endpoints.
    x-group: Entity Resolution
  - name: data
    description: Raw data extraction endpoints.
    x-group: Data
  - name: analytics
    description: Analytics endpoints.
    x-group: Analytics
  - name: metadata
    description: Metadata discovery endpoints.
    x-group: Metadata
paths:
  /analytics/v2/data/creditbreakdown:
    post:
      tags:
        - analytics
      summary: Credit Breakdown
      description: >-
        Credit quality snapshot broken down by a facet column — sector, country,
        industry, or any facetable field.
      operationId: creditBreakdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditBreakdownRequest'
            example:
              metric: CCR
              rating_scale: CB21
              effective_date: 20250930
              lookback_period: 24
              lookback_unit: months
              scope:
                filters:
                  - key: CB_Sector
                    operator: '=='
                    values: Banks
              facet_column: CB_Country
      responses:
        '200':
          description: Credit breakdown retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditBreakdownResponse'
              example:
                CB_Country:
                  - United States
                  - United Kingdom
                AGG_EntityCount:
                  - 14
                  - 9
                AGG_CCR:
                  - bbb
                  - bbb-
                AGG_CCRPD:
                  - 0.00264
                  - 0.00314
                AGG_Upgrades:
                  - 1
                  - 0
                AGG_Downgrades:
                  - 0
                  - 2
                AGG_NetUpMinusDown:
                  - 1
                  - -2
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/FrameworkValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreditBreakdownRequest:
      type: object
      required:
        - scope
        - facet_column
      properties:
        metric:
          type: string
          enum:
            - CCR
            - MyRating
          default: CCR
          description: >-
            Metric to compute. Use `CCR` for consensus analytics or `MyRating`
            for client-specific analytics.
        rating_scale:
          type: string
          enum:
            - CB21
            - CB7
            - MyScale
          default: CB21
          description: >-
            Rating scale to map results onto. Use `CB21`, `CB7`, or `MyScale`
            for the requesting bank's master scale.
        effective_date:
          type: integer
          description: >-
            As-of date in YYYYMMDD format. If omitted, the latest available date
            is used.
        lookback_period:
          type: integer
          minimum: 0
          default: 24
          description: Number of `lookback_unit` intervals before `effective_date`.
        lookback_unit:
          type: string
          enum:
            - months
            - quarters
            - years
          default: months
        scope:
          $ref: '#/components/schemas/Scope'
        facet_column:
          type: string
          description: >-
            Column to summarize by. Built-in facetable columns and custom
            `scope.portfolio` columns are supported.
        result_filter:
          $ref: '#/components/schemas/ResultFilter'
    CreditBreakdownResponse:
      type: object
      description: Credit breakdown results.
      properties:
        AGG_EntityCount:
          $ref: '#/components/schemas/IntegerArray'
        AGG_CCR:
          $ref: '#/components/schemas/ColumnArray'
        AGG_CCRPD:
          $ref: '#/components/schemas/NumberArray'
        AGG_Upgrades:
          $ref: '#/components/schemas/IntegerArray'
        AGG_Downgrades:
          $ref: '#/components/schemas/IntegerArray'
        AGG_NetUpMinusDown:
          $ref: '#/components/schemas/NumberArray'
        AGG_ClientRating:
          $ref: '#/components/schemas/ColumnArray'
        AGG_ClientPD:
          $ref: '#/components/schemas/NumberArray'
        AGG_ExMeRating:
          $ref: '#/components/schemas/ColumnArray'
        AGG_ExMePD:
          $ref: '#/components/schemas/NumberArray'
        AGG_NotchDifference:
          $ref: '#/components/schemas/NumberArray'
        AGG_NotchDiffAggressive:
          $ref: '#/components/schemas/IntegerArray'
        AGG_NotchDiffConsistent:
          $ref: '#/components/schemas/IntegerArray'
        AGG_NotchDiffConservative:
          $ref: '#/components/schemas/IntegerArray'
      additionalProperties:
        $ref: '#/components/schemas/ColumnArray'
    Scope:
      type: object
      additionalProperties: false
      description: Defines the input universe. Use `portfolio`, `filters`, or both.
      properties:
        portfolio:
          $ref: '#/components/schemas/ScopePortfolio'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/ScopeFilter'
          description: >-
            Universe filters. Use them alone to build the universe from public
            columns, or with `portfolio` to subset the supplied portfolio. Only
            built-in scopeable columns are allowed in `filters[].key`; custom
            `scope.portfolio` columns are not valid scope filters.
        filters_join:
          type: array
          items:
            type: string
          description: >-
            Optional logic used to join `filters`. Only `&`, `|`, and `~` are
            supported. Length must be `len(filters)+1`.
    ResultFilter:
      type: object
      additionalProperties: false
      description: >-
        Filtering, sorting, and limiting applied after an analytic has computed
        its results. `filters[].key` and `sort.field` must reference supported
        result fields for the selected route. Some routes also accept documented
        alias names that map to returned fields.
      properties:
        limit:
          type: integer
          minimum: 1
          description: Return only the first N rows after `filters` and `sort` are applied.
        filters:
          type: array
          description: >-
            Filters applied to computed result rows. These do not change the
            analytic itself.
          items:
            $ref: '#/components/schemas/ResultFilterCondition'
        filters_join:
          type: array
          items:
            type: string
          description: >-
            Optional logic used to join `filters`. Length must be
            `len(filters)+1`. If omitted, conditions are AND-joined.
        sort:
          type: array
          items:
            $ref: '#/components/schemas/ResultFilterSort'
          description: Priority-ordered sort rules.
    IntegerArray:
      type: array
      items:
        type: integer
    ColumnArray:
      type: array
      items:
        $ref: '#/components/schemas/ScalarValue'
    NumberArray:
      type: array
      items:
        type: number
    SimpleError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    UnauthorizedError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
    FastApiValidationErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/FastApiValidationErrorDetail'
    RateLimitError:
      type: object
      required:
        - error
        - detail
      properties:
        error:
          type: string
        detail:
          type: string
    ScopePortfolio:
      type: object
      description: >-
        Explicit entity universe. `CB_ID` is required. Any extra keys are
        treated as custom portfolio columns.
      required:
        - CB_ID
      properties:
        CB_ID:
          type: array
          items:
            type: string
          description: List of Credit Benchmark entity identifiers.
      additionalProperties: true
    ScopeFilter:
      type: object
      additionalProperties: false
      required:
        - key
        - operator
      properties:
        key:
          type: string
          description: >-
            Public input column used to build or filter the universe. Only
            supported scopeable columns are allowed; see `/v2/metadata/columns`.
        operator:
          type: string
          enum:
            - '=='
            - '!='
            - '>'
            - <
            - '>='
            - <=
            - in
            - not in
            - is null
            - is not null
          description: Comparison operator.
        values:
          $ref: '#/components/schemas/FilterValue'
          description: >-
            Single value or list of values for the filter. Use an empty string
            for `is null` or `is not null`.
    ResultFilterCondition:
      type: object
      additionalProperties: false
      required:
        - key
        - operator
      properties:
        key:
          type: string
          description: >-
            Supported result field name to filter after the analytic has been
            computed. Valid values come from returned analytic fields or
            documented route aliases, not arbitrary source columns.
        operator:
          type: string
          enum:
            - '=='
            - '!='
            - '>'
            - <
            - '>='
            - <=
            - in
            - not in
            - contains
            - starts with
            - ends with
            - does not contain
            - does not start with
            - does not end with
            - is null
            - is not null
          description: Comparison operator.
        values:
          allOf:
            - $ref: '#/components/schemas/FilterValue'
          description: >-
            Single value or list of values for the filter. Not used for `is
            null` or `is not null`.
    ResultFilterSort:
      type: object
      additionalProperties: false
      required:
        - field
      properties:
        field:
          type: string
          description: >-
            Supported result field name to sort by for this route. Valid values
            come from returned analytic fields or documented route aliases, not
            arbitrary source columns.
        direction:
          type: string
          enum:
            - asc
            - desc
          default: desc
          description: Sort direction.
    ScalarValue:
      anyOf:
        - type: string
        - type: integer
        - type: number
        - type: boolean
        - type: 'null'
    FastApiValidationErrorDetail:
      type: object
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
    FilterValue:
      anyOf:
        - $ref: '#/components/schemas/ScalarValue'
        - $ref: '#/components/schemas/ColumnArray'
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
          example:
            error: >-
              Invalid request parameters: scope requires at least 'portfolio' or
              'filters'.
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          example:
            detail: Unauthorized request
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
          example:
            error: Client-backed analytics inputs require contributor entitlement.
    FrameworkValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FastApiValidationErrorResponse'
          example:
            detail:
              - loc:
                  - body
                  - effective_date
                msg: Input should be a valid integer
                type: int_parsing
    TooManyRequests:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            error: Rate limit exceeded
            detail: 60 per 1 minute
    InternalServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleError'
          example:
            error: >-
              An error occurred while processing your request. Please try again
              later.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT bearer token.

````