# Run agents with OneDrive

OneDrive AI agents on Rush: connect OneDrive once, then name it on any run. Read and edit files.

[Connect OneDrive](https://cloud.getrush.ai/console/settings/?section=connections) in the console under Settings → Connections.

## What an agent can do in OneDrive

Read and edit files.

## Jobs on Rush that use OneDrive

- [Which Supplier Prices Went Up This Month? A Field-Service App's Check of Each HVAC Contractor's OneDrive Price Lists](https://getrush.ai/run/compare-supplier-price-lists/onedrive/)
- [Read Supplier Invoice PDFs From Each Customer's OneDrive Into Draft Bills](https://getrush.ai/run/extract-supplier-invoices/onedrive/)
- [Flag Subcontractors' Expiring Insurance Certificates in Each Contractor's OneDrive](https://getrush.ai/run/flag-expiring-insurance-certificates/onedrive/)
- [Which Clients Still Owe Us Documents? An Accounting Firm's Weekly Check of Client Folders in OneDrive](https://getrush.ai/run/list-missing-client-documents/onedrive/)

## How OneDrive connects

OneDrive is a built-in app: you sign in with your Microsoft account on its own page, through Rush's own app, so you register no OAuth app. The sign-in asks only for the scopes listed below, and the run's token reaches `graph.microsoft.com`, Microsoft Graph files.

Connect it once in the console under Settings → Connections, or from your server with `POST /me/connections`. The sign-in finishes in a browser signed in to the console as the same person, and a link not finished within 10 minutes expires.

After that, a run that names `onedrive` in `connections`, or runs a saved agent that names it, gets it; your connections reach no run that does not name them.

Scopes the sign-in asks for:

- `openid`
- `profile`
- `email`
- `offline_access`
- `https://graph.microsoft.com/User.Read`
- `https://graph.microsoft.com/Files.ReadWrite.All`

```http
POST https://api.phoenix.so/me/connections

{
  "type": "app",
  "name": "onedrive"
}
```

## Whose OneDrive account the agent uses

Your OneDrive connection is personal: it belongs to the person who signed in. A run started in the console uses that person's OneDrive, and a run started with an API key uses the OneDrive of the member who created the key.

To act for your own app's users, make each user an agent from your template and show them, signed in to your app, the sign-in link `POST /o/{org}/agents/{agent}/connections` returns. They sign in to their own OneDrive, and that agent's runs use their account and nothing else: never yours, never another user's.

## More Productivity integrations

- [Gmail](https://getrush.ai/integrations/gmail/)
- [Google Calendar](https://getrush.ai/integrations/google-calendar/)
- [Google Drive](https://getrush.ai/integrations/google-drive/)
- [Outlook](https://getrush.ai/integrations/outlook/)
- [Microsoft Calendar](https://getrush.ai/integrations/microsoft-calendar/)
- [Notion](https://getrush.ai/integrations/notion/)
- [Airtable](https://getrush.ai/integrations/airtable/)

## Frequently asked questions

### How do I connect OneDrive to Rush?

Open Settings → Connections in the console and connect OneDrive, or send `POST /me/connections` with `{"type":"app","name":"onedrive"}` and open the `authorize_url` it returns while signed in to the console. The connection reads `pending` until the sign-in finishes, then `connected`.

### Does every run get my OneDrive account?

No. A run gets your OneDrive connection only when it names it in `connections` (`"connections": ["onedrive"]`), or runs a saved agent that names it. A saved agent names its connections once, and every run of it gets them.

### What can an agent do in OneDrive?

Read and edit files. 4 published jobs use it; this page lists them.

### Can my app's users connect their own OneDrive?

Yes. Make each user an agent from your template, and they sign in to their own OneDrive through the link `POST /o/{org}/agents/{agent}/connections` returns. That agent's runs use their account alone.

## Keep reading

- [AI agents for operations teams: every job and app for them](https://getrush.ai/solutions/operations/)
- [How connections work: sign in once, then every run that names a connection gets it](https://getrush.ai/docs/concepts/connections/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Pricing: one price per member, hours shared by the team](https://getrush.ai/pricing/)
- [How Rush compares with other cloud agents](https://getrush.ai/compare/)
- [Every app and MCP server Rush connects to](https://getrush.ai/integrations/)
