---
title: "Get Code Counts"
method: GET
path: "/api/v1/configurations/{configuration_id}/code-counts"
tags: ["configurations"]
---

# Get Code Counts

`GET /api/v1/configurations/{configuration_id}/code-counts`

## Request

- The document declares no server URL.
- Auth: none declared

Fetch code count information for a configuration.

Args:
    configuration_id (UUID): ID of the configuration to update
    user (DbUser): The logged-in user
    db (AsyncDatabaseConnection): Database connection

Raises:
    HTTPException: 404 if configuration can't be found
    HTTPException: 500 if code count metadata can't be fetched

Returns:
    CodeCountsResponse: Object containing code count info

## Path parameters

- `configuration_id` string, uuid, required

## Response `200`

Successful Response

- CodeCountsResponse: Code count information to return to the client. Field-identical to `DbCodeResultCountMetadata` now that both follow `<thing>_count`. The mapping below was already a pure rename; collapsing the two models is an E1 question (a db shape reaching the browser), not a naming one.
  - `code_count` integer, required
  - `code_set_count` integer, required
  - `excluded_code_count` integer, required
  - `custom_code_count` integer, required
  - `primary_condition_rctc_count` integer, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-23** `c710294a0d33`: 4 breaking, 4 info
  - removed the required property `total_code_count` from the response with the `200` status
  - removed the required property `total_code_sets_count` from the response with the `200` status
  - removed the required property `total_custom_codes_count` from the response with the `200` status
  - removed the required property `total_excluded_codes_count` from the response with the `200` status
  - …4 more
- **2026-09-03** `17faf3275ffc`: 1 info
  - added the required property `primary_condition_rctc_count` to the response with the `200` status
- **2026-08-10** `83ee68a06f3c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner/changes/api/v1/configurations/:configuration_id/code-counts/get.md)

---

[API](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner.md) - [All operations](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner/llms.txt) - [OpenAPI document](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner/revisions/7312cd4b44ac?raw)
