> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/settings/document-processing/import/o365-tenant.md).

# O365 Tenant

Use this guide to connect an organisation-owned Microsoft 365 mailbox through a Microsoft Entra application. An administrator needs access to the intended Entra tenant and the matching DocBits organisation. Agree on the mailbox, document destination and credential owner before enabling import.

## 1. Prepare the Entra application <a href="#register-app-on-azure-a-d" id="register-app-on-azure-a-d"></a>

In the [Microsoft Entra admin center](https://entra.microsoft.com/), open **Identity → Applications → App registrations → New registration** in the intended tenant. Choose a recognisable name and the account type approved by your identity administrator. An application used only within your organisation normally uses the single-tenant account option. Record its **Directory (tenant) ID** and **Application (client) ID**. Follow Microsoft's [current registration instructions](https://learn.microsoft.com/en-us/graph/auth-register-app-v2) for the portal steps.

The DocBits tenant form asks for a client secret. Under **Certificates & secrets**, create the secret using the approved expiry policy and record its **Value** while it is available. Store it securely and assign responsibility for rotation before expiry. Enter this Value into **Client App Value** in DocBits. Keep secrets out of screenshots, tickets and documentation.

Leave public-client flows disabled for this secret-based setup unless your identity administrator has established a separate requirement. Microsoft's [client-type guidance](https://learn.microsoft.com/en-us/entra/identity-platform/msal-client-applications) explains why public-client applications cannot safely hold application secrets.

## 2. Approve permission and mailbox scope

Have the Microsoft 365 administrator approve the mail operations and mailbox scope for this application. The Microsoft Graph **Mail.ReadWrite application permission** allows mail access and changes without a signed-in user and requires administrator consent. An unscoped grant covers mailboxes across the organisation. Mail.ReadWrite does not grant permission to send mail; sending features require a separate permission review. See the [Microsoft Graph permission reference](https://learn.microsoft.com/en-us/graph/permissions-reference#mailreadwrite).

Review restricted mailbox access with the Exchange administrator using [RBAC for Applications](https://learn.microsoft.com/en-us/exchange/permissions-exo/application-rbac). Entra permission grants and Exchange RBAC grants combine: adding a scoped RBAC grant alone does not narrow an existing tenant-wide Entra grant. Have the administrator confirm the effective access to the intended mailbox before enabling the source.

## 3. Configure the DocBits tenant connection

Open **Settings → Import → Email Import** in the intended DocBits organisation and select **New**.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-8dbc6a0631927e69ae078e0573bb836176075cd5%2Fdbdc-179-email-overview-en-20261030.png?alt=media" alt="Current English Email Import section with New, the import-log control and table headings; table data and the generated inbound address are covered."><figcaption><p>New opens the email setup wizard. Existing table data and the generated inbound address are covered in this documentation image.</p></figcaption></figure>

Select **OAuth Office365 - Tenant** under **Protocol** and choose **Document Routing** for the intended destination. Complete the tenant fields supplied by your administrator:

| DocBits field    | Enter                                                                 |
| ---------------- | --------------------------------------------------------------------- |
| Tenant ID        | Directory (tenant) ID of the intended Entra tenant.                   |
| Client App ID    | Application (client) ID of the registered application.                |
| Client App Value | The client secret Value from that registration.                       |
| Tenant Type      | The cloud environment for the tenant, such as Commercial or GCC High. |

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-fb34bf5e818ffa96b2a231671deb5958ac0000d2%2Fdbdc-198-email-tenant-wizard-en-20261030.png?alt=media" alt="Current English wizard with OAuth Office365 - Tenant, DocBits routing, three blank credential fields, Commercial tenant type, Test connection and Save."><figcaption><p>The Tenant variant has its own credential form. This example uses the DocBits route and Commercial tenant type; all three credential fields are blank. Test connection and Save were not used for this documentation capture.</p></figcaption></figure>

Use **Test connection** with the authorised tenant credentials before **Save**. Testing contacts the configured service; Save submits the tenant configuration. A successful connection test does not prove that a message or document was imported. If you are only inspecting the form, use **Cancel** or the close control.

## 4. Verify the saved source

For an authorised rollout, use a designated test mailbox and a harmless sample attachment. After saving the source, send a test message to that mailbox, inspect the Email Import list and import logs, and confirm that the document arrives at the selected destination. Review shared-mailbox and message-move options with the administrator as needed. Record the route, mailbox and secret-expiry owner in the internal runbook without the secret.

The documentation check covered the current English menu path, list and blank Tenant wizard. No Entra application, credential, permission, mailbox or import source was created or changed. No connection, tenant authentication or mail-import test was performed. Use the linked Microsoft instructions for their current administration interface.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/settings/document-processing/import/o365-tenant.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
