Add a proxy of your own for a project

A proxy the customer runs or rents.

POST/v1/proxies

A proxy the customer runs or rents. With default_for_project every sandbox of the project that follows its project leaves through it, and the old default's flag is cleared; otherwise a sandbox names it with setSandboxExit. HTTP CONNECT or SOCKS5, TCP only; names are resolved by the proxy. Its login (credential) is stored encrypted by Pod's secret broker on the way in and never answered again (has_credential). The address must be public, or in a customer's own cell, inside a registered private range (else conflict on host). A proxy that stops answering means refused connections, never traffic sent from Pod's own addresses. Needs the own_proxy entitlement (a verified account on a paid plan, refused with conflict on patient_data while that setting is on); max_proxies counts them per project.

A key with the network:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/proxies" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"example","scheme":"http_connect","host":"example","port":1}'

Parameters

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

Body

FieldTypeRequiredWhat it is
projectstringNoThe key's own project by default, and the only one it may name. A person must name one.
labelstringYes
scheme"http_connect" | "socks5"YesHTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy.
hoststringYes
portintegerYesFrom 1 to 65535.
tlsbooleanNoDefault false.
credentialProxyCredential | nullNo
default_for_projectbooleanNoDefault false.

Answer

201. The proxy.

201
{
  "id": "prx_3ahrz6dmv29gqy5ckt18fpx4b",
  "project_id": "prj_3ahrz6dmv29gqy5ckt18fp",
  "label": "example",
  "scheme": "http_connect",
  "host": "example",
  "port": 1,
  "tls": false,
  "has_credential": false,
  "default_for_project": false,
  "state": "ready",
  "version": 1,
  "updated_at": null,
  "updated_by": "example"
}
FieldTypeAlwaysWhat it is
idstringYes
project_idstringYes
labelstringYes
scheme"http_connect" | "socks5"YesHTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy.
hoststringYesA DNS name or an address literal.
portintegerYesFrom 1 to 65535.
tlsbooleanYesSpeak TLS to the proxy itself.
has_credentialbooleanYes
default_for_projectbooleanYesEvery sandbox of the project that follows its project leaves through it. At most one per project.
state"ready" | "login_failing"Yeslogin_failing once the proxy keeps refusing the login: routes through it carry nothing until it is replaced with a new login. Treat a value you do not know as not ready.
versionintegerYesRaised on each change. At least 1.
updated_atstring | nullYes
updated_bystringYesThe person or key that last changed it.

Errors

The refusals this call is known for: invalid, forbidden, 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.proxies.create({ … })
Pythonpod.network.proxies.create({…})