# O365 Tenant

## Register App on Azure AD

<mark style="color:red;">**Note**</mark>: The permissions may require authorization from an administrator.

1. Sign in to the [Azure Portal](https://portal.azure.com/) using your credentials.
2. From Azure services, locate and open Azure Active Directory (also known as Azure AD).

<figure><img src="/files/RGysEOTrCvpla2f5PrXj" alt=""><figcaption></figcaption></figure>

3. Under the **Manage** section, select **App registrations**.

<figure><img src="/files/zIX9xNwFu2zSaXYuk13p" alt=""><figcaption></figcaption></figure>

4. In the App registrations screen, click **+ New registration**.

<figure><img src="/files/i4SuaoEGJvyN0rX6fyXB" alt=""><figcaption></figcaption></figure>

5. The **Register an application** screen displays. Enter the user-facing display name for the App in **Name**.

<figure><img src="/files/CJvV5Xtmsfk2JjkMDOxU" alt=""><figcaption></figcaption></figure>

6. Select one of the following account types depending on your needs:

* **Accounts in any organizational directory (Any Azure AD directory Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)**
* **Accounts in any organizational directory (Any Azure AD directory Multitenant)**

<figure><img src="/files/603QhqtBhbz9d8hWyD9J" alt=""><figcaption></figcaption></figure>

7. Leave the option **Redirect URI (optional)** as is.

<figure><img src="/files/HtpYtQLy3blPtPC0ipz3" alt=""><figcaption></figcaption></figure>

8. Click **Register** to complete the App registration. This will return you to the screen for the new App.
9. In the App screen, locate the **Application (client) ID**. Copy it to be used when configuring email import for **DocBits**.

<figure><img src="/files/tBi2Wv5hVGHTRQR2hW8q" alt=""><figcaption></figcaption></figure>

10. From left panel, select **Certificates & secrets**:

<figure><img src="/files/zYq1YQhUvyT8uigJb5vS" alt=""><figcaption></figcaption></figure>

11. In the **Certificates & secrets** screen, click on **+ New client secret** button under **Client secrets** section:

<figure><img src="/files/IxGhBTEmEdAkAu6lUcdK" alt=""><figcaption></figcaption></figure>

12. In the **Add a client secret** dialog box, click the **Add** button:

<figure><img src="/files/704SvSiOqU7abYfGKmsl" alt=""><figcaption></figcaption></figure>

It is recommended to fill in a description to identify this secret among many (as of now the limit is 2 secrets per App).

<figure><img src="/files/dCsekRuKsFdtv84QTKlx" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">**Note**</mark>: Select this expiration date according to your company policy. Once expired, a new client secret will need to be created and specified for each email configuration where it was used previously.

13. The newly generated client secret will be visible. Copy this client secret to be used when configuring email import for DocBits

<figure><img src="/files/ZODiDz6url1xoHcj4tCu" alt=""><figcaption></figcaption></figure>

**Important:** Ensure that you have copied the client secret as the client secret will not display again once it is closed.

14. Select **Authentication** on the left panel. This will present the **Authentication** screen on the right-hand side.

<figure><img src="/files/NQ1KWsk2uoG0Qx6W4U8m" alt=""><figcaption></figcaption></figure>

15. In the **Advanced settings** section, click **Yes** for **Default client type**.

<figure><img src="/files/eA7Hk6au4rrjNnMKON6S" alt=""><figcaption></figcaption></figure>

16. Click **Save** to confirm changes.

<figure><img src="/files/AYYZgYCzLWv98mPz9G9G" alt=""><figcaption></figcaption></figure>

17. Select **API permissions** on the left panel. This will present the API permissions screen.

<figure><img src="/files/oaXb0yFsiYrWYUYMqRVF" alt=""><figcaption></figcaption></figure>

18. By default the **User.Read** permission from **Microsoft Graph** is present, leave this as is.

<figure><img src="/files/08UkpKm8KCj9Tf5WxMqv" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">**Note**</mark>: This is a required permission. If this permission is not available, then add the permission with the steps mentioned below for **Mail.ReadWrite** permission.

19. Click **+ Add a permission**.This will open the **Request API permissions** panel.

<figure><img src="/files/YdYj93w8rmuiiJtDIprW" alt=""><figcaption></figcaption></figure>

20. Click **Microsoft Graph**.

<figure><img src="/files/lYWpdAErklQmSweXuAks" alt=""><figcaption></figcaption></figure>

21. From the two sub-categories, select **App Permissions**.

<figure><img src="/files/W6RoUSFWQBtSWGfDeYrU" alt=""><figcaption></figcaption></figure>

22. Type **Mail.ReadWrite** in the search box. Select the **Mail.ReadWrite** checkbox for the permission.

<figure><img src="/files/2P0vXlp0pbeCzxwDuEbU" alt=""><figcaption></figcaption></figure>

23. This will enable the **Add permissions** button at the bottom of the panel. Click **Add permissions**.

<figure><img src="/files/IlAZmDSRzGUbpg5ITMzp" alt=""><figcaption></figcaption></figure>

24. This will add the **Mail.ReadWrite** permission to the list of **Configured permissions** for the App.

<mark style="color:red;">**Note**</mark>: Administrator permissions may be required. The administrator will have to authorize the App for using these permissions. Once authorized the granted status will be indicated as follows:

<figure><img src="/files/yAtrna6c2DOCjXHD166K" alt=""><figcaption></figcaption></figure>


---

# 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.docbits.com/administration-and-setup/settings/document-processing/import/o365-tenant.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.
