Skip to main content
Microsoft OneDrive logo

Overview

Add Microsoft OneDrive to any ModuleX agent or workflow. Access and manage files in Microsoft OneDrive through the Microsoft Graph API (https://graph.microsoft.com/v1.0) — search, list, upload, download files, create folders, and produce sharing links using a user’s delegated permissions.
Categories: Cloud Infrastructure · File Storage · Productivity · Auth: OAuth2 · Actions: 11

Authentication

OAuth2 Authentication

Connect using Microsoft (Azure Entra) OAuth
1

Step 1

Go to https://entra.microsoft.com -> App registrations -> New registration
2

Step 2

Set supported account types according to your needs (commonly ‘Accounts in any organizational directory and personal Microsoft accounts’)
4

Step 4

Under API permissions, add Microsoft Graph delegated permissions: Files.ReadWrite.All, Sites.ReadWrite.All, User.Read, offline_access
5

Step 5

Create a client secret under Certificates & secrets
6

Step 6

Copy Application (client) ID and the client secret value

Required Credentials

FieldDescriptionRequiredFormat
Client IDMicrosoft (Azure Entra) App Client IDYes00000000-0000-0000-0000-000000000000
Client SecretMicrosoft (Azure Entra) App Client SecretYes-

OAuth Configuration

  • Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
  • Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token
  • Scopes: Files.ReadWrite.All, Sites.ReadWrite.All, User.Read, offline_access

Available Actions

Parameters

folder_name
string
required
The name of the new folder to be created (e.g. ‘New Folder’).
parent_folder_id
string
The ID of the folder which the new folder should be created within. Omit to create the folder at the drive root.
shared_folder_reference
string
Reference of the shared folder which the new folder should be created in (e.g. ‘/drives/{driveId}/items/{folderId}/children’). Mutually exclusive with parent_folder_id.

Response

{
  "$defs": {
    "CreateFolderResult": {
      "additionalProperties": false,
      "description": "Microsoft Graph response for creating a folder.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "webUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Weburl"
        },
        "parentReference": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Parentreference"
        }
      },
      "title": "CreateFolderResult",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/CreateFolderResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "success"
  ],
  "title": "CreateFolderOutput",
  "type": "object"
}

Parameters

file_id
string
The ID of the file to download. Provide either file_id or file_path.
file_path
string
The path to the file from the root folder (e.g. ‘Documents/My Subfolder/File 1.docx’). Provide either file_id or file_path.
new_file_name
string
required
The file name to save the downloaded content as, under /tmp. Include the file extension.
convert_to_format
string
Optional format to convert the file to. One of: pdf, html.

Response

{
  "$defs": {
    "DownloadFileResult": {
      "additionalProperties": false,
      "description": "Result envelope for download_file — file saved to /tmp + base64 content.",
      "properties": {
        "tmp_file_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tmp File Path"
        },
        "file_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "File Name"
        },
        "size_bytes": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size Bytes"
        },
        "content_base64": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content Base64"
        }
      },
      "title": "DownloadFileResult",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/DownloadFileResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "success"
  ],
  "title": "DownloadFileOutput",
  "type": "object"
}

Parameters

item_id
string
required
The ID of the Excel (.xlsx) file in OneDrive.
table_name
string
required
Name of the table as set in the Table Design tab of Excel.
remove_headers
boolean
By default, the headers are included as the first row. Set true to remove them. (Default: false)
number_of_rows
integer
Number of rows to return. Leave at 0 to return all rows. (Default: 0)

Response

{
  "$defs": {
    "GetExcelTableResult": {
      "additionalProperties": false,
      "description": "Result envelope for get_excel_table — table rows as list[list[str]].",
      "properties": {
        "rows": {
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": "Rows",
          "type": "array"
        },
        "row_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Row Count"
        }
      },
      "title": "GetExcelTableResult",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/GetExcelTableResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "success"
  ],
  "title": "GetExcelTableOutput",
  "type": "object"
}

Parameters

file_id
string
required
The ID of the DriveItem to retrieve.

