---
title: "Find the OneDrive, SharePoint or Teams file behind a link"
method: GET
path: "/v1/capabilities/microsoft-365/drive-item-by-link"
tags: ["Capability Sources"]
---

# Find the OneDrive, SharePoint or Teams file behind a link

`GET /v1/capabilities/microsoft-365/drive-item-by-link`

## Request

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

Turns a OneDrive, SharePoint or Teams file link the member can open into the item's driveId and id, for reading, pulling or saving it. Read-only; files outside the member's own OneDrive need the all-files permission.

## Query parameters

- `url` string, starts_with, required

## Response `200`

The linked item.

- Microsoft365DriveItemResponse
  - `ok` true, required
  - `file` Microsoft365DriveItem, required
    - `id` string, required
    - `driveId` string, required: Pass with id to read, list or save this item. Empty when Microsoft did not say; resolve webUrl with the link capability then.
    - `parentId` string, required
    - `siteId` string, required: SharePoint site holding the item, when Microsoft reports one.
    - `name` string, required
    - `size` number, nullable, required
    - `modifiedTime` string, required
    - `webUrl` string, required
    - `mimeType` string, required
    - `kind` 'file' | 'folder' | 'unknown', required
    - `eTag` 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).
- `502`: Microsoft refused or did not return the file; the message gives Microsoft's reason.

## Changes

- **2026-10-23** `c93387179b31`: 4 breaking, 4 info
  - for the `query` request parameter `url`, the format changed from `uri` to `starts_with`
  - 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 `file/size` became nullable for the status `200`
  - …4 more
- **2026-10-23** `3e38eb291e52`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/capabilities/microsoft-365/drive-item-by-link/get.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)
