# Create link

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

Available as MCP tool `create-link` (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.

### Create link

Create a link for an existing config modifier within a Redox organization. You can specify the details for the link via API or the Redox dashboard ([learn how to create a config modifier in the dashboard](https://docs.redoxengine.com/permalink/6sZ0Y9XdnMRCyoSWlqscjM)).

You can only create one link per config modifier. 

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `configModifierId` | path | string | Yes | Displays the unique identifier of a config modifier. |

## Request body

Contains the details for creating a new config modifier link.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `location` | string | Yes | Identifies where the link will be applied during log processing. Possible values: source-request, source-response, destination-request, destination-response |
| `sourceId` | string (uuid) | Yes | Identifies the source associated with the specified subscription. |
| `destinationId` | string (uuid) | Yes | Identifies the destination associated with the specified subscription. |
| `dataModel` | string | Yes | Identifies the Redox data model associated with the specified subscription. |
| `eventTypes` | Array of string, nullable | Yes | Indicates the event type(s) associated with the specified subscription. If the config modifier link should apply to all event types, you must explicitly set this field to `null`. |
| `ownedBy` | string | No | Indicates whether the source or destination system owns the link. Only the owner can view the specific details or update a link. Possible values: source, destination |

## 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}/links' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "ownedBy": "source",
  "location": "source-request",
  "sourceId": "1ee1d994-652f-44b5-9342-4b3e8b9918ee",
  "destinationId": "39a858ea-4474-4d04-b37e-88862fe4054d",
  "dataModel": "PatientAdmin",
  "eventTypes": [
    "string"
  ]
}'
```

## Responses

### 200

Contains a payload with details about the requested config modifier link.

| 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.configModifierLink` | object | No | Contains a config modifier link and its related details. |
| `payload.configModifierLink.configModifierId` | string | No | Contains the unique identifier of a config modifier link. |
| `payload.configModifierLink.configModifierVersion` | 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. |
| `payload.configModifierLink.id` | string (uuid) | No | Displays the unique identifier of the specified config modifier link. |
| `payload.configModifierLink.ownedBy` | string | No | Indicates whether the source or destination system owns the link. Only the owner can view the specific details or update a link. Possible values: source, destination |
| `payload.configModifierLink.processingLocation` | string | No | Identifies where a link will be applied during log processing. There are up to four stages that an asset can be linked to, depending on whether you own either the source, the destination, or both. Possible values: source-request, destination-request, source-response, destination-response |
| `payload.configModifierLink.dataModel` | string | No | Identifies the Redox data model that the link applies to. |
| `payload.configModifierLink.eventTypes` | Array of string, nullable | No | Indicates which event type(s) of the data model the config modifier is linked to. If not restricted to certain event types, you must explicitly set this field to `null`; this means the config modifier is linked to all event types. |
| `payload.configModifierLink.source` | object | No | Specifies the source of the subscription that the config modifier is linked to. |
| `payload.configModifierLink.source.id` | string | No | Contains the unique identifier of the source. |
| `payload.configModifierLink.source.name` | string, nullable | No | Displays the human-readable name of the source. |
| `payload.configModifierLink.destination` | object | No | Specifies the destination of the subscription that the config modifier is linked to. |
| `payload.configModifierLink.destination.id` | string | No | Contains the unique identifier of the destination. |
| `payload.configModifierLink.destination.name` | string, nullable | No | Displays the human-readable name of the destination. |
| `payload.configModifierLink.organization` | object | No | Contains metadata about the Redox organization. |
| `payload.configModifierLink.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.configModifierLink.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.configModifierLink.connectingOrganization` | object | No | Specifies the organization the asset is connected to when the subscription relates to a partner organization. |
| `payload.configModifierLink.connectingOrganization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.configModifierLink.connectingOrganization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.configModifierLink.environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.configModifierLink.environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.configModifierLink.processingOrder` | object | No | Contains the details for the processing order of the config modifiers linked to a given subscription. |
| `payload.configModifierLink.processingOrder.order` | number, nullable | No | Specifies the order that the config modifiers should run at the given processing location. |
| `payload.configModifierLink.processingOrder.total` | number | No | Displays the total number of config modifier links for the given subscription and processing location. |
| `payload.configModifierLink.createdAt` | string | No | Displays the date and time that the link was originally created in ISO 8601 format. |
| `payload.configModifierLink.createdBy` | object | No | Contains the metadata about the user who created the asset. |
| `payload.configModifierLink.createdBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.configModifierLink.createdBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.configModifierLink.updatedAt` | string, nullable | No | Displays the date and time that the link was last updated. |
| `payload.configModifierLink.updatedBy` | object | No | Contains the metadata about the user who last updated the asset. |
| `payload.configModifierLink.updatedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.configModifierLink.updatedBy.name` | string, nullable | No | Displays the user's full name. |
| `payload.configModifierLink.deletedAt` | string, nullable | No | Displays the date and time that the link was deleted. Returns a `null` value if the link hasn't been deleted. |
| `payload.configModifierLink.deletedBy` | object, nullable | No | Contains metadata about the user who performed the delete. Returns a `null` value if the config modifier hasn't been deleted. |
| `payload.configModifierLink.deletedBy.id` | number | No | Contains the unique identifier of the user. |
| `payload.configModifierLink.deletedBy.name` | string, nullable | No | Displays the user's full name. |

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

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "configModifierLink": {
      "configModifierId": "f84d602d-7449-4a13-b9a4-8688cae85726",
      "configModifierVersion": 0,
      "id": "dc5d2a43-df19-459c-b14f-450584ce1c55",
      "ownedBy": "source",
      "processingLocation": "source-request",
      "dataModel": "PatientAdmin",
      "eventTypes": [
        "string"
      ],
      "source": {
        "id": "1ee1d994-652f-44b5-9342-4b3e8b9918ee",
        "name": "string"
      },
      "destination": {
        "id": "39a858ea-4474-4d04-b37e-88862fe4054d",
        "name": "string"
      },
      "organization": {
        "id": 122,
        "name": "string"
      },
      "connectingOrganization": {
        "id": 122,
        "name": "string"
      },
      "environment": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      },
      "processingOrder": {
        "order": 0,
        "total": 0
      },
      "createdAt": "2024-04-25T18:17:16.719Z",
      "createdBy": {
        "id": 0,
        "name": "string"
      },
      "updatedAt": "2024-04-28T19:17:16.719Z",
      "updatedBy": {
        "id": 0,
        "name": "string"
      },
      "deletedAt": "2024-04-29T02:18:00.000Z",
      "deletedBy": {
        "id": 0,
        "name": "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
    }
  }
}
```
