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.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Email provider to authorize against. Defaults to gmail.
gmail, outlook Response
Authorization URL returned
Response from GET /api/email/oauth/authorize.
Fully-qualified provider-hosted authorization URL. Frontends open this in a new window or top-level navigation; the provider will redirect to /api/email/oauth/callback once the user consents.