POST /accounts/oauth-sessions

Authentication

Send your organization API key as a Bearer credential.

Authorization: Bearer YOUR_API_KEY

Body

application/json
provider string required

Allowed values: google

Example: google
reconnect_account_id number

Existing Google account ID to reconnect. The mailbox address must match.

Range: x ≥ 1, x ≤ 2147483647

Example: 123

Response

application/json

Session created with a Google consent link and admin setup details.

session_id string required
provider string required

Allowed values: google

status string required

Allowed values: pending, connected, failed, expired

expires_at string required

When the one-time Google consent link expires, in UTC. Create a new session if this deadline passes before the Google callback.

account_id number

Returned when status is connected. Reconnecting preserves the existing Coldy account ID.

Example: 123
email string

Present for connected sessions.

error_code string

Present for failed sessions.

Allowed values: consent_denied, workspace_required, mail_access_not_granted, refresh_token_missing, mailbox_mismatch, account_not_found, account_in_use, access_revoked, connection_failed

authorization_url string required

Open in a browser to grant mailbox access to Coldy.

workspace_setup object required

Google Admin setup details for the Coldy app in the Google Workspace organization.

Show child attributes Hide child attributes
workspace_setup.client_id string required

Copy this public OAuth Client ID into the Configure New App search field in Google Admin. The value matches client_id in authorization_url.

Example: example.apps.googleusercontent.com
workspace_setup.app_access_control_url string required

Open App Access Control in Google Admin. Configure the Coldy app for the organizational unit of the mailboxes you want to connect, if the app is not already allowed.

Example: https://admin.google.com/ac/owl/list?tab=configuredApps
workspace_setup.guide_url string required

Coldy guide for authorizing the app in Google Workspace.

Example: https://coldy.ai/guides/how-to-connect-gmail-accounts-to-coldy