List a sandbox's ports that have a setting

The ports whose visibility, name or token was set, with their URLs.

GET/v1/sandboxes/{sandbox_id}/ports

The ports whose visibility, name or token was set, with their URLs. Every port of a sandbox has a URL whether or not it has a setting, https://{port}-{sandbox id without sbx_}.{content domain}, and a port with no setting is private, so it is not listed. A named port also has https://{name}--{cell tag}.{content domain}. What listens in the sandbox now is listListeningPorts. The content domain is mapier.dev, a registered domain of Pod's own that serves sandbox URLs and nothing else, apart from Pod's API and dashboard and on the Public Suffix List, so one sandbox's page cannot read another's cookies or Pod's own. Clients use the URLs answered here and never build one.

A key with the sandboxes:read scope.

Request

curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports" \
  -H "Authorization: Bearer $POD_API_KEY"

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes

Answer

200. The ports with a setting.

200
{
  "data": [
    {
      "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b",
      "port": 1,
      "visibility": "private",
      "name": null,
      "url": "https://app.example.com",
      "name_url": null,
      "has_token": false,
      "updated_at": null,
      "token": "podpt_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm"
    }
  ],
  "next_cursor": null
}
FieldTypeAlwaysWhat it is
dataPort[]Yes
next_cursorstring | nullYesAlways null; a sandbox's settings fit one page.

Errors

The refusals this call is known for: not_found, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.

In the SDKs

ClientCall
TypeScriptpod.ports.list(sandboxId)
Pythonpod.ports.list(sandbox_id)