Mixedbread
EndpointsIntegrations

Authorize Gmail

GET/v1/integrations/gmail/oauth/authorize

Authorization

Authorizationstringrequired

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

Query Parameters

store_namestring

Ingestion store name. A store that already exists is shared: every data source connected to it ingests into it, except another installation of the same account, which would ingest every item again. Without it, the account's default store, numbered past a store another installation of the account feeds. Rejected with `422` when the connect refreshes an existing installation and names a store other than its own.

new_storebooleandefault: false

Ingest into a store created for this connection: the connect fails with `409` when `store_name` names a store that already exists, and without `store_name` the default name is numbered past existing stores. Rejected with `422` when the connect refreshes an existing installation, which keeps its store.

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
installation_idstring(uuid)

[DEPRECATED] Use `GET /v1/integrations/gmail/installations/{installation_id}/oauth/authorize` instead. Gmail installation ID when reconnecting an existing installation.

metadata_contextualizationbooleandefault: true

Contextualize chunks with the connector's curated metadata fields

file_contextualizationbooleandefault: true

Generate an LLM context for each chunk situating it within the full document

ingestion_modeenumdefault: high_quality

Parsing strategy for imported files

Possible values

fasthigh_quality

Response

307 with Location set to the provider's consent page. The request fails before the redirect with 409 when new_store is set and store_name names a store that already exists. After consent the browser is redirected to the return URL registered on the organization's app, with these query parameters appended:

providerstringrequired

The connector: gmail

statusenumrequired
installation_idstring

The installation that was created or reconnected. Present when `status` is `connected`.

errorenum

Why consent failed. Present when `status` is `error`. Provider errors such as `access_denied` are passed through.

Possible values

access_deniedmissing_codestore_in_usestore_existsnew_store_on_refreshstore_change_on_refreshreconnect_account_mismatchinvalid_statetoken_exchange_failedcallback_failed
referencestring

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

Request
cURL
GET/v1/integrations/gmail/oauth/authorize
curl -s -o /dev/null -w '%{redirect_url}' \
  'https://api.mixedbread.com/v1/integrations/gmail/oauth/authorize?store_name=mail-olivia&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=gmail&status=connected&installation_id=2f1c9a8e-6b4d-4e3a-9c1f-7d8e5b6a4c21&reference=user-42

# Return URL when consent fails
https://platform.example.com/connected?provider=gmail&status=error&error=account_already_connected&reference=user-42