> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailbison.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

OAuth Sessions generate an OAuth URL that can be used to sign-in to Google and Microsoft senders. This enables programatically connecting these senders without going through EmailBison pages.

## Workflow

> [!NOTE]
>
> Refer to the endpoints under the [`OAuth Sessions`](https://dedi.emailbison.com/api/reference#tag/oauth-sessions-beta) section in the API reference for full details.

**1. Create an OAuth Session**

Send a POST request to [**Create Google OAuth Session**](https://dedi.emailbison.com/api/reference#tag/oauth-sessions-beta/POST/api/oauth-sessions/google) or [**Create Microsoft OAuth Session**](https://dedi.emailbison.com/api/reference#tag/oauth-sessions-beta/POST/api/oauth-sessions/microsoft).

This will return an `oauth_session` object, which includes: `id`, `url`, `status`.

**2. Sign-in**

Visit the `url` (or pass it on to your user(s)) and sign-in to the account.

**3. Poll the Session**

Send a GET request to [**View OAuth Session**](https://dedi.emailbison.com/api/reference#tag/oauth-sessions-beta/GET/api/oauth-sessions/\{id}) using the `id`. We recommend polling once every 5 seconds.

Check the returned `status` until it changes from `pending`. Possible values are `pending`, `success`, `failure` and `expired`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.