# Get portmap

`GET /v1/sources/{sourceId}/portmaps/{portmapId}`

Available as MCP tool `get-source-portmap` (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 portmap

Retrieve a portmap for the specified source. 

This is helpful for programmatically managing an MLLP source or reviewing which host IP is directed to the specified source.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sourceId` | path | string | Yes | Displays the unique identifier of a source within a given environment. |
| `portmapId` | path | number | Yes | Displays the unique identifier of a portmap. |

## Request example

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

## Responses

### 200

Contains a payload object with the details about the requested source portmap.

| 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 portmap(s). |
| `payload.portmap` | object | No | Contains a portmap and its related details. |
| `payload.portmap.id` | number | No | Displays the unique identifier of the portmap. |
| `payload.portmap.vhost` | number | No | Displays the ID of the Redox vhost that the port is mapped for. |
| `payload.portmap.port` | number | No | Displays the port number that is being mapped. Must be between 9960 and 9999 (inclusive). |
| `payload.portmap.hostips` | Array of string (cidr) | No | Displays the list of host IPs for the portmap. |

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

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "portmap": {
      "id": 0,
      "vhost": 0,
      "port": 0,
      "hostips": [
        "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
    }
  }
}
```
