Thumbnail for ChatGPT with Microsoft OneDrive

ChatGPT with Microsoft OneDrive

Learn how to build a custom GPT in ChatGPT that lists the items in your OneDrive root using Caddey — no coding required.

July 15, 2025


In this tutorial, you'll connect Microsoft OneDrive to ChatGPT using Caddey so your GPT can list the items in your OneDrive root — all from a ChatGPT conversation, no code required.

Prerequisites

  • ChatGPT Plus/Pro subscription: Access to custom GPT creation features in ChatGPT.
  • Caddey account: A Caddey account to create an OAuth client and connect OneDrive.
  • Microsoft account with OneDrive access: A personal or work Microsoft account that you use with OneDrive.

Step 1: Create a Caddey OAuth Client

  1. Log in to Caddey: Sign in to your Caddey account and navigate to the Clients section.
  2. Add a new client: Click Add Client, name it (e.g., "OneDrive Assistant"), choose Confidential as the client type, and optionally add a description like "Manages my OneDrive via ChatGPT."
  3. Leave redirect URI empty for now: We'll get the exact callback URL from ChatGPT in the next steps.
  4. Save the client: Click Save. Caddey will generate a Client ID and Client Secret for your OAuth client—copy both now as you'll need them for authentication.

The OAuth client represents your ChatGPT assistant's identity in Caddey. It allows ChatGPT to securely authenticate and call OneDrive actions through Caddey using OAuth 2.0.

Step 2: Connect Microsoft OneDrive in Caddey

  1. Open the Apps section: In Caddey's dashboard, go to AppsMarketplace.
  2. Find OneDrive: Search for Microsoft OneDrive and click Connect.
  3. Configure key: A prompt will appear to choose a key. Choose the published OAuth key.
  4. Confirm connection: Once connected, OneDrive will appear under Apps.

Step 3: Create a OneDrive Toolbox

  1. Go to Toolboxes: In Caddey, select Toolboxes.

  2. Create a new toolbox: Click Create Toolbox. Name it "OneDrive: List root items".

  3. Add OneDrive tool: Add only this action:

    • List OneDrive root folder items

    This is the only tool needed for this tutorial.

Step 4: Assign the Toolbox to Your Client

  1. Open your client: Return to Clients, and select your "OneDrive Assistant" client.
  2. Add the toolbox: In the client's Toolboxes tab, click Add Toolbox and choose OneDrive: List root items.

Step 5: Create a Custom GPT in ChatGPT

  1. Open ChatGPT: Log into your ChatGPT Plus/Pro account and click Explore GPTs or Create GPT.
  2. Name your GPT: Enter a title, for example, "File Assistant".
  3. Add a description: "Lists the items in my OneDrive root via Caddey".

Step 6: Connect the GPT to Caddey

  1. Add an action: In the GPT builder, click Add Action to configure an external API call.
  2. Configure authentication:
    • Method: OAuth
    • Authorization URL: https://auth.caddey.ai/realms/caddey/protocol/openid-connect/auth
    • Token URL: https://auth.caddey.ai/realms/caddey/protocol/openid-connect/token
    • Client ID: Your Caddey OAuth Client ID
    • Client Secret: Your Caddey OAuth Client Secret
    • Scope: openid profile email offline_access
  3. Import OpenAPI schema: Choose Import OpenAPI from a URL and enter: https://api.caddey.ai/v3/api-docs/tools
  4. Verify endpoints: Ensure ChatGPT sees:
    • GET /tools/query (lists available tools)
    • POST /tools/{toolId}/execute (executes a tool)
  5. Save the action to generate the callback URL.
  6. Find the Callback URL: Navigate back to your GPT's main Configure screen (not the action configuration). You should now see a "Callback URL" displayed on this screen. Copy this exact URL.
  7. Update your Caddey OAuth Client: Go back to your Caddey dashboard, edit the OAuth client you created in Step 1, and add the callback URL you just copied to the Redirect URIs field. Save the client.

Important: The callback URL only appears on your GPT's main Configure screen after you've saved the action with OAuth configuration. If you don't see it immediately, make sure you've saved the action and are looking at your GPT's main Configure screen, not the individual action settings.

Step 7: Test with a Simple Example (List root items)

Switch to preview or start a chat with your new GPT, then try:

  1. List root: "List the items in my OneDrive root."

You can expand functionality anytime by adding more OneDrive actions or connecting other apps in Caddey—just update your toolbox and reassign it to the client.

Finalize and Deploy Your GPT

Once testing succeeds, click Save or Done in the GPT builder. Your File Assistant will now appear in your ChatGPT interface—ready to list the items in your OneDrive root.

Troubleshooting

  • 403 or access denied: Ensure the Microsoft account you used to connect OneDrive has access and that you granted permissions during sign-in.
  • No items listed: Confirm there are files/folders in the root or browse a subfolder by providing its path.