Put a port back to private, with no name and no token
Ends every share link and every browser session the port gave, and any WebSocket they opened within 30 seconds.
DELETE/v1/sandboxes/{sandbox_id}/ports/{port}
Ends every share link and every browser session the port gave, and any WebSocket they opened within 30 seconds. Resetting a port that has no setting is a no-op.
A key with the sandboxes:write scope.
Request
curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
sandbox_id | path | string | Yes | |
port | path | integer | Yes | A TCP or UDP port number, 1 to 65535. |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Answer
200. The port, private and unnamed.
{
"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"
}| Field | Type | Always | What it is |
|---|---|---|---|
sandbox | string | Yes | |
port | integer | Yes | From 1 to 65535. |
visibility | "private" | "public" | Yes | private (the default): opened by a key, the port's token, a share link or their session. public: opened by anyone. |
name | string | null | Yes | |
url | string | Yes | https://{port}-{sandbox id without sbx_}.{content domain}; the sandbox id's body starts with its cell tag. |
name_url | string | null | Yes | https://{name}--{cell tag}.{content domain}, the cell tag being the sandbox's, when the port has a name. |
has_token | boolean | Yes | |
updated_at | string | null | Yes | |
token | string | No | Only in the answer of createPortToken, once. |
Errors
The refusals this call is known for: invalid, 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.reset(sandboxId, port) |
| Python | pod.ports.reset(sandbox_id, port) |