Organizations

Connect a mailbox on behalf of a user or group (admin)

GET
/api/organizations/{organizationId}/email-accounts/oauth/authorize

Returns the provider authorization URL for an admin connecting a mailbox into the SELECTED organization, pre-linked to exactly one user or group of that organization. The signed OAuth state carries the selected organization, so the callback stores the mailbox there. Admin or SuperAdmin.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

organizationId*string

The organization that owns the mailboxes.

Query Parameters

provider?string
Default"gmail"

Value in

  • "gmail"
  • "outlook"
linkedUserId?string

User to link the mailbox to. Exactly one of linkedUserId / linkedGroupId.

linkedGroupId?string

Active group to link the mailbox to. Exactly one of linkedUserId / linkedGroupId.

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/organizations/string/email-accounts/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=..."}