Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(sessions): document proxy API; feat(sdk): add getProxy/updateProxy
Victor Andradeebf222f8fbcd
diff --git a/docs/04-security-design.md b/docs/04-security-design.mdold mode 100644new mode 100755index bf2c52dbf..4dacc7265--- a/docs/04-security-design.md+++ b/docs/04-security-design.md@@ -176,7 +176,7 @@ OpenWA serves plain HTTP on its port; terminate **TLS at your reverse proxy / lo| API keys | **Hashed** — SHA-256 with an optional `API_KEY_PEPPER` HMAC; never reversible | A database leak alone cannot recover the keys; with a pepper set, hashes can't be precomputed offline. See §4.2. || Session auth state (WhatsApp credentials) | Plaintext on disk (the engine's auth store under the data volume) | Filesystem permissions on the data volume — keep it private. || Webhook secrets | Plaintext — `webhooks.secret` (`varchar`) | Database access control; never returned by the webhook read DTOs (write-only) and omitted from `GET /api/infra/export-data` webhook rows. |-| Proxy credentials | Plaintext — `sessions.proxyUrl` may embed `user:pass` | Database access control; never returned by the session read DTOs. |+| Proxy credentials | Plaintext — `sessions.proxyUrl` may embed `user:pass` | Database access control; never returned by the session read DTOs — only masked `proxyHost` and `hasCredentials` on `GET/PATCH /proxy`, and `proxyEnabled`/`proxyType`/`proxyHost` on session list/get. || Generated config (`data/.env.generated`) | Plaintext file, written `0600` | Owner-only file permissions. || Message content | Plaintext in the `messages` table | Database access control. |diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdold mode 100644new mode 100755index 53c67c771..ce68d455d--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -191,7 +191,7 @@ Every path below is prefixed with `/api`. Unless marked **public**, send `X-API-### 6.4.1 Sessions-Base path `/api/sessions`. All routes that return a session return data shaped by `SessionResponseDto.fromEntity` (via `transformSession`), which **strips** `config`, `proxyUrl`, and `proxyType` and renames the entity field `lastActiveAt` to `lastActive`. Session `status` wire values are lowercase: `created | initializing | qr_ready | authenticating | ready | disconnected | action_required | failed`.+Base path `/api/sessions`. All routes that return a session return data shaped by `SessionResponseDto.fromEntity` (via `transformSession`), which **strips** `config` and the raw credential-bearing `proxyUrl` column, renames the entity field `lastActiveAt` to `lastActive`, and **projects** masked proxy fields (`proxyEnabled`, `proxyType`, `proxyHost`). Session `status` wire values are lowercase: `created | initializing | qr_ready | authenticating | ready | disconnected | action_required | failed`.#### GET /api/sessions@@ -222,12 +222,15 @@ List all sessions, scoped to the API key's `allowedSessions`, ordered `createdAt"updatedAt": "2026-06-25T09:01:55.000Z","lastError": null,"restriction": null,- "engineLoaded": true+ "engineLoaded": true,+ "proxyEnabled": false,+ "proxyType": null,+ "proxyHost": null}]```-`lastError` is non-null only when `status` is `failed` or `action_required`; any other status clears it. `config`/`proxyUrl`/`proxyType` are not present (stripped by `fromEntity`).+`lastError` is non-null only when `status` is `failed` or `action_required`; any other status clears it. `config` and the raw `proxyUrl` column are not present (stripped by `fromEntity`); masked proxy fields (`proxyEnabled`, `proxyType`, `proxyHost`) are included instead.`restriction` reports a limit **WhatsApp itself** has placed on the account, as opposed to `lastError`, which describes a fault on the gateway's side of the link. It is `null` when there is none, and otherwise `{ kind, code, expiresAt }`:@@ -269,7 +272,10 @@ Get a single session by ID."createdAt": "2026-06-20T11:30:00.000Z","updatedAt": "2026-06-25T09:01:55.000Z","lastError": null,- "engineLoaded": true+ "engineLoaded": true,+ "proxyEnabled": true,+ "proxyType": "http",+ "proxyHost": "proxy.example.com:8080"}```@@ -279,7 +285,7 @@ Get a single session by ID.Get the effective tunable configuration for a session. Only the three recognised keys are reported,resolved through the same clamps the engine applies — the opaque stored `config` column is never-echoed back (it is stripped from `SessionResponseDto` alongside `proxyUrl`, and anything else placed+echoed back (it is stripped from `SessionResponseDto` alongside the raw `proxyUrl` column, and anything else placedin it is stored but ignored).**Auth:** API key · **Scope:** session-scoped (key's `allowedSessions` enforced against `:sessionId`)@@ -333,6 +339,60 @@ and therefore apply on the next start, leaving a reconnect sequence already in f**Errors:** `400` a supplied value is outside its accepted range · `401` missing/invalid key, or key not scoped to this session · `403` key lacks OPERATOR role · `404` session not found+#### GET /api/sessions/:sessionId/proxy++Read a session's masked proxy configuration. Credentials embedded in the stored `proxyUrl` are **never** returned — only the parsed `proxyHost:port` and a `hasCredentials` flag.++**Auth:** API key · **Scope:** session-scoped++**Path parameters**++| Name | Type | Description |+| ----------- | ------ | ------------ |+| `sessionId` | string | Session UUID |++**Response** `200` — `SessionProxyResponseDto`++```json+{+ "enabled": true,+ "proxyType": "http",+ "proxyHost": "proxy.example.com:8080",+ "hasCredentials": true+}+```++When no proxy is configured, `enabled` is `false` and the other fields are `null`/`false`.++**Errors:** `401` missing/invalid key, or key not scoped to this session · `404` session not found++#### PATCH /api/sessions/:sessionId/proxy++Update per-session proxy settings. No restart is required or performed — changes apply on the **next** `POST /start`. Send `proxyUrl: null` to clear the proxy.++**Auth:** API key (OPERATOR) · **Scope:** session-scoped++**Path parameters**++| Name | Type | Description |+| ----------- | ------ | ------------ |+| `sessionId` | string | Session UUID |++**Request body** — `UpdateSessionProxyDto` (any subset; each key also accepts `null`)++| Field | Type | Constraints | Description |+| ----------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `proxyUrl` | string | `@IsOptional`; `@IsString`; max 255; `@IsUrl` (protocols `http`/`https`/`socks4`/`socks5`, `require_protocol`, `require_tld:false`, `allow_underscores`) | Per-session proxy egress; credentialed `http://user:pass@host` and single-label hosts allowed. Send `null` to clear. ⚠ **Must be a real, reachable proxy** when set — an unreachable value blocks the WhatsApp WebSocket on start (~30s timeout). |+| `proxyType` | `http` \| `https` \| `socks4` \| `socks5` | `@IsOptional`; `@IsIn([...])` | Proxy protocol; defaults to `http` when `proxyUrl` is set and this is omitted. |++```json+{ "proxyUrl": "http://user:[email protected]:8080", "proxyType": "http" }+```++**Response** `200` — the resulting `SessionProxyResponseDto` (same shape as the GET above).++**Errors:** `400` validation (bad `proxyUrl`/`proxyType`) · `401` missing/invalid key, or key not scoped to this session · `403` key lacks OPERATOR role · `404` session not found+#### GET /api/sessions/:sessionId/qrGet the QR code (PNG data URL) for session authentication.@@ -507,7 +567,7 @@ network cannot reach WhatsApp directly. Set `proxyUrl`/`proxyType` on the same r}```-Like every other session route, this returns the `SessionResponseDto` shape (via `fromEntity`), so `config`/`proxyUrl`/`proxyType` are stripped and `lastActiveAt` appears as `lastActive`. Newly created `status` is `created`.+Like every other session route, this returns the `SessionResponseDto` shape (via `fromEntity`), so `config` and the raw `proxyUrl` column are stripped, masked proxy fields are projected, and `lastActiveAt` appears as `lastActive`. Newly created `status` is `created`.**Errors:** `400` validation (bad `name`/`proxyUrl`/`proxyType`, or an extra non-whitelisted field) · `401` · `403` key lacks OPERATOR role · `409` session name already existsdiff --git a/docs/07-api-collection.md b/docs/07-api-collection.mdold mode 100644new mode 100755index ecaafad13..b14e76c62--- a/docs/07-api-collection.md+++ b/docs/07-api-collection.md@@ -118,6 +118,26 @@ curl -X POST "$BASE/api/sessions" \-d '{ "name": "my-bot", "proxyUrl": "http://user:[email protected]:8080", "proxyType": "http" }'```+#### GET /api/sessions/:sessionId/proxy++Read a session's masked proxy configuration (credentials never returned).++```bash+curl "$BASE/api/sessions/$SESSION_ID/proxy" \+ -H "X-API-Key: $API_KEY"+```++#### PATCH /api/sessions/:sessionId/proxy++Update per-session proxy settings (OPERATOR). No restart — changes apply on the next start. Send `"proxyUrl": null` to clear.++```bash+curl -X PATCH "$BASE/api/sessions/$SESSION_ID/proxy" \+ -H "X-API-Key: $API_KEY" \+ -H "Content-Type: application/json" \+ -d '{ "proxyUrl": "http://user:[email protected]:8080", "proxyType": "http" }'+```+#### POST /api/sessions/:sessionId/startStart a session and initialize the connection (OPERATOR).diff --git a/docs/18-sdk-design.md b/docs/18-sdk-design.mdold mode 100644new mode 100755index 689c3d5f5..518bcdfe0--- a/docs/18-sdk-design.md+++ b/docs/18-sdk-design.md@@ -28,7 +28,7 @@ All five SDKs expose the same fluent surface:| Resource | Methods || ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `sessions` | list, get, getConfig, updateConfig, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, setOnlinePresence, stats |+| `sessions` | list, get, getConfig, updateConfig, getProxy, updateProxy, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, setOnlinePresence, stats || `messages` | list, sendText, sendImage/Video/Audio/Document/Sticker, sendLocation, sendContact, sendTemplate, sendPoll, reply, forward, react, delete, editMessage, history, reactions, media, pin, unpin, star, votePoll, sendBulk, batchStatus, cancelBatch || `contacts` | list, get, check, profilePicture, profilePictures, phone, upsert, delete, block, unblock, listBlocked || `groups` | list, get, create, joinInfo, joinGroup, add/remove/promote/demoteParticipants, setSubject, setDescription, getGroupSettings, updateGroupSettings, leave, getPicture, setPicture, deletePicture, inviteCode, revokeInviteCode, getMembershipRequests, approveMembershipRequests, rejectMembershipRequests |@@ -129,6 +129,8 @@ The top-level client also exposes:| `list` | `list()` | List all sessions (scoped to the key's `allowedSessions`). || `getConfig` | `getConfig(id)` | Read a session's engine configuration. || `updateConfig` | `updateConfig(id, body)` | Update a running session's configuration; takes effect without re-linking the account. **OPERATOR** |+| `getProxy` | `getProxy(id)` | Read a session's masked proxy configuration (credentials never returned). |+| `updateProxy` | `updateProxy(id, body)` | Update per-session proxy settings; changes apply on the next start, not to a running engine. Send `proxyUrl: null` to clear. **OPERATOR** || `get` | `get(id)` | Get a single session by id. || `create` | `create(body)` | Create a new session (`body.name` required). **OPERATOR** || `delete` | `delete(id)` | Delete a session. **OPERATOR** |@@ -500,6 +502,8 @@ Resources are accessed as properties on the client (e.g. `client.messages`). All| `list` | `list() -> list[SessionResponse]` | List all sessions. || `get_config` | `get_config(session_id) -> SessionConfig` | Read a session's engine configuration. || `update_config` | `update_config(session_id, body) -> SessionConfig` | Update a running session's configuration; takes effect without re-linking the account. **OPERATOR** |+| `get_proxy` | `get_proxy(session_id) -> SessionProxy` | Read a session's masked proxy configuration (credentials never returned). |+| `update_proxy` | `update_proxy(session_id, body) -> SessionProxy` | Update per-session proxy settings; changes apply on the next start. Send `proxyUrl: null` to clear. **OPERATOR** || `get` | `get(session_id) -> SessionResponse` | Get one session. || `create` | `create(body) -> SessionResponse` | Create a session (`body["name"]` required). **OPERATOR** || `delete` | `delete(session_id) -> None` | Delete a session. **OPERATOR** |@@ -842,6 +846,8 @@ All payloads are associative arrays; all listed methods are synchronous and retu| `list` | `list(): array` | List all sessions. || `getConfig` | `getConfig(string $id): array` | Read a session's engine configuration. || `updateConfig` | `updateConfig(string $id, array $body): array` | Update a running session's configuration; takes effect without re-linking the account. **OPERATOR** |+| `getProxy` | `getProxy(string $id): array` | Read a session's masked proxy configuration (credentials never returned). |+| `updateProxy` | `updateProxy(string $id, array $body): array` | Update per-session proxy settings; changes apply on the next start. Send `proxyUrl: null` to clear. **OPERATOR** || `get` | `get(string $id): array` | Get one session. || `create` | `create(array $body): array` | Create a session (`$body['name']` required). **OPERATOR** || `delete` | `delete(string $id): void` | Delete a session. **OPERATOR** |diff --git a/sdk/README.md b/sdk/README.mdold mode 100644new mode 100755index 109a3a869..a8700a462--- a/sdk/README.md+++ b/sdk/README.md@@ -24,7 +24,7 @@ All five SDKs expose the same fluent resource surface:| Resource | Methods || ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| `sessions` | list, get, getConfig, updateConfig, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, setOnlinePresence, stats |+| `sessions` | list, get, getConfig, updateConfig, getProxy, updateProxy, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, setOnlinePresence, stats || `messages` | list, sendText, sendImage/Video/Audio/Document/Sticker, sendLocation, sendContact, sendTemplate, sendPoll, reply, forward, react, delete, editMessage, history, reactions, media, pin, unpin, star, votePoll, sendBulk, batchStatus, cancelBatch || `contacts` | list, get, check, profilePicture, profilePictures, phone, upsert, delete, block, unblock, listBlocked || `groups` | list, get, create, joinGroup, joinInfo, add/remove/promote/demoteParticipants, setSubject, setDescription, get/updateGroupSettings, leave, getPicture, setPicture, deletePicture, inviteCode, revokeInviteCode, getMembershipRequests, approveMembershipRequests, rejectMembershipRequests |diff --git a/sdk/go/routing_test.go b/sdk/go/routing_test.goold mode 100644new mode 100755index c57477939..8b08a56e7--- a/sdk/go/routing_test.go+++ b/sdk/go/routing_test.go@@ -20,6 +20,10 @@ func TestRouting(t *testing.T) {{"Sessions.List", func(c *Client) { c.Sessions.List(ctx, nil) }, "GET", "/api/sessions"},{"Sessions.Get", func(c *Client) { c.Sessions.Get(ctx, "s1") }, "GET", "/api/sessions/s1"},{"Sessions.Create", func(c *Client) { c.Sessions.Create(ctx, CreateSessionRequest{}) }, "POST", "/api/sessions"},+ {"Sessions.GetConfig", func(c *Client) { c.Sessions.GetConfig(ctx, "s1") }, "GET", "/api/sessions/s1/config"},+ {"Sessions.UpdateConfig", func(c *Client) { c.Sessions.UpdateConfig(ctx, "s1", UpdateSessionConfigRequest{}) }, "PATCH", "/api/sessions/s1/config"},+ {"Sessions.GetProxy", func(c *Client) { c.Sessions.GetProxy(ctx, "s1") }, "GET", "/api/sessions/s1/proxy"},+ {"Sessions.UpdateProxy", func(c *Client) { c.Sessions.UpdateProxy(ctx, "s1", UpdateSessionProxyRequest{}) }, "PATCH", "/api/sessions/s1/proxy"},{"Sessions.Delete", func(c *Client) { c.Sessions.Delete(ctx, "s1") }, "DELETE", "/api/sessions/s1"},{"Sessions.Start", func(c *Client) { c.Sessions.Start(ctx, "s1") }, "POST", "/api/sessions/s1/start"},{"Sessions.Stop", func(c *Client) { c.Sessions.Stop(ctx, "s1") }, "POST", "/api/sessions/s1/stop"},diff --git a/sdk/go/sessions.go b/sdk/go/sessions.goold mode 100644new mode 100755index e871b32d1..5d7844146--- a/sdk/go/sessions.go+++ b/sdk/go/sessions.go@@ -34,6 +34,27 @@ func (s *SessionsService) UpdateConfig(ctx context.Context, sessionID string, boreturn &out, nil}+// GetProxy reads a session's masked proxy configuration.+func (s *SessionsService) GetProxy(ctx context.Context, sessionID string) (*SessionProxy, error) {+ var out SessionProxy+ err := s.client.do(ctx, "GET", "/api/sessions/"+pathEscape(sessionID)+"/proxy", nil, nil, &out)+ if err != nil {+ return nil, err+ }+ return &out, nil+}++// UpdateProxy changes per-session proxy settings. No restart is performed -- changes apply on the+// next start. Send ProxyURL as JSON null to clear the proxy.+func (s *SessionsService) UpdateProxy(ctx context.Context, sessionID string, body UpdateSessionProxyRequest) (*SessionProxy, error) {+ var out SessionProxy+ err := s.client.do(ctx, "PATCH", "/api/sessions/"+pathEscape(sessionID)+"/proxy", nil, body, &out)+ if err != nil {+ return nil, err+ }+ return &out, nil+}+// Get returns a single session.func (s *SessionsService) Get(ctx context.Context, sessionID string) (*SessionResponse, error) {var out SessionResponsediff --git a/sdk/go/types_session.go b/sdk/go/types_session.goold mode 100644new mode 100755index 66abebe87..d7d1cf43f--- a/sdk/go/types_session.go+++ b/sdk/go/types_session.go@@ -163,6 +163,12 @@ type SessionResponse struct {// "disconnected" covers both a session mid automatic-reconnect (engine present) and one stopped// with no engine. Nil from a gateway that predates the field.EngineLoaded bool `json:"engineLoaded"`+ // ProxyEnabled reports whether a per-session egress proxy is configured.+ ProxyEnabled bool `json:"proxyEnabled"`+ // ProxyType is the configured proxy protocol when ProxyEnabled is true.+ ProxyType *ProxyType `json:"proxyType,omitempty"`+ // ProxyHost is host:port parsed from the stored proxy URL -- credentials are never returned.+ ProxyHost *string `json:"proxyHost,omitempty"`}// ProxyType is the scheme of a session proxy.@@ -184,6 +190,21 @@ type CreateSessionRequest struct {ProxyType ProxyType `json:"proxyType,omitempty"`}+// SessionProxy is the masked per-session proxy configuration returned by GET/PATCH /proxy.+type SessionProxy struct {+ Enabled bool `json:"enabled"`+ ProxyType *ProxyType `json:"proxyType"`+ ProxyHost *string `json:"proxyHost"`+ HasCredentials bool `json:"hasCredentials"`+}++// UpdateSessionProxyRequest updates per-session proxy settings. Send ProxyURL as a JSON null to+// clear. Changes apply on the next start, not to a running engine.+type UpdateSessionProxyRequest struct {+ ProxyURL *string `json:"proxyUrl,omitempty"`+ ProxyType *ProxyType `json:"proxyType,omitempty"`+}+// QrCodeResponse carries the current QR code for a session awaiting scan.type QrCodeResponse struct {QrCode string `json:"qrCode"`diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionProxy.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionProxy.javanew file mode 100755index 000000000..0cb8b3d13--- /dev/null+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionProxy.java@@ -0,0 +1,12 @@+package com.rmyndharis.openwa.model;++/**+ * Masked per-session proxy configuration returned by GET/PATCH /api/sessions/{id}/proxy.+ * Credentials are never included.+ */+public record SessionProxy(+ boolean enabled,+ ProxyType proxyType,+ String proxyHost,+ boolean hasCredentials+) {}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.javaold mode 100644new mode 100755index f3475d93e..cc1b389f8--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SessionResponse.java@@ -24,4 +24,13 @@ public record SessionResponse(* session mid automatic-reconnect (engine present) and one stopped with no engine. {@code null}* from a gateway older than the field.*/- Boolean engineLoaded) {}+ Boolean engineLoaded,+ /**+ * Whether a per-session egress proxy is configured. {@code null} from a gateway older than the+ * field.+ */+ Boolean proxyEnabled,+ /** Configured proxy protocol when {@code proxyEnabled} is true. */+ ProxyType proxyType,+ /** Parsed host:port from the stored proxy URL — credentials are never returned. */+ String proxyHost) {}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/UpdateSessionProxyRequest.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/UpdateSessionProxyRequest.javanew file mode 100755index 000000000..06cb350c6--- /dev/null+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/UpdateSessionProxyRequest.java@@ -0,0 +1,10 @@+package com.rmyndharis.openwa.model;++/**+ * Update per-session proxy settings. Send {@code proxyUrl: null} to clear.+ * Changes apply on the next start, not to a running engine.+ */+public record UpdateSessionProxyRequest(+ String proxyUrl,+ ProxyType proxyType+) {}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/SessionsResource.java b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/SessionsResource.javaold mode 100644new mode 100755index 0435fad1f..8accfac1d--- a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/SessionsResource.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/SessionsResource.java@@ -10,11 +10,13 @@ import com.rmyndharis.openwa.model.PairingCodeResponse;import com.rmyndharis.openwa.model.QrCodeResponse;import com.rmyndharis.openwa.model.RequestPairingCodeRequest;import com.rmyndharis.openwa.model.SessionConfig;+import com.rmyndharis.openwa.model.SessionProxy;import com.rmyndharis.openwa.model.SessionResponse;import com.rmyndharis.openwa.model.SessionStatsOverview;import com.rmyndharis.openwa.model.SetOwnPresenceRequest;import com.rmyndharis.openwa.model.SuccessResult;import com.rmyndharis.openwa.model.UpdateSessionConfigRequest;+import com.rmyndharis.openwa.model.UpdateSessionProxyRequest;import java.util.List;/** Sessions resource — lifecycle management for WhatsApp sessions. */@@ -50,6 +52,21 @@ public final class SessionsResource {HttpMethod.PATCH, "/api/sessions/" + encodeSegment(id) + "/config", null, body, SessionConfig.class);}+ /** Read a session's masked proxy configuration (credentials never returned). */+ public SessionProxy getProxy(String id) {+ return client.request(+ HttpMethod.GET, "/api/sessions/" + encodeSegment(id) + "/proxy", null, null, SessionProxy.class);+ }++ /**+ * Update per-session proxy settings. No restart is performed — changes apply on the next start.+ * Send {@code proxyUrl: null} to clear the proxy. Requires an OPERATOR-level key.+ */+ public SessionProxy updateProxy(String id, UpdateSessionProxyRequest body) {+ return client.request(+ HttpMethod.PATCH, "/api/sessions/" + encodeSegment(id) + "/proxy", null, body, SessionProxy.class);+ }+/** Get a single session by id. */public SessionResponse get(String id) {return client.request(HttpMethod.GET, "/api/sessions/" + encodeSegment(id), null, null, SessionResponse.class);diff --git a/sdk/javascript/src/resources/sessions.ts b/sdk/javascript/src/resources/sessions.tsold mode 100644new mode 100755index 40ed12e69..055c19c05--- a/sdk/javascript/src/resources/sessions.ts+++ b/sdk/javascript/src/resources/sessions.ts@@ -13,8 +13,10 @@ import type {QrCodeResponse,RequestPairingCodeRequest,SessionConfig,+ SessionProxy,SessionResponse,UpdateSessionConfigRequest,+ UpdateSessionProxyRequest,SessionStatsOverview,SetOwnPresenceRequest,SuccessResult,@@ -54,6 +56,26 @@ export class SessionsResource {});}+ /** Read a session's masked proxy configuration (credentials never returned). */+ getProxy(id: string): Promise<SessionProxy> {+ return this.client.request<SessionProxy>({+ method: 'GET',+ path: `/api/sessions/${encodeSegment(id)}/proxy`,+ });+ }++ /**+ * Update per-session proxy settings. No restart is performed — changes apply on the next start.+ * Send `proxyUrl: null` to clear the proxy. **OPERATOR**+ */+ updateProxy(id: string, body: UpdateSessionProxyRequest): Promise<SessionProxy> {+ return this.client.request<SessionProxy>({+ method: 'PATCH',+ path: `/api/sessions/${encodeSegment(id)}/proxy`,+ body,+ });+ }+/** Get a single session by id. */get(id: string): Promise<SessionResponse> {return this.client.request<SessionResponse>({ method: 'GET', path: `/api/sessions/${encodeSegment(id)}` });diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.tsold mode 100644new mode 100755index 68c66c182..280402f75--- a/sdk/javascript/src/types.ts+++ b/sdk/javascript/src/types.ts@@ -80,6 +80,12 @@ export interface SessionResponse {* with no engine. Absent from a gateway that predates the field.*/engineLoaded: boolean;+ /** Whether a per-session egress proxy is configured. */+ proxyEnabled: boolean;+ /** Configured proxy protocol when `proxyEnabled` is true; otherwise `null`. */+ proxyType?: 'http' | 'https' | 'socks4' | 'socks5' | null;+ /** Parsed host:port from the stored proxy URL — credentials are never returned. */+ proxyHost?: string | null;}/**@@ -179,6 +185,20 @@ export interface UpdateSessionConfigRequest {reconnectBaseDelay?: number | null;}+/** Masked per-session proxy configuration — credentials are never returned. */+export interface SessionProxy {+ enabled: boolean;+ proxyType: 'http' | 'https' | 'socks4' | 'socks5' | null;+ proxyHost: string | null;+ hasCredentials: boolean;+}++/** Update per-session proxy settings. Send `proxyUrl: null` to clear. Applies on the next start. */+export interface UpdateSessionProxyRequest {+ proxyUrl?: string | null;+ proxyType?: 'http' | 'https' | 'socks4' | 'socks5' | null;+}+export interface CreateSessionRequest {/** Alphanumeric + hyphens, 3–50 chars. */name: string;diff --git a/sdk/php/src/Resources/SessionsResource.php b/sdk/php/src/Resources/SessionsResource.phpold mode 100644new mode 100755index f38b719ba..f11ec080a--- a/sdk/php/src/Resources/SessionsResource.php+++ b/sdk/php/src/Resources/SessionsResource.php@@ -53,6 +53,28 @@ class SessionsResourcereturn $this->http->request('PATCH', "/api/sessions/{$this->http->encodeSegment($id)}/config", [], $body);}+ /**+ * Read a session's masked proxy configuration (credentials never returned).+ *+ * @return array{enabled: bool, proxyType: ?string, proxyHost: ?string, hasCredentials: bool}+ */+ public function getProxy(string $id): array+ {+ return $this->http->request('GET', "/api/sessions/{$this->http->encodeSegment($id)}/proxy");+ }++ /**+ * Update per-session proxy settings. No restart — changes apply on the next start.+ * Send proxyUrl: null to clear. OPERATOR role required.+ *+ * @param array{proxyUrl?: ?string, proxyType?: ?string} $body+ * @return array{enabled: bool, proxyType: ?string, proxyHost: ?string, hasCredentials: bool}+ */+ public function updateProxy(string $id, array $body): array+ {+ return $this->http->request('PATCH', "/api/sessions/{$this->http->encodeSegment($id)}/proxy", [], $body);+ }+/** @return array<string,mixed> */public function get(string $id): array{diff --git a/sdk/python/openwa/resources/sessions.py b/sdk/python/openwa/resources/sessions.pyold mode 100644new mode 100755index d70f2533c..c84a62f13--- a/sdk/python/openwa/resources/sessions.py+++ b/sdk/python/openwa/resources/sessions.py@@ -11,7 +11,9 @@ from .._http import quote_segmentfrom ..types import (CreateSessionRequest,SessionConfig,+ SessionProxy,UpdateSessionConfigRequest,+ UpdateSessionProxyRequest,PairingCodeResponse,QrCodeResponse,RequestPairingCodeRequest,@@ -53,6 +55,16 @@ class SessionsResource:"PATCH", f"/api/sessions/{quote_segment(session_id)}/config", body=body)+ def get_proxy(self, session_id: str) -> SessionProxy:+ """Read a session's masked proxy configuration (credentials never returned)."""+ return self._http.request("GET", f"/api/sessions/{quote_segment(session_id)}/proxy")++ def update_proxy(self, session_id: str, body: UpdateSessionProxyRequest) -> SessionProxy:+ """Update per-session proxy settings. No restart — changes apply on the next start."""+ return self._http.request(+ "PATCH", f"/api/sessions/{quote_segment(session_id)}/proxy", body=body+ )+def get(self, session_id: str) -> SessionResponse:"""Return a single session."""return self._http.request("GET", f"/api/sessions/{quote_segment(session_id)}")diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.pyold mode 100644new mode 100755index b120b3f11..9ebea4673--- a/sdk/python/openwa/types.py+++ b/sdk/python/openwa/types.py@@ -233,6 +233,25 @@ class SessionResponse(TypedDict):# session mid automatic-reconnect (engine present) and one stopped with no engine. Absent from a# gateway that predates the field (the TypedDict is total=False).engineLoaded: bool+ proxyEnabled: bool+ proxyType: NotRequired[ProxyType | None]+ proxyHost: NotRequired[str | None]+++class SessionProxy(TypedDict):+ """Masked per-session proxy configuration — credentials are never returned."""++ enabled: bool+ proxyType: ProxyType | None+ proxyHost: str | None+ hasCredentials: bool+++class UpdateSessionProxyRequest(TypedDict, total=False):+ """Update per-session proxy settings. Send proxyUrl=null to clear. Applies on the next start."""++ proxyUrl: str | None+ proxyType: ProxyType | Noneclass SessionConfig(TypedDict):