Choose how a sandbox's outbound traffic leaves

`via: project` follows the project: its default proxy, else its static address at the sandbox's site, else Pod's own addresses.

PUT/v1/sandboxes/{sandbox_id}/exit

Not available yet The API does not serve reading or choosing how a sandbox's outbound traffic leaves yet.

via: project follows the project: its default proxy, else its static address at the sandbox's site, else Pod's own addresses. via: proxy names one of the project's proxies. via: home leases an address on a home connection that Pod resells from a provider, sticky for session_minutes or new per connection; max_leases counts the organization's. A replaced lease is given back. The way out follows the sandbox across sleep, wake and moves. proxy needs the own_proxy entitlement and home the leased_home_addresses one; both are refused with conflict on patient_data while that setting is on. project is always allowed, so a sandbox can be taken off a home route whatever the account's standing.

A key with the network:write scope.

Request

curl -X PUT "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/exit" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"via":"project"}'

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
via"project" | "proxy" | "home"YesWhat the sandbox asked for.
proxy_idstringNoFor via: proxy, one of the project's proxies; not otherwise.
homeHomeLeaseRequestNoFor via: home; not otherwise.

Answer

200. The sandbox's way out as it is now.

200
{
  "sandbox_id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b",
  "via": "project",
  "proxy_id": null,
  "home": null,
  "route": "pod",
  "static_address_id": null,
  "carrying": false,
  "version": 0,
  "updated_at": null
}
FieldTypeAlwaysWhat it is
sandbox_idstringYes
via"project" | "proxy" | "home"YesWhat the sandbox asked for.
proxy_idstring | nullYesThe proxy the traffic leaves through, named or the project's default; null otherwise.
homeHomeLease | nullYesThe leased address, for via: home.
route"pod" | "static_address" | "proxy" | "home"YesWhere the sandbox's traffic leaves now. Treat a value you do not know as not Pod's own addresses.
static_address_idstring | nullYesThe project's static address the traffic leaves from, for route: static_address.
carryingbooleanYesFalse while the route may not carry; the sandbox's traffic is then refused, never sent from Pod's own addresses.
versionintegerYesRaised by every change, a lease's renewal included. At least 0.
updated_atstring | nullYes

Errors

The refusals this call is known for: invalid, forbidden, not_found, plan_required, account_restricted, conflict, quota_exceeded. 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.network.setExit(sandboxId, { via })
Pythonpod.network.set_exit(sandbox_id, {…})