Docs

SharePoint Export

Push converted documents straight to SharePoint. One API call.

Overview

After converting a document, you can export it directly to a SharePoint document library. No downloading, no manual uploading. One API call and it's there.

Team or Enterprise plan required. SharePoint integration is not available on the Solo plan.

1. Connect your Microsoft account

From the MDDoc dashboard, go to Settings → Microsoft and click Connect Account.

You'll be redirected to Microsoft's login page. Sign in with the account that has access to your SharePoint site. MDDoc requests these permissions:

  • Sites.ReadWrite.All — read and write to SharePoint sites
  • Files.ReadWrite.All — upload files to document libraries

After authorization, you'll see your connected email in the settings page. You can check the connection status via the API:

Check Microsoft connection
curl https://api.mddoc.app/api/settings/microsoft \
  -H "Authorization: Bearer mddoc_YOUR_KEY"
Response
{
  "connected": true,
  "email": "you@company.com"
}

2. Set up a destination

Destinations define where exports go. You create them within a project. Each destination points to a specific SharePoint site and document library.

Create a SharePoint destination
curl -X POST https://api.mddoc.app/api/projects/PROJECT_ID/destinations \
  -H "Authorization: Bearer mddoc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Engineering Docs",
    "type": "sharepoint",
    "config": {
      "site_url": "https://company.sharepoint.com/sites/engineering",
      "library": "Documents",
      "folder": "Specs"
    }
  }'

The config.folder field is optional. If omitted, documents are uploaded to the root of the library.

3. Export a conversion

Once you have a completed conversion and a destination, trigger the export:

Export to SharePoint
curl -X POST https://api.mddoc.app/api/conversions/CONVERSION_ID/export \
  -H "Authorization: Bearer mddoc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "destination_id": "your-destination-uuid" }'
Response
{
  "id": "export-uuid",
  "conversion_id": "conversion-uuid",
  "destination_id": "destination-uuid",
  "status": "exporting",
  "created_at": "2026-02-25T10:35:00Z"
}

Exports run asynchronously. Poll the export status to check when it's done:

Check export status
curl https://api.mddoc.app/api/exports/EXPORT_ID \
  -H "Authorization: Bearer mddoc_YOUR_KEY"

Possible status values: pending, exporting, completed, failed.

Destination types

SharePoint is the primary export target, but MDDoc supports three destination types:

TypeDescriptionPlan
sharepointMicrosoft SharePoint document libraryTeam+
supabaseSupabase Storage bucketTeam+
localLocal file system (self-hosted only)All

Full pipeline example

Convert markdown and export to SharePoint in three API calls:

1. Convert
CONV_ID=$(curl -s -X POST https://api.mddoc.app/api/v1/convert \
  -H "Authorization: Bearer mddoc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Quarterly Report\n\n...",
    "template_id": "TEMPLATE_ID",
    "mapping_id": "MAPPING_ID",
    "response_format": "json"
  }' | jq -r '.conversion_id')
2. Export
curl -X POST https://api.mddoc.app/api/conversions/$CONV_ID/export \
  -H "Authorization: Bearer mddoc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "destination_id": "DEST_ID" }'
3. Check status
curl https://api.mddoc.app/api/exports/EXPORT_ID \
  -H "Authorization: Bearer mddoc_YOUR_KEY"

When the export completes, the document is sitting in your SharePoint library. No browser needed.

Troubleshooting

Export fails with "not connected"

Your Microsoft account isn't linked, or the OAuth token has expired. Reconnect from Settings → Microsoft.

Export fails with "access denied"

The Microsoft account doesn't have write access to the target site or library. Check permissions in SharePoint admin.

Export stays in "exporting" state

SharePoint may be slow to respond. Wait a minute and check again. If it stays stuck, the export likely failed silently — check the audit log for details.

That's everything

You've covered the full MDDoc documentation. Go back to the docs overview or start building with the Quick Start guide.