# Copy assets

`POST /v1/operations/copy`

Available as MCP tool `copy-assets` (Write).

Subscription endpoints allow you to review, compare, and manage subscriptions and their related  links to assets (i.e., filters, config modifiers, translation sets).

You must be a member of the environment and be assigned to an engineer role to manage subscriptions. [Learn about roles](https://docs.redoxengine.com/permalink/1OBel3inQAjAnDbgd9QLzM).

### Copy assets

Copy an asset to use existing logic as a base when creating a new asset. Each copy is an independent asset at version 1 that you can edit in the target environment. 

You can copy assets within the same environment or across environments.

Assets are copied one at a time. The response lists which ones succeeded and which failed. 

## Request body

Contains the required details to copy asset(s) from one environment to another.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `fromEnvironment` | object | Yes | Specifies where the original assets exist. |
| `fromEnvironment.id` | string (uuid) | Yes | Contains the unique identifier of the Redox environment. |
| `toEnvironment` | object | Yes | Specifies where the new copies are created. The `toEnvironment` may or may not be the same as the `fromEnvironment`, but both must belong to the same organization. |
| `toEnvironment.id` | string (uuid) | Yes | Contains the unique identifier of the Redox environment. |
| `copyingAssets` | Array of object | Yes | Lists the assets to copy (max allowed is 50). If the same asset is listed twice, the request fails. |
| `copyingAssets[].id` | string (uuid) | Yes | Contains the unique identifier of the asset. |
| `copyingAssets[].type` | string | Yes | Possible values: configModifier, filter, translationSet |
| `copyingAssets[].overrides` | object | No | Contains any edits to the original asset's settings for the new copy. Any settings you don't override are taken from the original asset. |
| `copyingAssets[].overrides.name` | string | No | Names the copy. Defaults to the original asset's name followed by `(copy)`. A translation set name must be unique within its environment; a duplicate name causes that translation set's copy to fail. |

## Request example

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

```bash
curl 'https://api.redoxengine.com/platform/v1/operations/copy' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "fromEnvironment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  },
  "toEnvironment": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  },
  "copyingAssets": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "configModifier",
      "overrides": {
        "name": "string"
      }
    }
  ]
}'
```

## Responses

### 200

Contains a payload with the outcome (i.e., succeeded or failed) of each copied asset. A `200` means Redox successfully processed the request, but doesn't necessarily indicate a successful outcome for each individual asset. Check the `failures` array for details.

| 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 |  |
| `payload.copiedAssets` | Array of object | No | Lists the new assets and their corresponding IDs in the `toEnvironment`. For copied translation sets, any value sets are also automatically copied and listed with the type `valueSet`. |
| `payload.copiedAssets[].id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.copiedAssets[].name` | string | No | Contains the human-readable name of the asset. |
| `payload.copiedAssets[].version` | number | No | Always set to 1. A copy is a new asset, regardless of the original asset's version number. |
| `payload.copiedAssets[].environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.copiedAssets[].environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.copiedAssets[].type` | string | No | Identifies the type of a copied asset. `valueSet` appears only for the value sets copied along with a translation set. Possible values: configModifier, filter, translationSet, valueSet |
| `payload.copiedAssets[].copyingAsset` | object | No | Describes the original asset being copied. The response is the only record of this relationship, since a copied asset is independent of the original. |
| `payload.copiedAssets[].copyingAsset.id` | string (uuid) | No | Contains the unique identifier of the asset. |
| `payload.copiedAssets[].copyingAsset.name` | string | No | Contains the human-readable name of the asset. |
| `payload.copiedAssets[].copyingAsset.version` | number | No | Contains the numeric version of the asset. Version numbers start at 1 and increment in whole numbers whenever the asset is updated. |
| `payload.copiedAssets[].copyingAsset.environment` | object | No | Describes the Redox environment that the asset belongs to. |
| `payload.copiedAssets[].copyingAsset.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.copiedAssets[].copyingAsset.type` | string | No | Identifies the type of a copied asset. `valueSet` appears only for the value sets copied along with a translation set. Possible values: configModifier, filter, translationSet, valueSet |
| `payload.failures` | Array of object | No | Lists any assets that weren't copied, along with the error that prevented it. See `error.meta.isTransient` to learn whether you can safely retry copying an asset. This array is empty when every asset copied successfully. |
| `payload.failures[].copyingAsset` | object | No | Identifies one asset in the `fromEnvironment` to copy. |
| `payload.failures[].copyingAsset.id` | string (uuid) | Yes | Contains the unique identifier of the asset. |
| `payload.failures[].copyingAsset.type` | string | Yes | Possible values: configModifier, filter, translationSet |
| `payload.failures[].copyingAsset.overrides` | object | No | Contains any edits to the original asset's settings for the new copy. Any settings you don't override are taken from the original asset. |
| `payload.failures[].copyingAsset.overrides.name` | string | No | Names the copy. Defaults to the original asset's name followed by `(copy)`. A translation set name must be unique within its environment; a duplicate name causes that translation set's copy to fail. |
| `payload.failures[].error` | object | No | Explains why one item in a bulk request failed. The overall request still returns `200`. A request that's rejected before any work starts (e.g., due to a malformed body) returns `400` instead. |
| `payload.failures[].error.id` | string | Yes | Contains a unique identifier for this error instance. |
| `payload.failures[].error.code` | string | Yes | Identifies the error type, which can be used to find relevant troubleshooting information. |
| `payload.failures[].error.title` | string | Yes | Displays the high-level error message. |
| `payload.failures[].error.detail` | string | Yes | Contains the specific error details for this item. |
| `payload.failures[].error.meta` | object | No | Contains additional details about the failure. Some errors add other properties, such as the ID of an asset that was partially created. |
| `payload.failures[].error.meta.isTransient` | boolean | No | Indicates whether retrying this item as-is might succeed. `true` means the failure was temporary (e.g., a timeout), so you can retry the item. `false` means the item will continue to fail until you correct the issue (e.g., the asset doesn't exist or its name is a duplicate). When absent, the failure wasn't classified; review `detail` before retrying. |

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

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "copiedAssets": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "string",
        "version": 1,
        "environment": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        },
        "type": "configModifier",
        "copyingAsset": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "version": 2,
          "environment": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          },
          "type": "configModifier"
        }
      }
    ],
    "failures": [
      {
        "copyingAsset": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "type": "configModifier",
          "overrides": {
            "name": "string"
          }
        },
        "error": {
          "id": "string",
          "code": "asset.not.found",
          "title": "Not Found",
          "detail": "string",
          "meta": {
            "isTransient": 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
    }
  }
}
```
