Mixedbread
EndpointsIntegrations

Reconnect Google Drive

GET/v1/integrations/google_drive/installations/{installation_id}/oauth/authorize

Authorization

Authorizationstringrequired

Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`

Path Parameters

installation_idstring(uuid)required

Google Drive installation ID

Query Parameters

referencestring

Opaque value echoed back as `reference` on the return URL, so your app can match the outcome to the user who started the flow

Constraints

•Maximum length: 255

Response

307 with Location set to the provider's consent page, or 404 when the organization has no Google Drive installation with this ID. The person must sign in with the Google account already connected to the installation. The installation keeps its store. After consent the browser is redirected to the return URL registered on the organization's app, with these query parameters appended:

providerstringrequired

The connector: google_drive

statusenumrequired
installation_idstring

The reconnected installation. Present when `status` is `connected`.

errorenum

Why consent failed. Present when `status` is `error`. `reconnect_account_mismatch` means consent was given for a different account than the installation's. Provider errors such as `access_denied` are passed through.

Possible values

access_deniedmissing_codereconnect_account_mismatchinvalid_statetoken_exchange_failedcallback_failed
referencestring

The `reference` passed to reconnect, when one was passed. Present on both outcomes.

Request
cURL
GET/v1/integrations/google_drive/installations/{installation_id}/oauth/authorize
curl -s -o /dev/null -w '%{redirect_url}' \
  'https://api.mixedbread.com/v1/integrations/google_drive/installations/2f1c9a8e-6b4d-4e3a-9c1f-7d8e5b6a4c21/oauth/authorize?reference=user-42' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Redirects
cURL
# Location header of the 307: send the browser here
https://accounts.google.com/o/oauth2/v2/auth?client_id=…&redirect_uri=…&scope=…&access_type=offline&state=…

# Return URL after consent
https://platform.example.com/connected?provider=google_drive&status=connected&installation_id=2f1c9a8e-6b4d-4e3a-9c1f-7d8e5b6a4c21&reference=user-42

# Return URL when consent was given for a different account
https://platform.example.com/connected?provider=google_drive&status=error&error=reconnect_account_mismatch&reference=user-42