---
title: "Create a five-minute download link for one OneDrive or SharePoint file, for clients with a shell"
method: POST
path: "/v1/capabilities/microsoft-365/drive-download-links"
tags: ["Capability Sources"]
---

# Create a five-minute download link for one OneDrive or SharePoint file, for clients with a shell

`POST /v1/capabilities/microsoft-365/drive-download-links`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/capabilities/microsoft-365/drive-download-links`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

For clients without OpenWork host file transport but with a shell, such as a Workbot computer or a coding agent. Download with curl into a file instead of reading the file into context; format pdf converts Office files. To save edits back, prepare createMicrosoft365DriveUploadSession with itemId and this revision as baseRevision. Uses the selected connection.

## Request body

- object
  - `driveId` string: The file's driveId from a search, folder or link result. Omit for the member's own OneDrive.
  - `itemId` string, required
  - `format` 'pdf': pdf converts a Word, Excel, PowerPoint or other Office file; omit to transfer the stored bytes.

## Response `200`

Short-lived bearer download URL, as JSON and as an MCP resource link, with the file's revision; no file content.

- Microsoft365DriveDownloadLink
  - `ok` true, required
  - `file` object, required
    - `id` string, required
    - `driveId` string, required
    - `parentId` string, required
    - `name` string, required
    - `mimeType` string, required
    - `revision` string, nullable, required: The file's eTag. Pass it back as baseRevision when replacing the file, so newer changes are never overwritten silently.
    - `size` integer, nullable, required
    - `modifiedTime` string, nullable, required
    - `webUrl` string, nullable, required
  - `download` object, required
    - `format` 'pdf', nullable, required
    - `mimeType` string, required
    - `extension` string, nullable, required: Extension the saved file needs, for conversions.
    - `size` integer, nullable, required: Exact bytes for stored files; unknown until downloaded for conversions.
    - `exported` boolean, required
    - `maxBytes` integer, required
  - `downloadUrl` string, uri, required: Secret bearer URL for this one file, valid for five minutes. Do not print, share, log or persist it.
  - `expiresAt` string, date-time, required
  - `resourceLink` object, required: The same download as an MCP resource link.
    - `type` 'resource_link', required
    - `uri` string, uri, required
    - `name` string, required
    - `mimeType` string, required
    - `size` integer
  - `instructions` string, required

## Other responses

- `400`: Invalid request, a folder, or an item without content.
- `401`: Sign in first.
- `403`: Organization policy blocks the selected connection.
- `409`: Connect Microsoft 365 with the needed permission, or the file changed since baseRevision (drive_conflict).
- `413`: The file is larger than the pull size limit.
- `502`: Microsoft refused or did not return the file; the message gives Microsoft's reason.

## Changes

- **2026-10-23** `c93387179b31`: 6 breaking, 8 info
  - the response property `anyOf[subschema #2]/currentRevision` became nullable for the status `409`
  - the response property `anyOf[subschema #2]/modifiedTime` became nullable for the status `409`
  - the response property `download/extension` became nullable for the status `200`
  - the response property `file/modifiedTime` became nullable for the status `200`
  - …10 more
- **2026-10-23** `3e38eb291e52`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/capabilities/microsoft-365/drive-download-links/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/8170cf4a92ca?raw)
