logo
MailboxesGet Google OAuth consent URL
Mailboxes

Get Google OAuth consent URL

Returns a Google OAuth authorization URL. The user must open this URL in a browser to grant Gmail access. After authorizing, the mailbox is created automatically via the OAuth callback.

Uses workspace-specific OAuth credentials if configured, otherwise falls back to shared platform credentials.

curl -X POST "https://api.sendkit.ai/v1/mailboxes/connect/google" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "authUrl": "https://accounts.google.com/o/oauth2/v2/auth?client_id=...&redirect_uri=...&response_type=code&scope=...",
    "instructions": "Open this URL in a browser. After authorizing, the mailbox will be created automatically in your workspace."
  }
}
POST
/v1/mailboxes/connect/google
POST
API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Bearer Token
Bearer Tokenstring
Required

API key as Bearer token

API key as Bearer token
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

header
Authorizationstring
Required

Bearer token. API key as Bearer token

Responses

successboolean
dataobject