---
title: "Run Configuration Test"
method: POST
path: "/api/v1/configurations/test"
tags: ["configurations"]
---

# Run Configuration Test

`POST /api/v1/configurations/test`

## Request

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

Runs an inline test of a given configuration against an eICR/RR pair.

This endpoint orchestrates the validation and refinement process by:
1. Handling file input, either from a user upload or a default sample file.
2. Calling the `inline_testing` service, which validates that the specified
   configuration's condition is reportable in the provided file.
3. Handling the service response:
    - If validation fails, raises a 400 Bad Request with a specific error.
    - If successful, proceeds with the returned refined document.
4. Packaging the original eICR, RR, and the single refined eICR into a
   new in-memory zip archive.
5. Uploading the archive to S3 and generating a pre-signed download URL.
6. Returning a `ConfigurationTestResponse` with the download URL and details
   of the successful refinement.

Args:
    id: The ID of the configuration to test.
    uploaded_file: An optional user-provided zip file with an eICR and RR.
    create_output_zip: Dependency to create a zip archive in memory.
    upload_zip: Dependency to upload the archive to S3.
    user: The authenticated user making the request.
    db: The database connection.
    sample_zip_path: Path to the default sample zip file.
    logger: The application logger.

Returns:
    A response object containing the original eICR, a URL to download the
    zipped results, and details about the refined condition.

## Request body `multipart/form-data`

- BodyRunInlineConfigurationTest
  - `id` string, uuid, required
  - `uploaded_file` string, binary, nullable

## Response `200`

Successful Response

- ConfigurationTestResponse: Model to represent the response provided to the client when in-line testing is run.
  - `original_eicr` string, required
  - `refined_download_key` string, required
  - `condition` Condition, required: Model for a Condition.
    - `code` string, required
    - `display_name` string, required
    - `refined_eicr` string, required
    - `stats` string[], required
    - `render_diff` boolean, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-05-08** `25a690b44c3a`: 1 info
  - added the required property `condition/render_diff` to the response with the `200` status
- **2026-05-07** `d82594b340a6`: 1 breaking
  - removed the required property `condition/refined_rr` from the response with the `200` status
- **2026-03-09** `eacb8080249b`: 1 breaking, 1 info
  - the `uploaded_file/anyOf[subschema #1]/` request property contentMediaType changed from `` to `application/octet-stream`
  - the `uploaded_file/anyOf[subschema #1]/` request property format was generalized from `binary` to no format
- **2026-03-06** `c05076473afd`: 2 breaking
  - the `uploaded_file/anyOf[subschema #1]/` request property contentMediaType changed from `application/octet-stream` to ``
  - the `uploaded_file/anyOf[subschema #1]/` request property format changed from no format to `binary`
- **2026-03-04** `9bd93d475af6`: 1 breaking, 1 info
  - the `uploaded_file/anyOf[subschema #1]/` request property contentMediaType changed from `` to `application/octet-stream`
  - the `uploaded_file/anyOf[subschema #1]/` request property format was generalized from `binary` to no format

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