Start Gmail OAuth connect
POST /v1/gateway/providers/:id/oauth/init — Begin a Google OAuth consent flow for an OAuth-style messaging provider (`email-gmail`). The gateway binds a loopback ca
POST /v1/gateway/providers/:id/oauth/init
Begin a Google OAuth consent flow for an OAuth-style messaging provider (email-gmail). The gateway binds a loopback callback, returns the Google authorizeUrl for the browser to open, then on the callback exchanges the code and persists the connection (GMAIL_REFRESH_TOKEN + GMAIL_SENDER_EMAIL). The web UI polls GET /v1/auth/oauth/flows/:state until done. Returns 400 google_client_not_configured when the operator's Google client id/secret are unset, 404 provider_not_oauth for non-OAuth providers, and 409 port_in_use when the callback port is busy.
| Method | POST |
| Path | /v1/gateway/providers/:id/oauth/init |
| Auth | Authorization: Bearer <token> required when GATEWAY_AUTH_TOKEN is set |
| Category | gateway |
Response body
{ "authorizeUrl": "https://accounts.google.com/o/oauth2/v2/auth?...", "state": "...", "flowId": "...", "redirectUri": "http://127.0.0.1:1457/callback", "expiresAt": 1730000000000 }