Response

{
  "$defs": {
    "DriveItemSummary": {
      "additionalProperties": false,
      "description": "A DriveItem (file or folder) as returned by Microsoft Graph.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "webUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Weburl"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        },
        "createdDateTime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Createddatetime"
        },
        "lastModifiedDateTime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lastmodifieddatetime"
        },
        "file": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "File"
        },
        "folder": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Folder"
        },
        "parentReference": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Parentreference"
        }
      },
      "title": "DriveItemSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "item": {
      "anyOf": [
        {
          "$ref": "#/$defs/DriveItemSummary"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "success"
  ],
  "title": "GetFileByIdOutput",
  "type": "object"
}

Parameters

folder_id
string
required
The ID of the folder whose children should be listed.
exclude_folders
boolean
Set true to return only files (omit subfolders). (Default: false)

Response

{
  "$defs": {
    "DriveItemSummary": {
      "additionalProperties": false,
      "description": "A DriveItem (file or folder) as returned by Microsoft Graph.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "webUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Weburl"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        },
        "createdDateTime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Createddatetime"
        },
        "lastModifiedDateTime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Lastmodifieddatetime"
        },
        "file": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "File"
        },
        "folder": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Folder"
        },
        "parentReference": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Parentreference"
        }
      },
      "title": "DriveItemSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/DriveItemSummary"
      },
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListFilesInFolderOutput",
  "type": "object"
}

Response

{
  "$defs": {
    "DriveSummary": {
      "additionalProperties": false,
      "description": "A Drive object as returned by Microsoft Graph.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "driveType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Drivetype"
        },
        "owner": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Owner"
        },
        "quota": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Quota"
        }
      },
      "title": "DriveSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "drives": {
      "items": {
        "$ref": "#/$defs/DriveSummary"
      },
      "title": "Drives",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListMyDrivesOutput",
  "type": "object"
}

Response

{
  "$defs": {
    "SharedFolderReferenceOption": {
      "additionalProperties": false,
      "description": "A {label, value} option usable as create_folder.shared_folder_reference.",
      "properties": {
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Label"
        },
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value"
        }
      },
      "title": "SharedFolderReferenceOption",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "options": {
      "items": {
        "$ref": "#/$defs/SharedFolderReferenceOption"
      },
      "title": "Options",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListSharedFolderReferenceOptionsOutput",
  "type": "object"
}

Parameters

upload_folder_id
string
required
The ID of the folder where you want to upload the file.
file_url
string
required
Publicly accessible URL of the file to upload. The integration downloads the content and re-uploads it to OneDrive.
filename
string
required
Name of the new uploaded file (including extension).

Response

{
  "$defs": {
    "UploadFileResult": {
      "additionalProperties": false,
      "description": "Microsoft Graph response for an uploaded DriveItem (subset of fields).",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "webUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Weburl"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        }
      },
      "title": "UploadFileResult",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/$defs/UploadFileResult"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "success"
  ],
  "title": "UploadFileOutput",
  "type": "object"
}

Limits & Quotas

  • Microsoft Graph applies per-app and per-user throttling — bursty workloads may receive 429 responses with Retry-After hints. See https://learn.microsoft.com/en-us/graph/throttling for current limits.
  • download_file saves the file under the backend’s /tmp directory and returns the content base64-encoded. For very large files, prefer routing through the workflow-engine layer.
  • upload_file accepts only a publicly-accessible source URL. Uploading from a local /tmp path is not supported.
  • Dynamic dropdowns for folder, file, drive, and table selection are not exposed — supply IDs and names directly. Use list_my_drives, list_files_in_folder, search_files, or find_file_by_name to discover IDs.
  • Webhook-style notifications (new file / new folder created) are not exposed in this integration; route those needs to the workflow-engine layer.
  • Error model: non-2xx responses, timeouts, and unexpected exceptions are caught and returned as success=False + error rather than raising. Agents should branch on the error string to decide whether to retry or surface to the user.

Dropbox

Amazon Web Services

Azure Storage