> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/microsoft-sharepoint.md).

# Microsoft SharePoint

Connect SharePoint to make files available to StackAI or work with files in a workflow. Choose the path that matches your task:

* **Answer questions using a selected set of documents:** [create a knowledge base](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/create-a-knowledge-base.md) and add the files you want to index.
* **Search the connected service when a question is asked:** use [Federated Search](https://docs.stackai.com/guides-and-quickstarts/agent-builder-and-skills/search-connected-apps-with-federated-search.md).
* **Read, create, move, or update a file in a workflow:** choose an action from the reference below.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector             | Authentication                   |
| --------------------- | -------------------------------- |
| SharePoint            | OAuth sign-in                    |
| SharePoint (App-Only) | Application client ID and secret |
| SharePoint (NTLM)     | Windows NTLM                     |

#### SharePoint

Connect to SharePoint using OAuth2 authentication. Enterprise-grade document management and collaboration. Supports both Sites.Read.All (all sites) and Sites.Selected (granted sites only) scopes.

**Set up in Microsoft SharePoint**

1. Use a Microsoft account with access to the SharePoint sites and files required by the workflow.
2. If your tenant restricts user consent, have an administrator approve the StackAI application and requested Microsoft Graph permissions.
3. If the connection uses Sites.Selected, ensure the application has a permission grant for the target site.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **SharePoint**.
2. Select **Connect**, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

StackAI obtains the OAuth credentials during sign-in. You do not need to paste an access token or refresh token.

**Connection notes**

* The signed-in user and the granted permissions determine the content available to this connection.

**Provider documentation:** [Setup reference 1](https://learn.microsoft.com/en-us/graph/permissions-selected-overview), [Setup reference 2](https://learn.microsoft.com/en-us/graph/auth-v2-user).

#### SharePoint (App-Only)

Connect to SharePoint using client credentials for app-only authentication. Ideal for background services and automation. Supports both Sites.Read.All (all sites) and Sites.Selected (granted sites only) application permissions.

**Set up in Microsoft SharePoint**

1. In Microsoft Entra ID, register an application for the tenant that owns the SharePoint content. Record its Application (client) ID and Directory (tenant) ID.
2. Create a client secret and copy its value, not its secret ID.
3. Grant the Microsoft Graph application permissions required for SharePoint access and have an administrator consent to them. If you use Sites.Selected, explicitly grant the application access to each required site.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **SharePoint (App-Only)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field      | Required                 | What to enter                                                                                                                                           |
| ------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Client ID          | Yes                      | Azure AD application client ID. [Provider instructions](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps).     |
| Client Secret      | Yes                      | Azure AD application client secret. [Provider instructions](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps). |
| Tenant ID          | Yes                      | Azure AD tenant ID where the app is registered.                                                                                                         |
| SharePoint Site ID | Optional / as applicable | Optional: Specific SharePoint site ID to target. Format: hostname,guid1,guid2. If provided, the connection will only access this site.                  |

**Connection notes**

* App-only access uses the application’s permissions, not the permissions of the person creating the StackAI connection.
* For Sites.Selected, administrator consent alone does not grant access to a site. A site permission grant is also required.

**Provider documentation:** [Setup reference 1](https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal), [Setup reference 2](https://learn.microsoft.com/en-us/graph/permissions-selected-overview), [Setup reference 3](https://learn.microsoft.com/en-us/graph/auth-v2-service).

#### SharePoint (NTLM)

Connect to SharePoint On-Premise (2019 or older) using NTLM authentication. Legacy document management and collaboration.

**Set up in Microsoft SharePoint**

1. Ask your SharePoint administrator for the on-premises site URL and a Windows account with access to that site.
2. Confirm that the server supports NTLM and that the StackAI deployment can reach it.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **SharePoint (NTLM)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field       | Required | What to enter                                                                                           |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| Username            | Yes      | Windows username in DOMAIN\username format.                                                             |
| Password            | Yes      | Windows password.                                                                                       |
| SharePoint Site URL | Yes      | Full URL to the SharePoint site. [Provider instructions](https://docs.microsoft.com/en-us/sharepoint/). |

**Connection notes**

* Use DOMAIN\username in Username. This connector is for the on-premises SharePoint versions described above; use an OAuth or app-only connector for SharePoint Online.

**Provider documentation:** [Setup reference](https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoint-rest-endpoints).

#### Verify the connection

Check that the connection is healthy, then verify access with a read operation:

1. Add **Get File** and select the saved SharePoint connection.
2. Select a permitted **Site**, **Drive**, and **File**. If discovery is unavailable with Sites.Selected, enter the full Site ID and the required drive and file IDs as described in the action reference.
3. Run the action and confirm that the returned content belongs to the selected file. If access is denied, check the site's application grant as well as Microsoft Graph consent.

A successful connection check confirms authentication. It does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

#### Detailed setup guides

* [Configure SharePoint authentication and site access](https://docs.stackai.com/integrations/catalog/microsoft-sharepoint/configure-sharepoint-authentication-and-site-access.md)
* [Allow StackAI in Microsoft Entra](https://docs.stackai.com/integrations/catalog/microsoft-entra/allow-stackai-in-microsoft-entra.md)

## Use an action

1. Add the required **Microsoft SharePoint** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Search Files

Search for files and documents across SharePoint

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Files.Read.All`
* `Files.ReadWrite.All`

**Inputs**

| Field                      | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site                       | file\_picker              | No       | Optional. Filter search results to a specific SharePoint site. Select from the dropdown or enter the site ID or site name manually. If not provided, searches across all sites. Default: .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Folder or Document Library | file\_picker              | No       | Optional. Restrict results to a document library or a folder within one. Browse and pick it, or enter its ID manually. Subfolders are included. Supersedes the Site filter, since the folder already sits inside one site. If not provided, searches every library. Default: .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Search Query               | string                    | Yes      | Search query to find files in SharePoint.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| File Types                 | multiple\_select (string) | No       | Filter results by specific file types. Available values: PDF, Word Document (.docx), Excel Spreadsheet (.xlsx), PowerPoint (.pptx), Text File (.txt), CSV File (.csv), Word Document (.doc), Excel Spreadsheet (.xls), PowerPoint (.ppt), JPEG Image (.jpg), JPEG Image (.jpeg), HTML Document (.html), HTML Document (.htm), Outlook Message (.msg), Email Message (.eml), Excel Macro-Enabled (.xlsm), Word Macro-Enabled (.docm), PowerPoint Macro-Enabled (.pptm), Excel Binary (.xlsb), Visio Drawing (.vsdx), Visio Drawing (.vsd), Publisher Document (.pub), ZIP Archive (.zip), XML Document (.xml), Rich Text Format (.rtf), OpenDocument Text (.odt), OpenDocument Spreadsheet (.ods), OpenDocument Presentation (.odp), Web Archive (.mhtml). Default: \[]. |
| Max Results                | integer                   | No       | Maximum number of results to return (minimum: 1) and (default: 20). Minimum: 1. Default: 20.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

**Outputs**

| Field       | Type          | Description                  |
| ----------- | ------------- | ---------------------------- |
| Files       | object\_array | List of found files.         |
| Total Count | number        | Total number of files found. |

#### Create Word Document

Create a Word (DOCX) file in SharePoint with supplied text. Maximum file size: 20 MiB.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field                  | Type         | Required | Description                                                                                                                                    |
| ---------------------- | ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| File Name              | string       | Yes      | Name of the Word document to create (must end in .docx).                                                                                       |
| Site                   | file\_picker | Yes      | Select the SharePoint site where the document will be created. This can be a site name or a full site ID with the format 'hostname,GUID,GUID'. |
| Content                | textarea     | Yes      | Document content in Markdown format.                                                                                                           |
| Folder Path (Optional) | string       | No       | Destination folder. Leave empty for root folder.                                                                                               |

**Outputs**

| Field             | Type   | Description                                        |
| ----------------- | ------ | -------------------------------------------------- |
| File ID           | string | Unique identifier of the created file.             |
| File Name         | string | Name of the created file.                          |
| File URL          | string | URL to open the document in SharePoint / OneDrive. |
| File Size (Bytes) | number | Size of the created file in bytes.                 |

#### Get File

Download a file from SharePoint and extract its content.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.Read`
* `Files.ReadWrite`
* `Files.Read.All`
* `Files.ReadWrite.All`
* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only files on sites explicitly granted to the application are accessible

**Inputs**

| Field                        | Type            | Required | Description                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Site                         | file\_picker    | Yes      | Browse your SharePoint sites and pick the one that contains the file, or enter the site ID or site name manually. If providing a site id, this field is expecting a full site ID in the format 'hostname,{site\_collection\_guid},{site\_web\_guid}'. Alternatively, you can enter the site name directly for OAuth connections.                                         |
| Drive                        | select (string) | Yes      | Select the drive or document library that contains the file, or enter the drive ID manually. Options load from the selected connection.                                                                                                                                                                                                                                  |
| File                         | select (string) | Yes      | Choose the file to download, enter the file ID, or enter the file name manually. When entering the file id, the format is 'drive\_id\|file\_id'. (Dropdown displays up to 500 files). Options load from the selected connection.                                                                                                                                         |
| Folder Path                  | string          | No       | Optional. Folder path relative to the drive root that contains the file (e.g. 'Reports/2026'). Used only when you enter a file name in the File field: the file is then located by exact path instead of search, which reliably finds recently added files and files whose name is not unique. Ignored when a file is chosen from the dropdown or a file ID is provided. |
| Get Content                  | boolean         | No       | Whether to extract the file's text content. The download URL is always returned. Enabled by default. Default: true.                                                                                                                                                                                                                                                      |
| Create Sharing Link          | boolean         | No       | When enabled, calls Microsoft Graph createLink to add a sharing link in the output. When disabled, no createLink request is made. Default: false.                                                                                                                                                                                                                        |
| Sharing Link Type            | select (string) | No       | Graph createLink type: view (read-only) or edit (read-write). Available values: View, Edit. Default: view.                                                                                                                                                                                                                                                               |
| Retain Inherited Permissions | boolean         | No       | If true (default), existing inherited permissions are kept when sharing for the first time. If false, inherited permissions are removed when sharing for the first time. Default: true.                                                                                                                                                                                  |
| Sharing Link Scope           | select (string) | No       | Graph createLink scope: anonymous (anyone with the link) or organization (signed-in tenant users). Available values: Anonymous, Organization. Default: organization.                                                                                                                                                                                                     |

**Outputs**

| Field            | Type   | Description                                                                                                                                                                |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| File ID          | string | The unique identifier of the file.                                                                                                                                         |
| File Name        | string | The name of the file.                                                                                                                                                      |
| SharePoint URL   | string | The web URL to the file in SharePoint.                                                                                                                                     |
| File Content     | string | Extracted content (no OCR). Excel workbooks (.xlsx, .xlsm, .xltx, .xltm) are returned as CSV per sheet with labeled sections; other types use the standard text extractor. |
| Download URL     | string | Signed download URL for the file (expires in 24 hours). Can be passed to other nodes.                                                                                      |
| Modified Date    | string | When the file was last modified in SharePoint (ISO 8601, UTC).                                                                                                             |
| Created Date     | string | When the file was created in SharePoint (ISO 8601, UTC).                                                                                                                   |
| Size (bytes)     | number | Size of the file in bytes.                                                                                                                                                 |
| Last Modified By | string | Display name of the user who last modified the file.                                                                                                                       |
| Sharing Link     | string | Sharing link URL from Microsoft Graph createLink when Create Sharing Link is enabled; otherwise null.                                                                      |

#### Get Page

Download a page from SharePoint and extract its text content

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted read access

**Inputs**

| Field | Type            | Required | Description                                                                                                                                                                                                                                                                            |
| ----- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site  | file\_picker    | Yes      | Select the SharePoint site that contains the page, or enter the site ID or site name manually. If providing a site id, this field is expecting a full site ID in the format'hostname,{site\_collection\_guid},{site\_web\_guid}'. Alternatively, you can enter the site name directly. |
| Page  | select (string) | Yes      | Choose the page to download (Dropdown displays up to 500 pages). Options load from the selected connection.                                                                                                                                                                            |

**Outputs**

| Field          | Type   | Description                                               |
| -------------- | ------ | --------------------------------------------------------- |
| Page ID        | string | The unique identifier of the page.                        |
| Page Title     | string | The title of the page.                                    |
| SharePoint URL | string | The web URL to the page in SharePoint.                    |
| Page Content   | string | The extracted text content of the page (markdown format). |

#### Upload File

Upload a file to SharePoint from a public HTTP(S) URL or from in-workflow content (text or bytes). Up to 250 MB.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field                  | Type            | Required | Description                                                                                                                                                                                                                                                                                    |
| ---------------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| File Name              | string          | Yes      | Name of the file to upload, including its extension (e.g. 'report.pdf', 'notes.md'). Extension is required.                                                                                                                                                                                    |
| Content Source         | select (string) | No       | How to provide the file body. Pick 'URL' to fetch from a public HTTP(S) URL, or 'Text' to write content produced in the workflow (e.g. transformed markdown) directly. Leave empty and the action infers from whichever of File URL or File Content is filled in. Available values: URL, Text. |
| File URL               | string          | No       | Public HTTPS URL of the file to upload. Used when Content Source is 'URL'.                                                                                                                                                                                                                     |
| File Content           | textarea        | No       | Raw text or bytes to write as the file. Used when Content Source is 'Text'. File Name's extension drives rendering: '.pdf' renders markdown -> PDF, '.docx' renders markdown -> Word; other extensions store text as-is.                                                                       |
| Site                   | file\_picker    | Yes      | Select the SharePoint site where the document will be created. This can be a site name or a full site ID with the format 'hostname,GUID,GUID'.                                                                                                                                                 |
| Drive                  | select (string) | No       | Document library to upload into. Pick from the dropdown (the site's document libraries) or enter a drive ID manually. Leave empty to use the site's default document library. Options load from the selected connection.                                                                       |
| Folder Path (Optional) | select (string) | No       | Folder to upload the file to. Pick from the dropdown (top-level folders in the site's default document library) or hand-type a deeper path. Leave empty for the library root. Options load from the selected connection.                                                                       |
| Replace Existing       | boolean         | No       | If true, replace the existing file with the same name. If false, rename the file to avoid conflicts. Default: false.                                                                                                                                                                           |

**Outputs**

| Field             | Type    | Description                                                                                            |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| File ID           | string  | Unique identifier of the uploaded file.                                                                |
| File Name         | string  | Name of the uploaded file. If the file name was renamed to avoid conflicts, this will be the new name. |
| File URL          | string  | URL to open the file in SharePoint / OneDrive.                                                         |
| File Size (Bytes) | number  | Size of the uploaded file in bytes.                                                                    |
| Was Renamed       | boolean | True if SharePoint renamed the file to avoid a name conflict (e.g. report.pdf -> report (1).pdf).      |
| Requested Name    | string  | Original file name the caller asked for (before any rename).                                           |

#### Update File

Update a file's content and/or name in SharePoint.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field                | Type            | Required | Description                                                                                                                                                                                               |
| -------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site                 | file\_picker    | Yes      | Select the SharePoint site that contains the file, or enter the site ID or site name manually.                                                                                                            |
| Drive                | select (string) | Yes      | Select the drive or document library that contains the file, or enter the drive ID. Options load from the selected connection.                                                                            |
| File                 | select (string) | Yes      | Choose the file to update, or enter the file ID manually. When entering the file id, the format is 'drive\_id\|file\_id'. (Dropdown displays up to 500 files). Options load from the selected connection. |
| New File Name        | string          | No       | New name for the file (include extension). Leave empty to keep current name.                                                                                                                              |
| New Content (Text)   | textarea        | No       | New text content for the file. Use this OR base64 content OR file URL, not multiple.                                                                                                                      |
| New Content (Base64) | string          | No       | New base64-encoded binary content. Use this OR text content OR file URL, not multiple.                                                                                                                    |
| File URL             | string          | No       | URL to download replacement content from. Use this OR text/base64 content, not multiple.                                                                                                                  |

**Outputs**

| Field     | Type   | Description                         |
| --------- | ------ | ----------------------------------- |
| File ID   | string | The ID of the updated file.         |
| File Name | string | The name of the updated file.       |
| Web URL   | string | URL to view the file in SharePoint. |
| File Size | number | File size in bytes.                 |
| Result    | string | Result message.                     |

#### Create Folder

Create a new folder in SharePoint.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field                         | Type         | Required | Description                                                                                                                                  |
| ----------------------------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Folder Name                   | string       | Yes      | Name for the new folder.                                                                                                                     |
| Site                          | file\_picker | Yes      | Select the SharePoint site where the folder will be created. This can be a site name or a full site ID with the format 'hostname,GUID,GUID'. |
| Parent Folder Path (Optional) | string       | No       | Parent folder path. Leave empty for root.                                                                                                    |

**Outputs**

| Field       | Type   | Description                      |
| ----------- | ------ | -------------------------------- |
| Folder ID   | string | The ID of the created folder.    |
| Folder Name | string | The name of the created folder.  |
| Web URL     | string | URL to the folder in SharePoint. |
| Result      | string | Result message.                  |

#### Delete File

Delete a file from SharePoint (moves to recycle bin).

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field | Type            | Required | Description                                                                                                                                                                                               |
| ----- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site  | file\_picker    | Yes      | Select the SharePoint site that contains the file, or enter the site ID or site name manually.                                                                                                            |
| Drive | select (string) | Yes      | Select the drive or document library that contains the file, or enter the drive ID. Options load from the selected connection.                                                                            |
| File  | select (string) | Yes      | Choose the file to delete, or enter the file ID manually. When entering the file id, the format is 'drive\_id\|file\_id'. (Dropdown displays up to 500 files). Options load from the selected connection. |

**Outputs**

| Field     | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| File ID   | string | The ID of the deleted file.   |
| File Name | string | The name of the deleted file. |
| Result    | string | Result message.               |

#### Delete Folder

Delete a folder from SharePoint (moves the folder and its contents to the recycle bin).

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field  | Type         | Required | Description                                                                                                                                |
| ------ | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Folder | file\_picker | Yes      | Browse your SharePoint sites and pick the folder to delete, or enter its ID manually. Deleting a folder also deletes everything inside it. |

**Outputs**

| Field       | Type   | Description                     |
| ----------- | ------ | ------------------------------- |
| Folder ID   | string | The ID of the deleted folder.   |
| Folder Name | string | The name of the deleted folder. |
| Result      | string | Result message.                 |

#### List Sites

List available SharePoint sites.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`

**Inputs**

| Field        | Type   | Required | Description                                   |
| ------------ | ------ | -------- | --------------------------------------------- |
| Search Query | string | No       | Optional search term to filter sites by name. |

**Outputs**

| Field       | Type          | Description                  |
| ----------- | ------------- | ---------------------------- |
| Sites       | object\_array | List of SharePoint sites.    |
| Total Count | number        | Total number of sites found. |

#### List Pages

List pages in a SharePoint site.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted read access

**Inputs**

| Field | Type         | Required | Description                                                                                |
| ----- | ------------ | -------- | ------------------------------------------------------------------------------------------ |
| Site  | file\_picker | Yes      | Select the SharePoint site to list pages from, or enter the site ID or site name manually. |

**Outputs**

| Field       | Type          | Description                  |
| ----------- | ------------- | ---------------------------- |
| Pages       | object\_array | List of SharePoint pages.    |
| Total Count | number        | Total number of pages found. |

#### List Folder Contents

List files and subfolders inside a SharePoint folder, optionally recursively.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.Read`
* `Files.ReadWrite`
* `Files.Read.All`
* `Files.ReadWrite.All`
* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only files on sites explicitly granted to the application are accessible

**Inputs**

| Field            | Type            | Required | Description                                                                                                                                                                                                                                                                                                                                  |
| ---------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site             | file\_picker    | Yes      | Select the SharePoint site that contains the folder, or enter the site ID or site name manually. If providing a site id, this field expects a full site ID in the format 'hostname,{site\_collection\_guid},{site\_web\_guid}'. Alternatively, you can enter the site name directly for OAuth connections.                                   |
| Drive            | select (string) | Yes      | Select the drive or document library that contains the folder, or enter the drive ID manually. Options load from the selected connection.                                                                                                                                                                                                    |
| Folder           | select (string) | No       | Pick a folder from the dropdown, enter a folder path (e.g. 'Reports/2026/Q1'), or enter a folder ID. Leave empty to list the drive root. Options load from the selected connection. Default: .                                                                                                                                               |
| Show             | select (string) | No       | Choose what to return: all items, files only, or folders only. Available values: All (files and folders), Files only, Folders only. Default: all.                                                                                                                                                                                            |
| Recursive        | boolean         | No       | When enabled, lists items from all subfolders recursively. When disabled, only lists direct children. Default: false.                                                                                                                                                                                                                        |
| Max Folder Depth | integer         | No       | Only applies when Recursive is on. Max nested folder levels traversed below the selected folder (1-20). Defaults to 20. Minimum: 1. Maximum: 20. Default: 20.                                                                                                                                                                                |
| Max Results      | integer         | No       | Maximum number of items to return (1-50000). Defaults to 100. Minimum: 1. Maximum: 50000. Default: 100.                                                                                                                                                                                                                                      |
| File Types       | string          | No       | Only return files with specified extensions, leave empty to return every type. Folders are left out if this field is set. Default: \[].                                                                                                                                                                                                      |
| Exclude Item IDs | string          | No       | Item IDs to skip. Either form works: a bare item ID (01ABC...) as returned in Item IDs, or the longer 'drive\_id\|item\_id' from a File ID output. One run returns at most 50,000 items; to read a larger library, pass the Item IDs output of the previous run here, and each run returns the next set of items not yet seen. Default: \[]. |
| Exclude Paths    | string          | No       | Paths to skip, relative to the drive root. A folder path skips that folder and everything below it, so a finished folder costs one entry instead of one per file. Default: \[].                                                                                                                                                              |

**Outputs**

| Field             | Type          | Description                                                                                                                 |
| ----------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- |
| Items             | object\_array | Files and subfolders found in the folder.                                                                                   |
| Item IDs          | string\_array | The IDs of the items returned, ready to feed back into Exclude Item IDs on the next run.                                    |
| Total Count       | number        | Number of items returned.                                                                                                   |
| Has More          | boolean       | True if more items remain beyond the returned results.                                                                      |
| Truncation Reason | string        | Why the listing stopped early. Empty when complete; 'max\_results' / 'scan\_limit' / 'max\_pages' / 'timeout' when partial. |
| Items Scanned     | number        | How many items were examined to produce these results. Higher than the returned count when filters or exclusions are set.   |

#### Move File

Move a file or folder to a different location in SharePoint.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Files.ReadWrite`
* `Files.ReadWrite.All`
* `Sites.ReadWrite.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field               | Type            | Required | Description                                                                                                                                                                                                                         |
| ------------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Site                | file\_picker    | Yes      | Select the SharePoint site that contains the item, or enter the site ID or site name manually.                                                                                                                                      |
| Drive               | select (string) | Yes      | Select the drive or document library that contains the item, or enter the drive ID. Options load from the selected connection.                                                                                                      |
| Source File/Folder  | select (string) | Yes      | Choose the file or folder to move, or enter the item ID manually. When entering the item id, the format is 'drive\_id\|item\_id'. (Dropdown shows files; use text input for folder IDs). Options load from the selected connection. |
| Destination Folder  | select (string) | Yes      | Select the destination folder, or enter the folder ID manually. Format: 'drive\_id\|folder\_id'. Select a drive (without '\|') to move to the drive root. Options load from the selected connection.                                |
| New Name (Optional) | string          | No       | Optionally rename the item at the destination. For files, enter the base name only (e.g. 'Q1 Report') — the original file extension is preserved automatically.                                                                     |
| If Name Conflict    | select (string) | No       | What to do when an item with the same name already exists at the destination. Default: Fail. Available values: Fail, Replace, Rename (append copy number). Default: fail.                                                           |

**Outputs**

| Field   | Type   | Description                                                      |
| ------- | ------ | ---------------------------------------------------------------- |
| Item ID | string | The ID of the moved item.                                        |
| Name    | string | The full name of the moved item (including extension for files). |
| Web URL | string | URL to view the item in SharePoint.                              |
| Path    | string | The new path of the item in the drive.                           |
| Result  | string | Result message.                                                  |

#### List Lists

List the SharePoint lists in a site.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`

**Inputs**

| Field | Type         | Required | Description                                                                                         |
| ----- | ------------ | -------- | --------------------------------------------------------------------------------------------------- |
| Site  | file\_picker | Yes      | Select the SharePoint site whose lists you want to see, or enter the site ID or site name manually. |

**Outputs**

| Field       | Type          | Description               |
| ----------- | ------------- | ------------------------- |
| Lists       | object\_array | Lists found in the site.  |
| Total Count | number        | Number of lists returned. |

#### Get List

Get a SharePoint list's metadata and columns.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`

**Inputs**

| Field | Type            | Required | Description                                                                                    |
| ----- | --------------- | -------- | ---------------------------------------------------------------------------------------------- |
| Site  | file\_picker    | Yes      | Select the SharePoint site that contains the list, or enter the site ID or site name manually. |
| List  | select (string) | Yes      | Select the list, or enter its ID or name manually. Options load from the selected connection.  |

**Outputs**

| Field         | Type          | Description                                            |
| ------------- | ------------- | ------------------------------------------------------ |
| List ID       | string        | Unique identifier of the list.                         |
| Name          | string        | Internal name of the list.                             |
| Display Name  | string        | Human-readable name of the list.                       |
| Description   | string        | Description of the list.                               |
| Web URL       | string        | URL to open the list in a browser.                     |
| Template      | string        | List template (e.g. 'genericList', 'documentLibrary'). |
| Created Date  | string        | ISO 8601 creation timestamp.                           |
| Modified Date | string        | ISO 8601 last modified timestamp.                      |
| Columns       | object\_array | Columns defined on the list.                           |

#### Get List Items

Read the items (rows) of a SharePoint list, including their column values.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.Read.All`
* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`

**Inputs**

| Field       | Type            | Required | Description                                                                                             |
| ----------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| Site        | file\_picker    | Yes      | Select the SharePoint site that contains the list, or enter the site ID or site name manually.          |
| List        | select (string) | Yes      | Select the list, or enter its ID or name manually. Options load from the selected connection.           |
| Max Results | integer         | No       | Maximum number of items to return (1-20000). Defaults to 100. Minimum: 1. Maximum: 20000. Default: 100. |

**Outputs**

| Field       | Type          | Description                                            |
| ----------- | ------------- | ------------------------------------------------------ |
| Items       | object\_array | Items (rows) found in the list.                        |
| Total Count | number        | Number of items returned.                              |
| Has More    | boolean       | True if more items remain beyond the returned results. |

#### Create List Item

Add a new item (row) to a SharePoint list.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field         | Type            | Required | Description                                                                                                                        |
| ------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Site          | file\_picker    | Yes      | Select the SharePoint site that contains the list, or enter the site ID or site name manually.                                     |
| List          | select (string) | Yes      | Select the list, or enter its ID or name manually. Options load from the selected connection.                                      |
| Fields (JSON) | textarea        | Yes      | The column values for the new item, as a JSON object keyed by internal column name (e.g. {"Title": "New task", "Status": "Open"}). |

**Outputs**

| Field   | Type   | Description                        |
| ------- | ------ | ---------------------------------- |
| Item ID | string | The ID of the created item.        |
| Fields  | object | Column values of the created item. |
| Web URL | string | URL to open the item in a browser. |
| Result  | string | Result message.                    |

#### Update List Item

Update the column values of a SharePoint list item.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field         | Type            | Required | Description                                                                                                                                   |
| ------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Site          | file\_picker    | Yes      | Select the SharePoint site that contains the list, or enter the site ID or site name manually.                                                |
| List          | select (string) | Yes      | Select the list, or enter its ID or name manually. Options load from the selected connection.                                                 |
| Item          | select (string) | Yes      | Select the item to update, or enter its ID manually. Options load from the selected connection.                                               |
| Fields (JSON) | textarea        | Yes      | The column values to update, as a JSON object keyed by internal column name (e.g. {"Status": "Done"}). Only the provided columns are changed. |

**Outputs**

| Field   | Type   | Description                     |
| ------- | ------ | ------------------------------- |
| Item ID | string | The ID of the updated item.     |
| Fields  | object | Column values after the update. |
| Result  | string | Result message.                 |

#### Delete List Item

Delete an item (row) from a SharePoint list.

**Permission alternatives**

The connection must grant one of these sets of permissions:

* `Sites.ReadWrite.All`
* `Sites.Manage.All`
* `Sites.FullControl.All`
* `Sites.Selected` — Only sites explicitly granted write access

**Inputs**

| Field | Type            | Required | Description                                                                                     |
| ----- | --------------- | -------- | ----------------------------------------------------------------------------------------------- |
| Site  | file\_picker    | Yes      | Select the SharePoint site that contains the list, or enter the site ID or site name manually.  |
| List  | select (string) | Yes      | Select the list, or enter its ID or name manually. Options load from the selected connection.   |
| Item  | select (string) | Yes      | Select the item to delete, or enter its ID manually. Options load from the selected connection. |

**Outputs**

| Field   | Type   | Description                 |
| ------- | ------ | --------------------------- |
| Item ID | string | The ID of the deleted item. |
| Result  | string | Result message.             |

### Triggers

A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.

#### On File Created/Updated

Trigger a workflow execution when a new file is created/updated in SharePoint.

**Configuration**

| Field                      | Type         | Required | Description                                                                                                                                                                      |
| -------------------------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Folder or Document Library | file\_picker | Yes      | Browse your SharePoint sites and pick a folder or a document library to watch for new or updated files. Use Include subfolders to control whether nested subfolders are watched. |
| Include subfolders         | boolean      | No       | Also fire for files in nested subfolders, not just those directly in the selected folder or library. Default: false.                                                             |

**Event inputs**

| Field        | Type   | Required | Description                                               |
| ------------ | ------ | -------- | --------------------------------------------------------- |
| File ID      | string | Yes      | The unique identifier of the created file.                |
| File Name    | string | Yes      | The name of the created file.                             |
| File Path    | string | Yes      | The path to the created file within the document library. |
| File Content | string | Yes      | The content of the created file (if text-based).          |

**Outputs**

| Field        | Type   | Description                                               |
| ------------ | ------ | --------------------------------------------------------- |
| File ID      | string | The unique identifier of the created file.                |
| File Name    | string | The name of the created file.                             |
| File Path    | string | The path to the created file within the document library. |
| File Content | string | The content of the created file (if text-based).          |

#### On File Created/Updated (Polling)

Trigger a workflow execution when a new file is created/updated in SharePoint using periodic polling.

**Configuration**

| Field                      | Type         | Required | Description                                                                                                                                                                      |
| -------------------------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Folder or Document Library | file\_picker | Yes      | Browse your SharePoint sites and pick a folder or a document library to watch for new or updated files. Use Include subfolders to control whether nested subfolders are watched. |
| Include subfolders         | boolean      | No       | Also fire for files in nested subfolders, not just those directly in the selected folder or library. Default: false.                                                             |

**Event inputs**

| Field        | Type   | Required | Description                                               |
| ------------ | ------ | -------- | --------------------------------------------------------- |
| File ID      | string | Yes      | The unique identifier of the created file.                |
| File Name    | string | Yes      | The name of the created file.                             |
| File Path    | string | Yes      | The path to the created file within the document library. |
| File Content | string | Yes      | The content of the created file (if text-based).          |

**Outputs**

| Field        | Type   | Description                                               |
| ------------ | ------ | --------------------------------------------------------- |
| File ID      | string | The unique identifier of the created file.                |
| File Name    | string | The name of the created file.                             |
| File Path    | string | The path to the created file within the document library. |
| File Content | string | The content of the created file (if text-based).          |

### Important behavior

If an operation is denied, check the connection’s granted permissions and the account’s access in the provider. Reauthorize the connection when it needs additional permissions.

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# 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.stackai.com/integrations/catalog/microsoft-sharepoint.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.
