Replace a proxy
Every field is the request's; a `credential` left out keeps the one held, and `null` removes it.
Every field is the request's; a credential left out keeps the one held, and null removes it. Replacing the project's default with default_for_project: false is conflict unless clear_default is true, so changing a label or a port never sends the project's traffic from Pod's own addresses by accident. A call that only clears the default (clear_default, every other field as held) is allowed whatever the account's standing or settings, so an account that lost its entitlement can stop routing through the proxy and then remove it. Any other replace needs the own_proxy entitlement.
A key with the network:write scope.
Request
curl -X PUT "https://api.pod.mapier.ai/v1/proxies/prx_3ahrz6dmv29gqy5ckt18fpx4b" \
-H "Authorization: Bearer $POD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label":"example","scheme":"http_connect","host":"example","port":1}'Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
proxy_id | path | string | Yes | |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
label | string | Yes | |
scheme | "http_connect" | "socks5" | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. |
host | string | Yes | |
port | integer | Yes | From 1 to 65535. |
tls | boolean | No | Default false. |
credential | ProxyCredential | null | No | Left out keeps the login held; null removes it. |
default_for_project | boolean | No | Default false. |
clear_default | boolean | No | With default_for_project: false on the project's default: the project has no default proxy afterwards. The one way to stop a project's default on purpose. invalid with default_for_project: true. Default false. |
Answer
200. The proxy as it is now.
{
"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"
}| Field | Type | Always | What it is |
|---|---|---|---|
id | string | Yes | |
project_id | string | Yes | |
label | string | Yes | |
scheme | "http_connect" | "socks5" | Yes | HTTP CONNECT or SOCKS5. Both carry TCP only; names are resolved by the proxy. |
host | string | Yes | A DNS name or an address literal. |
port | integer | Yes | From 1 to 65535. |
tls | boolean | Yes | Speak TLS to the proxy itself. |
has_credential | boolean | Yes | |
default_for_project | boolean | Yes | Every sandbox of the project that follows its project leaves through it. At most one per project. |
state | "ready" | "login_failing" | Yes | login_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. |
version | integer | Yes | Raised on each change. At least 1. |
updated_at | string | null | Yes | |
updated_by | string | Yes | The person or key that last changed it. |
Errors
The refusals this call is known for: invalid, forbidden, not_found, plan_required, account_restricted, conflict. 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.network.proxies.replace(id, { … }) |
| Python | pod.network.proxies.replace(id, {…}) |