---
title: "Add Custom Code"
method: POST
path: "/api/v1/configurations/{configuration_id}/custom-codes"
tags: ["configurations"]
---

# Add Custom Code

`POST /api/v1/configurations/{configuration_id}/custom-codes`

## Request

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

Add a user-defined custom code to a configuration.

Args:
    configuration_id (UUID): The ID of the configuration to update.
    body (AddCustomCodeInput): The custom code information provided by the user.
    user (dict[str, Any]): The logged-in user.
    db (AsyncDatabaseConnection): The database connection.

Raises:
    HTTPException: 404 if configuration isn't found
    HTTPException: 409 if configuration is not a draft and therefore not editable
    HTTPException: 500 if custom code can't be added

Returns:
    ConfigurationCustomCodeResponse: Updated configuration

## Path parameters

- `configuration_id` string, uuid, required

## Request body

- AddCustomCodeInput: Input model for adding a custom code to a configuration.
  - `code` string, required
  - `display` string, required
  - `system_id` string, uuid, required

## Response `200`

Successful Response

- CustomCodeResponse: Custom code object to return to the client.
  - `id` string, uuid, required
  - `display` string, required
  - `code` string, required
  - `system_id` string, uuid, required
  - `system_name` string, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-09** `fca481966403`: 5 breaking, 2 warning, 4 info
  - added the new required request property `display`
  - added the new required request property `system_id`
  - removed the required property `code_sets` from the response with the `200` status
  - removed the required property `custom_codes` from the response with the `200` status
  - …7 more
- **2026-06-01** `808af89fc071`: 5 breaking, 1 warning, 6 info
  - removed the enum value `icd-10` of the request property `system`
  - removed the enum value `loinc` of the request property `system`
  - removed the enum value `other` of the request property `system`
  - removed the enum value `rxnorm` of the request property `system`
  - …8 more
- **2026-03-17** `b897bdc3b9ef`: 1 warning
  - added the new `Other` enum value to the `custom_codes/items/system` response property for the response status `200`

[Operation history](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner-2/changes/api/v1/configurations/:configuration_id/custom-codes/post.md)

---

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