# Test config modifier

`POST /v1/operations/configmodifiers/test`

Available as MCP tool `test-config-modifier` (Write).

Config modifier endpoints allow you to review and manage config modifiers and their related links. [Learn about config modifiers](https://docs.redoxengine.com/permalink/1wyRkO4LmBwAMmsKArQoIr). 

Anyone in a Redox organization can view config modifiers and related links, but you must be assigned to an engineer or support role to update them.

You can:

- retrieve a list of config modifiers by environment or organization;
- create config modifiers or links;
- update config modifiers or links; or
- delete config modifiers or link.

### Test config modifier

Test a config modifier schema against a sample payload.

## Request body

Contains the config modifier and payload(s) to test.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | object | Yes | Specifies which Redox environment to use to test the config modifier. |
| `environment.id` | string (uuid) | Yes | Contains the unique identifier of the Redox environment. |
| `configModifier` | object | Yes | Contains the config modifier settings to test against the payload. |
| `configModifier.selector` | string | Yes | Indicates the field path within the payload that this config modifier operates upon. |
| `configModifier.flavor` | string | Yes | Indicates the type, or flavor, of config modifier. A put flavor alters data (i.e., creates or replaces) in a payload, while a delete flavor removes data from a payload. Possible values: put, delete |
| `configModifier.schema` | object | No | (For put flavors only) Contains a schema of keywords that define what the config modifier should do at the specified selector path. |
| `inputPayloads` | object | Yes | Contains the payload(s) to test against the config modifier settings. |
| `inputPayloads.processedPayload` | object | Yes | Contains an example of a JSON payload after any expected processing (such as translation sets or other config modifiers) has occurred. |
| `inputPayloads.initialPayload` | object | No | Contains an example of a JSON payload before any Redox processing has occurred. |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/platform/v1/operations/configmodifiers/test' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "environment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  },
  "configModifier": {
    "selector": "$.Patient.Identifiers[*].ID",
    "flavor": "put",
    "schema": {
      "plugin": {
        "name": "text",
        "action": "upper-case"
      }
    }
  },
  "inputPayloads": {
    "processedPayload": {},
    "initialPayload": {}
  }
}'
```

## Responses

### 200

Contains the results of the config modifier test.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains the results of testing the config modifier settings against the provided payload(s). |
| `payload.outcome` | string | Yes | Describes the result of applying the given config modifier to the payload. A value of `succeeded` indicates that the output payload was modified. A value of `field-not-found` indicates that the field specified in the selector was not found in the payload(s). Possible values: succeeded, field-not-found |
| `payload.output` | object | No | Contains the output payload after applying the config modifier to the provided input payload(s). |
| `payload.schemaResult` | object | No | Contains the schema output. |
| `payload.field` | string | No | For a field-not-found outcome, contains the selector path that was not found. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "outcome": "succeeded",
    "output": {},
    "schemaResult": {},
    "field": "string"
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
