# Get sources

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

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

Source endpoints allow you to manage sources and their related portmaps in a specified environment. Portmaps include a port, virtual host (vhost), source, and list of host IPs. 

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

### Get sources

Retrieve a list of configured sources 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. |

## Request example

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

## Responses

### 200

Contains a payload object with a list of any sources configured 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 details about the requested source(s). |
| `payload.sources` | Array of object | No | Contains an array of sources. |
| `payload.sources[].name` | string | No | Displays the human-readable name of the source. |
| `payload.sources[].id` | string | No | Displays the unique identifier (i.e., client ID) of the source. |
| `payload.sources[].environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.sources[].environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.sources[].environment.environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |
| `payload.sources[].sftpUsername` | string | No | Contains a UUID that represents the username for this source's SFTP access. In order to view, this field must be enabled for your organization. Talk to your Technical Account Manager if your organization needs this field. |
| `payload.sources[].hasSFTPPassword` | boolean | No | Indicates whether an SFTP password exists for this source. In order to view, this field must be enabled for your organization. Talk to your Technical Account Manager if your organization needs this field. |
| `payload.sources[].serviceRegion` | string | No | Specifies the Redox service region where the source resides. You can't change this after creation. Possible values: AWS_USA_EAST_1, AWS_CAN_CENTRAL, GCP_USA_CENTRAL_1 |
| `payload.sources[].dataFormat` | string | No | Displays the data format of the source. Possible values: HL7v2, JSON, Custom, X12, X12v2, XML (to JSON) |
| `payload.sources[].ehr` | string | No | Displays the EHR or sending system type of the source. |
| `payload.sources[].apiKey` | string | No | Displays the API key of the source. This is server-generated when the source is created and can't be changed. |
| `payload.sources[].hasSecret` | boolean | No | Displays whether the source has a secret. |
| `payload.sources[].setupState` | object, nullable | No | Describes the current state of configuration for a source in your Redox organization. |
| `payload.sources[].setupState.step` | string | Yes | Indicates which step the user is on in the configuration process. |
| `payload.sources[].setupState.name` | string | No | Displays the human-readable name of the source, as configured during setup. |
| `payload.sources[].setupState.dataFormat` | string | No | Displays the data format of the source. Possible values: HL7v2, JSON, Custom, X12, X12v2, XML (to JSON) |
| `payload.sources[].setupState.ehr` | string | No | Displays the EHR or sending system type of the source. |
| `payload.sources[].setupState.serviceRegion` | string | No | Specifies the Redox service region where the source resides. You can't change this after creation. Possible values: AWS_USA_EAST_1, AWS_CAN_CENTRAL, GCP_USA_CENTRAL_1 |
| `payload.sources[].timeZone` | string | No | Specifies the time zone that should be used when parsing dates/times from the sending system. |

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

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "sources": [
      {
        "name": "string",
        "id": "string",
        "environment": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "environmentFlag": "Staging"
        },
        "sftpUsername": "string",
        "hasSFTPPassword": true,
        "serviceRegion": "AWS_USA_EAST_1",
        "dataFormat": "HL7v2",
        "ehr": "string",
        "apiKey": "string",
        "hasSecret": true,
        "setupState": {
          "step": "string",
          "name": "string",
          "dataFormat": "HL7v2",
          "ehr": "string",
          "serviceRegion": "AWS_USA_EAST_1"
        },
        "timeZone": "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
    }
  }
}
```
