Initiate email OAuth authorization flow
Returns the provider-hosted authorization URL the user must visit to grant mailbox access. The server packs { userId, organizationId, provider } into the OAuth state parameter so the callback can attribute the resulting tokens. Supports Gmail and Outlook.
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Query Parameters
provider?string
Email provider to authorize against. Defaults to gmail.
Default
"gmail"Value in
- "gmail"
- "outlook"
Response Body
application/json
application/json
curl -X GET "https://example.com/api/email/oauth/authorize"{ "authUrl": "https://accounts.google.com/o/oauth2/v2/auth?client_id=...&redirect_uri=https%3A%2F%2Frelay.example%2Fapi%2Femail%2Foauth%2Fcallback&scope=...&state=..."}