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

# SharePoint Connector

> Connect Microsoft SharePoint to Roe AI for document access

Connect your Microsoft SharePoint site to Roe AI to access documents and files for agent processing and analysis.

## Use Cases

* **Document Processing**: Access documents stored in SharePoint for extraction and analysis
* **File Import**: Import files from SharePoint into the database for processing
* **Enterprise Data Access**: Connect to your organization's document management system

## Prerequisites

Before connecting SharePoint to Roe AI, ensure you have:

1. An Azure AD application with appropriate permissions
2. The SharePoint site ID you want to connect
3. Admin access to register applications in Azure AD

## Register an Azure AD Application

<Steps>
  <Step title="Open Azure Portal">
    Go to [Azure Portal](https://portal.azure.com) and navigate to **Azure Active Directory**
  </Step>

  <Step title="Register Application">
    Go to **App registrations → New registration**

    * Enter a name (e.g., "Roe AI SharePoint Integration")
    * Select appropriate account type
    * Click **Register**
  </Step>

  <Step title="Configure API Permissions">
    Go to **API permissions → Add a permission → Microsoft Graph**

    Add these **Application permissions**:

    * `Sites.Read.All` - Read items in all site collections
    * `Files.Read.All` - Read files in all site collections

    Click **Grant admin consent**
  </Step>

  <Step title="Create Client Secret">
    Go to **Certificates & secrets → New client secret**

    * Add a description
    * Select expiration period
    * Click **Add** and copy the secret value immediately
  </Step>

  <Step title="Note Application Details">
    From the **Overview** page, copy:

    * **Application (client) ID**
    * **Directory (tenant) ID**
  </Step>
</Steps>

<Warning>
  Store your client secret securely. It's only shown once when created. Roe AI encrypts and stores credentials in AWS Secrets Manager.
</Warning>

## Find Your SharePoint Site ID

The site ID format is: `{hostname}:/sites/{site-name}`

For example: `contoso.sharepoint.com:/sites/ProjectDocs`

You can find your site ID in SharePoint Admin Center or by using the Graph API Explorer.

## Configure the Connection

Provide the following information to connect SharePoint:

### Configuration

| Field       | Required | Description                                                  |
| ----------- | -------- | ------------------------------------------------------------ |
| **Site ID** | Yes      | SharePoint site ID (format: `{hostname}:/sites/{site-name}`) |

### Authentication (Sensitive)

| Field             | Required | Description                                |
| ----------------- | -------- | ------------------------------------------ |
| **Client ID**     | Yes      | Azure AD application (client) ID           |
| **Client Secret** | Yes      | Client secret for the Azure AD application |
| **Tenant ID**     | Yes      | Azure AD directory (tenant) ID             |

## Test the Connection

Click **Test Connection** to verify that Roe AI can successfully connect to your SharePoint site. The test will:

1. Authenticate using your Azure AD credentials
2. Verify access to the Microsoft Graph API
3. Confirm access to the specified SharePoint site

## Available Data

Once connected, agents can access:

### Files

* Documents stored in the SharePoint site
* File metadata (name, size, content type)
* Files from the document library root

### Supported File Types

* Documents: PDF, DOCX, XLSX, PPTX
* Data files: CSV, JSON
* Images: PNG, JPG, GIF

## Security & Permissions

<CardGroup cols={2}>
  <Card title="Read-Only Access" icon="eye">
    Roe AI only reads files—no documents are created, modified, or deleted
  </Card>

  <Card title="Application Permissions" icon="shield">
    Uses Azure AD application permissions for secure, auditable access
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Invalid Azure AD credentials">
    Verify your client ID, client secret, and tenant ID are correct. Client secrets expire—check if yours needs to be regenerated.
  </Accordion>

  <Accordion title="Access denied">
    Ensure the Azure AD application has `Sites.Read.All` and `Files.Read.All` permissions, and that admin consent has been granted.
  </Accordion>

  <Accordion title="Site not found">
    Verify the site ID format is correct: `{hostname}:/sites/{site-name}`. Check that the site exists and is accessible.
  </Accordion>

  <Accordion title="No files returned">
    Ensure there are files in the SharePoint document library root. Files in nested folders may require additional configuration.
  </Accordion>
</AccordionGroup>
