# ListPorts lists currently published ports for one sandbox.


[API catalog](/reference/api/) · [Docker Sandboxes overview](/reference/api/sandboxes/latest/) · [Product manual](https://docs.docker.com/ai/sandboxes-api/) · [OpenAPI specification](/reference/api/sandboxes/api.yaml)

API version: v1


> This API is experimental. Features, interfaces,
> and behavior may change.




`GET /v1/sandboxes/{sandbox}/ports`

ListPorts lists currently published ports for one sandbox.

## Connection and access

[API connection and authentication guidance](/reference/api/sandboxes/latest/#authentication)


Server: `https://connect.docker.com/sandboxes`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "bearer": []
  }
]
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://connect.docker.com/sandboxes/v1/sandboxes/<SANDBOX>/ports'
```



## Parameters

### sandbox

Location: path. Required: yes.

The sandbox id.

```json
{
  "description": "The sandbox id.",
  "in": "path",
  "name": "sandbox",
  "pointer": "/paths/~1v1~1sandboxes~1{sandbox}~1ports/get/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

Success


Schema:

```json
{
  "$ref": "#/components/schemas/ListPortsResponse"
}
```










### Response default application/json

The structured Error body identifies the failure with a stable code and optional typed details.


Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```









Schema example:
```json
{
  "code": "notFound",
  "details": [],
  "message": "sandbox not found"
}
```


## Complete operation contract

```json
{
  "description": "ListPorts lists currently published ports for one sandbox.",
  "operationId": "listPorts",
  "parameters": [
    {
      "description": "The sandbox id.",
      "in": "path",
      "name": "sandbox",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ListPortsResponse"
          }
        }
      },
      "description": "Success"
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The structured Error body identifies the failure with a stable code and optional typed details."
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "summary": "ListPorts lists currently published ports for one sandbox.",
  "tags": [
    "Sandboxes"
  ],
  "x-sbx-authenticated-only": false,
  "x-sbx-conditional-permissions": [],
  "x-sbx-plane": "control",
  "x-sbx-required-permissions": [
    "sandboxesRead"
  ],
  "x-sbx-serving-surface": "management"
}
```

## Referenced schemas

- [#/components/schemas/Error](/reference/api/sandboxes/latest/schemas/Error/)

- [#/components/schemas/ListPortsResponse](/reference/api/sandboxes/latest/schemas/ListPortsResponse/)




