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

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
portpathintegerYesA TCP or UDP port number, 1 to 65535.
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Answer

200. The port, private and unnamed.

200
{
  "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"
}
FieldTypeAlwaysWhat it is
sandboxstringYes
portintegerYesFrom 1 to 65535.
visibility"private" | "public"Yesprivate (the default): opened by a key, the port's token, a share link or their session. public: opened by anyone.
namestring | nullYes
urlstringYeshttps://{port}-{sandbox id without sbx_}.{content domain}; the sandbox id's body starts with its cell tag.
name_urlstring | nullYeshttps://{name}--{cell tag}.{content domain}, the cell tag being the sandbox's, when the port has a name.
has_tokenbooleanYes
updated_atstring | nullYes
tokenstringNoOnly 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

ClientCall
TypeScriptpod.ports.reset(sandboxId, port)
Pythonpod.ports.reset(sandbox_id, port)