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

# SharePoint

> Index documents from a SharePoint site into a Vector using a Microsoft Entra ID app registration.

<Badge color="green" shape="pill" icon="sparkles">New</Badge> <Badge color="blue" shape="pill" icon="vector-square">Vectors only</Badge>

# Overview

SharePoint is Microsoft's document management platform. Datazone connects to **one SharePoint site** through Microsoft Graph with app-only (client credentials) access, and indexes the documents in its document libraries into a [Vector](/reference/development/vectors).

<Note>
  SharePoint sources hold documents, not tables. They are used by **Vectors** only — they have no extracts and no schema to infer.
</Note>

## Prerequisites

Create an app registration in Microsoft Entra ID and give it read access to the site. See [How to get the credentials](#how-to-get-the-credentials) below.

## Connection Parameters

Set on the source when you create it. Names match the API and CLI payload.

<ParamField path="name" type="string" required>
  **Name** — a unique identifier for your SharePoint source.
</ParamField>

<ParamField path="site_url" type="string" required>
  **Site URL** — the SharePoint site whose document libraries can be indexed, for example `https://contoso.sharepoint.com/sites/Finance`.
</ParamField>

<ParamField path="tenant_id" type="string" required>
  **Tenant ID** — the Directory (tenant) ID of the app registration.
</ParamField>

<ParamField path="client_id" type="string" required>
  **Client ID** — the Application (client) ID of the app registration.
</ParamField>

<ParamField path="client_secret" type="string" required>
  **Client Secret** — the client secret **value** of the app registration. Stored encrypted.
</ParamField>

## How to get the credentials

<Steps>
  <Step title="Register an app">
    In the [Azure portal](https://portal.azure.com), open **Microsoft Entra ID → App registrations → New registration**. Give it a name such as `datazone-sharepoint` and leave the defaults (single tenant).
  </Step>

  <Step title="Copy the Tenant ID and Client ID">
    On the app's **Overview** page, copy **Directory (tenant) ID** and **Application (client) ID**.
  </Step>

  <Step title="Create a client secret">
    Go to **Certificates & secrets → New client secret**, choose an expiry, and copy the **Value** immediately. It is shown only once. Use the *Value*, not the *Secret ID*.
  </Step>

  <Step title="Grant read permission">
    Go to **API permissions → Add a permission → Microsoft Graph → Application permissions** and add one of:

    * `Sites.Read.All` — read every site in the tenant. Simplest to set up.
    * `Sites.Selected` — read only the sites you explicitly allow. Tighter, but a tenant admin must also grant the app access to your site (for example with `POST /sites/{site-id}/permissions` in Microsoft Graph, role `read`).
  </Step>

  <Step title="Grant admin consent">
    Click **Grant admin consent for \<your tenant>**. This needs a Global Administrator or Privileged Role Administrator. Without it, Datazone gets a `403` from Microsoft Graph.
  </Step>

  <Step title="Copy the Site URL">
    Open the site in SharePoint and copy its address up to the site name, for example `https://contoso.sharepoint.com/sites/Finance`.
  </Step>
</Steps>

## Using the source in a Vector

When you create a [Vector](/reference/development/vectors), choose a connected source as the data source, then pick a path. The vector stores them as `source` and `source_path`, and both must be set together.

The path is `<document library>/<folder path>`:

| Path | Indexes |
| - | - |
| `Documents` | Everything in the `Documents` library |
| `Documents/Policies` | The `Policies` folder and its subfolders |
| `Documents/Policies/handbook.pdf` | A single file |

The path picker in the Datazone UI lets you browse the site's libraries and folders instead of typing the path.

## Limitations

* One source connects to **one site**. Create another source for each additional site.
* Subfolders are indexed recursively.
* Supported file types: **PDF, CSV, DOCX, XLSX, XLS, MD, TXT**. Other files are skipped.
* Access is app-only, so the app sees what its permission allows, not what an individual user can see.

## Troubleshooting

| Error | Likely cause |
| - | - |
| `Microsoft sign-in failed` | Wrong tenant ID, client ID, or secret, or the secret expired. Make sure you copied the secret *Value*. |
| `Microsoft Graph denied access (403)` | Missing Graph application permission, or admin consent not granted. With `Sites.Selected`, the app also needs access to the specific site. |
| `Document library '…' not found` | The first part of the path must match a document library name on the site exactly. |


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