# Get subscriptions

`GET /v1/environments/{environmentId}/subscriptions`

Available as MCP tool `get-subscriptions` (Read).

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).

### Get subscriptions

Retrieve a list of existing subscriptions in the specified environment. 

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `environmentId` | path | string | Yes | Identifies the specific environment that you're operating in or on behalf of. |
| `sourceId` | query | string | No | Filters results to only include subscriptions with the specified source. |
| `destinationId` | query | string | No | Filters results to only include subscriptions with the specified destination. |
| `sourceOrganizationId` | query | number | No | Filters results to subscriptions where the specified organization owns the source. This can be combined with destinationOrganizationId to find subscriptions between two specific organizations. |
| `destinationOrganizationId` | query | number | No | Filters results to subscriptions where the specified organization owns the destination. This can be combined with sourceOrganizationId to find subscriptions between two specific organizations. |
| `dataModel` | query | string | No | Filters results to only include subscriptions using the specified data model. |
| `searchTerm` | query | string | No | Uses the specified term to find a case-insensitive match within a source name, destination name, or subscription name. |
| `status` | query | string | No | Filters subscriptions by queue status. |
| `_sort` | query | string | No | Sorts results by the specified field. Prefix the field name with `-` for descending order. |

## Request example

```bash
curl 'https://api.redoxengine.com/platform/v1/environments/{environmentId}/subscriptions' \
--request GET \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json'
```

## Responses

### 200

Contains a payload object with a list of subscriptions for the specified environment.

| 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 payload with a list of subscriptions. |
| `payload.subscriptions` | Array of object | No | Contains an array of subscriptions. |
| `payload.subscriptions[].id` | number | No | Displays the unique identifier of the subscription. |
| `payload.subscriptions[].name` | string, nullable | No | Displays the human-readable name of the subscription. |
| `payload.subscriptions[].dataModel` | string | No | Specifies the Redox data model that the link applies to or should apply to. |
| `payload.subscriptions[].isLive` | boolean, nullable | No | Indicates whether this subscription has been activated and is currently in production. |
| `payload.subscriptions[].goLiveDate` | string (date-time), nullable | No | If live, specifies when the subscription was activated. |
| `payload.subscriptions[].deletedAt` | string (date-time), nullable | No | If applicable, specifies when the subscription was deleted. |
| `payload.subscriptions[].createdAt` | string (date-time) | No | Indicates when the subscription was created. |
| `payload.subscriptions[].source` | object | No | Shared schema representing either the source or destination side of a subscription. Both source and destination are always present on a subscription response. |
| `payload.subscriptions[].source.id` | string (uuid) | No | Contains the unique identifier of the source or destination. |
| `payload.subscriptions[].source.name` | string | No | Displays the human-readable name of the source or destination. |
| `payload.subscriptions[].source.environmentFlag` | string | No | Indicates the environment type of the source or destination. |
| `payload.subscriptions[].source.environment` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.subscriptions[].source.organization` | object | No | Contains metadata about the Redox organization. |
| `payload.subscriptions[].source.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.subscriptions[].source.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |
| `payload.subscriptions[].destination` | object | No | Shared schema representing either the source or destination side of a subscription. Both source and destination are always present on a subscription response. |
| `payload.subscriptions[].destination.id` | string (uuid) | No | Contains the unique identifier of the source or destination. |
| `payload.subscriptions[].destination.name` | string | No | Displays the human-readable name of the source or destination. |
| `payload.subscriptions[].destination.environmentFlag` | string | No | Indicates the environment type of the source or destination. |
| `payload.subscriptions[].destination.environment` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.subscriptions[].destination.organization` | object | No | Contains metadata about the Redox organization. |
| `payload.subscriptions[].destination.organization.id` | number | No | Contains the unique identifier of the Redox organization. |
| `payload.subscriptions[].destination.organization.name` | string, nullable | No | Contains the human-readable name of the Redox organization. |

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

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "subscriptions": [
      {
        "id": 0,
        "name": "string",
        "dataModel": "string",
        "isLive": true,
        "goLiveDate": "2019-08-24T14:15:22Z",
        "deletedAt": "2019-08-24T14:15:22Z",
        "createdAt": "2019-08-24T14:15:22Z",
        "source": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "environmentFlag": "Production",
          "environment": "string",
          "organization": {
            "id": 122,
            "name": "string"
          }
        },
        "destination": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "environmentFlag": "Production",
          "environment": "string",
          "organization": {
            "id": 122,
            "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
    }
  }
}
```
