List what listens in a sandbox now
Every TCP and UDP port a program in the sandbox listens on, with its setting and, for TCP, its URL.
GET/v1/sandboxes/{sandbox_id}/ports/listening
Every TCP and UDP port a program in the sandbox listens on, with its setting and, for TCP, its URL. It wakes nothing: a sandbox that is not running answers conflict.
A key with the sandboxes:read scope.
Request
curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/listening" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
sandbox_id | path | string | Yes |
Answer
200. What listens now.
{
"data": [
{
"port": 1,
"protocol": "tcp",
"address": "example",
"visibility": "private",
"name": null,
"url": null
}
],
"next_cursor": null
}| Field | Type | Always | What it is |
|---|---|---|---|
data | ListeningPort[] | Yes | |
next_cursor | string | null | Yes | Always null. |
Errors
The refusals this call is known for: conflict, guest_unavailable, 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
| Client | Call |
|---|---|
| TypeScript | pod.ports.listening(sandboxId) |
| Python | pod.ports.listening(sandbox_id) |