---
title: SharePoint
description: Forward SAP documents to SharePoint Online document libraries. Supports site resolution, custom libraries, folder paths, and chunked upload.
type: sharepoint
use_cases:
  - Enterprise document collaboration for SAP data
  - SharePoint-based SAP document workflows
  - Team access to SAP invoices and POs
config_fields:
  - name: site_url
    type: string
    required: true
    desc: "SharePoint site URL (e.g. https://contoso.sharepoint.com/sites/finance)"
  - name: library_name
    type: string
    required: false
    desc: "Document library name (default: Documents)"
  - name: folder_path
    type: string
    required: false
    desc: "Folder path within the library"
credential_fields:
  - name: client_id
    type: string
    required: true
    desc: "Azure AD App Client ID"
  - name: client_secret
    type: string
    required: true
    desc: "Azure AD Client Secret"
  - name: tenant_id
    type: string
    required: true
    desc: "Azure AD Tenant ID"
---

Store SAP documents in SharePoint Online document libraries. FileRelay uses the Microsoft Graph API to upload files, resolve sites from URLs, and create folders automatically.

## Setup

1. Register an app in **Azure AD** (portal.azure.com > App Registrations)
2. Add **Microsoft Graph** API permissions: `Sites.ReadWrite.All` (Application type)
3. Grant admin consent for the permissions
4. Create a client secret
5. In FileRelay, add a **SharePoint** destination with the site URL and Azure AD credentials

## How It Works

FileRelay resolves the SharePoint site from the URL you provide, finds the specified document library (defaults to "Documents"), and uploads files using the Graph API.

For files larger than 4MB, FileRelay automatically uses chunked upload sessions — no configuration needed.

## Folder Structure

Documents are uploaded to:

```
{library}/{folder_path}/{subfolder}/{doc_id}.{ext}
```

Folders are created automatically if they don't exist.

## Azure AD Permissions

| Permission | Type | Purpose |
|-----------|------|---------|
| `Sites.ReadWrite.All` | Application | Read/write to all SharePoint sites |

> For least-privilege access, you can use `Sites.Selected` and grant access to specific sites via PowerShell.
