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

# SharePoint

> Manage SharePoint sites and OneDrive files via Microsoft Graph

## Overview

SharePoint tools let you list sites, inspect site metadata, browse document libraries, search files, upload files, and download files through Microsoft Graph. They support both SharePoint site drives and the user's OneDrive.

## Key Features

* `SHAREPOINT_LIST_SITES`
  * Search and list SharePoint sites.
* `SHAREPOINT_GET_SITE_INFORMATION`
  * Get site metadata (id, name, URL) from a SharePoint site URL.
* `SHAREPOINT_LIST_DOCUMENTS`
  * List files and folders from SharePoint document libraries or OneDrive.
* `SHAREPOINT_SEARCH_FILES`
  * Search files and folders in a SharePoint document library or OneDrive by file name or keyword, with an optional files/folders filter.
* `SHAREPOINT_UPLOAD_FILE_V2`
  * Upload a file to SharePoint or OneDrive (up to 30 MB). Accepts output files from previous steps, base64 strings, data URLs, or any HTTP(S) URL; files larger than 4 MB are uploaded automatically via chunked upload sessions. Supersedes `SHAREPOINT_UPLOAD_FILE` — prefer this tool for new flows.
* `SHAREPOINT_UPLOAD_FILE`
  * Upload files to SharePoint or OneDrive (simple upload, up to 4MB). Kept for existing flows; use `SHAREPOINT_UPLOAD_FILE_V2` instead.
* `SHAREPOINT_DOWNLOAD_FILE`
  * Download a file from SharePoint or OneDrive. Returns a pre-authenticated download URL or base64-encoded content (max 4 MB).

## Authentication

These tools require a Microsoft Graph OAuth token.

Go to the [Jinba secrets dashboard](https://flow.jinba.io/workspace/secrets) and connect a Microsoft account for SharePoint/OneDrive. Use the generated token in the tool config.

### Example: List Sites and Upload a File

```yaml theme={null}
- id: list_sites
  name: list_sites
  tool: SHAREPOINT_LIST_SITES
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: search
      value: "engineering"

- id: get_site
  name: get_site
  tool: SHAREPOINT_GET_SITE_INFORMATION
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: site_url
      value: "https://contoso.sharepoint.com/sites/Engineering"

- id: list_documents
  name: list_documents
  tool: SHAREPOINT_LIST_DOCUMENTS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # If you omit drive_id, the tool lists the user's OneDrive (me/drive)
    # For SharePoint document libraries, set drive_id to the library's drive ID.
    - name: top
      value: 10

- id: list_sharepoint_documents
  name: list_sharepoint_documents
  tool: SHAREPOINT_LIST_DOCUMENTS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: drive_id
      value: "YOUR_SHAREPOINT_DRIVE_ID"
    - name: top
      value: 10

- id: search_files
  name: search_files
  tool: SHAREPOINT_SEARCH_FILES
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # Omit drive_id to search the user's OneDrive (me/drive)
    - name: query
      value: "quarterly report"
    - name: top
      value: 25
    # "all" (default), "files", or "folders"
    - name: filter
      value: "files"

- id: upload_file
  name: upload_file
  tool: SHAREPOINT_UPLOAD_FILE_V2
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # Omit drive_id to upload to OneDrive (me/drive)
    # file accepts a previous step's output file, base64, a data URL, or an HTTP(S) URL
    - name: file
      value: "{{steps.generate_report.result}}"
    - name: filename
      value: "report.pdf"
    - name: conflict_behavior
      value: "rename"

- id: download_file
  name: download_file
  tool: SHAREPOINT_DOWNLOAD_FILE
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # item_id is retrieved from SHAREPOINT_LIST_DOCUMENTS results
    - name: item_id
      value: "{{steps.list_documents.result.items[0].id}}"
    # "url" (default) returns a pre-authenticated download URL
    # "base64" returns file content as base64 (max 4 MB)
    - name: output_format
      value: "url"
```
