# Gmail

Please follow these instructions to set up your Gmail app and credentials:

{% hint style="warning" %}
This Gmail integration is only configured for Internal emails. If you have an existing project with an OAuth consent configured to external, please consider creating a new Google Project to connect this email to.
{% endhint %}

1. [Create a Google Cloud Project](https://developers.google.com/workspace/guides/create-project). It’s recommended that you create a unique Google Cloud project for this integration.
2. Navigate to the home screen (you can get here by clicking Google Cloud at the top)

<figure><img src="https://lh5.googleusercontent.com/uCWtXLzkyOFLPk2xvPrzTKS4hDNZz-unn0rjguGWN79hElZUI_steNvJxEYPLLo0VIvAGXH8UtqbMl0uAD9sRqtGgO5SVfA3NXWXdwvyktABYaYwtt8qQu3xLTBckhWeRM_N3dWZImEYMhtN-2Xhpt8" alt=""><figcaption><p>A new Google Cloud project</p></figcaption></figure>

3. Click **APIs & Services**
4. Ensure Gmail API is in the list
5. If not, add it using [+ Enable API & Services](https://developers.google.com/workspace/guides/enable-apis) and search for Gmail API.
6. Complete the app registration form (app name, app contact)
7. Add an authorized domain: [middle.app](https://active.middle.app)
8. Click **Save and Continue**

## Connecting an Email to a Middle Account

Once a Middle developer finishes setting up your credentials, you will be able to connect an email address to your Gmail integration.

It is recommended that you [create a Google user/email account within your Google Organization](https://support.google.com/a/answer/33310?hl=en\&ref_topic=14586\&sjid=5487452285989823657-NA) that can be used for this use case. The Gmail address that connects to your Middle account connection will be the one that is used to send emails. If you opted to sync emails as well, this would be the same email address.&#x20;

Once that account is created, you can set up the connection through Middle.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.middle.app/middle-docs/guides/app-reference/gmail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
