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

# Validate Custom Code

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

## Request

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

Determines whether a custom code update is valid or not.

If the desired code is already associated with the configuration, then the update is
invalid.

Args:
    configuration_id (UUID): The configuration ID
    body (ValidateCustomCodeInput): Body including the code to validate
    user (DbUser, optional): The logged in user
    db (AsyncDatabaseConnection, optional): The database connection

Returns:
    bool: Returns True if the code has not been used, otherwise returns False

## Path parameters

- `configuration_id` string, uuid, required

## Request body

- ValidateCustomCodeInput: Input model when validating a config's custom code.
  - `current_code` string, nullable, required
  - `desired_code` string, required

## Response `200`

Successful Response

- ValidateCustomCodeResponse: Validation response model.
  - `valid` boolean, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-04-24** `837ddae9cfed`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cdcgov/apis/dibbs-ecr-refiner/changes/api/v1/configurations/:configuration_id/custom-codes/validate/post.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)
