# Restore config modifier

`POST /v1/operations/configmodifiers/{configModifierId}/restore`

Available as MCP tool `restore-config-modifier` (Replace).

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.

### Restore config modifier

Restore a config modifier to a previously used version. You can select which version to restore, whether going backward or forward.

To preview changes, set the `dryRun` query parameter to `true`. Otherwise, set the `dryRun` query parameter to `false` or omit altogether to immediately apply the restored version to the linked subscription.

> **Can’t restore an active or non-existent version**
>
> This endpoint results in an error if you try to restore to an already active version or a version that doesn’t exist.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `configModifierId` | path | string | Yes | Displays the unique identifier of a config modifier. |
| `dryRun` | query | boolean | No | Specifies whether the restore will be previewed or executed. Set to `true` to run a preview of restoring the asset; this keeps the asset at its current version. Set to `false` (or omit) to restore the version. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | number | No |  |

## Request example

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

```bash
curl 'https://api.redoxengine.com/platform/v1/operations/configmodifiers/{configModifierId}/restore' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "version": 0
}'
```

## Responses

### 200

Contains a payload object with the restore details.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `previous` | object | No | Contains a config modifier and its related details. |
| `previous.id` | string (uuid) | No | Contains the unique identifier of the config modifier. |
| `previous.version` | number | No | Indicates the iteration, or version number, of the config modifier. Version numbers start at 1 and increment every time a config modifier is updated. |
| `previous.name` | string | No | Displays the human-readable name of the config modifier. |
| `previous.flavor` | string | No | Indicates the type, or flavor, of config modifier. A `put` flavor alters data (creates or replaces) in a payload, while a `delete` flavor removes data from a payload. Possible values: put, delete |
| `previous.selector` | string | No | Indicates the location(s) within the payload that this config modifier will operate on. |
| `previous.schema` | object, nullable | No | Required for a `put` flavor config modifier. Indicates how to build the value at the location the selector specifies. |
| `previous.createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `previous.createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `previous.createdBy.id` | number | No | Contains the unique identifier of the user. |
| `previous.createdBy.name` | string, nullable | No | Displays the user's full name. |
| `previous.updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `previous.updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `previous.updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `previous.updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `previous.deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `previous.deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `previous.deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `previous.deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `previous.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `previous.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `previous.organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `previous.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `previous.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `current` | object | No | Contains a config modifier and its related details. |
| `current.id` | string (uuid) | No | Contains the unique identifier of the config modifier. |
| `current.version` | number | No | Indicates the iteration, or version number, of the config modifier. Version numbers start at 1 and increment every time a config modifier is updated. |
| `current.name` | string | No | Displays the human-readable name of the config modifier. |
| `current.flavor` | string | No | Indicates the type, or flavor, of config modifier. A `put` flavor alters data (creates or replaces) in a payload, while a `delete` flavor removes data from a payload. Possible values: put, delete |
| `current.selector` | string | No | Indicates the location(s) within the payload that this config modifier will operate on. |
| `current.schema` | object, nullable | No | Required for a `put` flavor config modifier. Indicates how to build the value at the location the selector specifies. |
| `current.createdAt` | string | No | Displays the date and time that the asset was originally created in ISO 8601 format. |
| `current.createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `current.createdBy.id` | number | No | Contains the unique identifier of the user. |
| `current.createdBy.name` | string, nullable | No | Displays the user's full name. |
| `current.updatedAt` | string | No | Displays the date and time that the asset was last updated in ISO 8601 format. |
| `current.updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `current.updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `current.updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `current.deletedAt` | string, nullable | No | Displays the date and time that the asset was deleted. Returns a `null` value if the asset hasn't been deleted. |
| `current.deletedBy` | object, nullable | No | Contains the metadata about the user who deleted the asset. |
| `current.deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `current.deletedBy.name` | string, nullable | No | Displays the user's full name. |
| `current.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `current.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `current.organization` | object | No | Describes the Redox organization that the asset belongs to. |
| `current.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `current.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `dryRun` | boolean | No |  |

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

```json
{
  "previous": {
    "id": "3c45db50-6bb2-4cca-b1f9-76125ae9770f",
    "version": 0,
    "name": "string",
    "flavor": "put",
    "selector": "$.Patient.Identifiers[*].ID",
    "schema": {
      "plugin": {
        "name": "text",
        "action": "upper-case"
      }
    },
    "createdAt": "2024-04-25T18:17:16.719Z",
    "createdBy": {
      "id": 0,
      "name": "string"
    },
    "updatedAt": "2024-04-25T18:17:16.719Z",
    "updatedBy": {
      "id": 0,
      "name": "string"
    },
    "deletedAt": "2024-04-25T18:17:16.719Z",
    "deletedBy": {
      "id": 0,
      "name": "string"
    },
    "environment": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    },
    "organization": {
      "id": 122,
      "name": "string"
    }
  },
  "current": {
    "id": "3c45db50-6bb2-4cca-b1f9-76125ae9770f",
    "version": 0,
    "name": "string",
    "flavor": "put",
    "selector": "$.Patient.Identifiers[*].ID",
    "schema": {
      "plugin": {
        "name": "text",
        "action": "upper-case"
      }
    },
    "createdAt": "2024-04-25T18:17:16.719Z",
    "createdBy": {
      "id": 0,
      "name": "string"
    },
    "updatedAt": "2024-04-25T18:17:16.719Z",
    "updatedBy": {
      "id": 0,
      "name": "string"
    },
    "deletedAt": "2024-04-25T18:17:16.719Z",
    "deletedBy": {
      "id": 0,
      "name": "string"
    },
    "environment": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    },
    "organization": {
      "id": 122,
      "name": "string"
    }
  },
  "dryRun": true
}
```

### 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
    }
  }
}
```
