Microsoft Graph OneDrive API

The Microsoft Graph OneDrive API provides programmatic access to OneDrive personal and OneDrive for Business file storage. Developers can upload, download, search, and share files and folders, manage permissions, track changes with delta queries, and create sharing links. The API supports large file uploads with resumable sessions and real-time notifications via webhooks.

OpenAPI Specification

microsoft-onedrive-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft OneDrive API (Microsoft Graph)
  description: >-
    Minimal OpenAPI definition for the OneDrive REST API exposed via Microsoft
    Graph for working with drives and driveItems including OneDrive, OneDrive
    for Business, and SharePoint document libraries.
  version: v1.0
  x-generated-from: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/
  x-generated-by: claude-crawl-2026-05-08
servers:
  - url: https://graph.microsoft.com/v1.0
    description: Microsoft Graph v1.0
security:
  - bearerAuth: []
tags:
  - name: Drives
  - name: DriveItems
  - name: Sharing
paths:
  /me/drive:
    get:
      tags: [Drives]
      summary: Get the user's default OneDrive
      operationId: getMyDrive
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericObject'
  /me/drives:
    get:
      tags: [Drives]
      summary: List drives available to the user
      operationId: listMyDrives
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericList'
  /drives/{driveId}:
    parameters:
      - $ref: '#/components/parameters/DriveId'
    get:
      tags: [Drives]
      summary: Get a specific drive
      operationId: getDrive
      responses:
        '200':
          description: OK
  /drives/{driveId}/root:
    parameters:
      - $ref: '#/components/parameters/DriveId'
    get:
      tags: [DriveItems]
      summary: Get root driveItem of a drive
      operationId: getDriveRoot
      responses:
        '200':
          description: OK
  /drives/{driveId}/root/children:
    parameters:
      - $ref: '#/components/parameters/DriveId'
    get:
      tags: [DriveItems]
      summary: List children of root
      operationId: listDriveRootChildren
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericList'
  /drives/{driveId}/items/{itemId}:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    get:
      tags: [DriveItems]
      summary: Get driveItem by id
      operationId: getDriveItem
      responses:
        '200':
          description: OK
    patch:
      tags: [DriveItems]
      summary: Update driveItem
      operationId: updateDriveItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenericObject'
      responses:
        '200':
          description: OK
    delete:
      tags: [DriveItems]
      summary: Delete driveItem
      operationId: deleteDriveItem
      responses:
        '204':
          description: No Content
  /drives/{driveId}/items/{itemId}/children:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    get:
      tags: [DriveItems]
      summary: List children of driveItem
      operationId: listDriveItemChildren
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericList'
    post:
      tags: [DriveItems]
      summary: Create folder in driveItem
      operationId: createFolder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenericObject'
      responses:
        '201':
          description: Created
  /drives/{driveId}/items/{itemId}/content:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    get:
      tags: [DriveItems]
      summary: Download file content
      operationId: downloadDriveItemContent
      responses:
        '200':
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
    put:
      tags: [DriveItems]
      summary: Upload file content (small file replace)
      operationId: uploadDriveItemContent
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: OK
        '201':
          description: Created
  /drives/{driveId}/items/{itemId}/copy:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    post:
      tags: [DriveItems]
      summary: Copy driveItem
      operationId: copyDriveItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenericObject'
      responses:
        '202':
          description: Accepted
  /drives/{driveId}/items/{itemId}/createLink:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    post:
      tags: [Sharing]
      summary: Create sharing link
      operationId: createSharingLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenericObject'
      responses:
        '200':
          description: OK
  /drives/{driveId}/items/{itemId}/invite:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    post:
      tags: [Sharing]
      summary: Send sharing invitation
      operationId: inviteToDriveItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenericObject'
      responses:
        '200':
          description: OK
  /drives/{driveId}/items/{itemId}/permissions:
    parameters:
      - $ref: '#/components/parameters/DriveId'
      - $ref: '#/components/parameters/ItemId'
    get:
      tags: [Sharing]
      summary: List driveItem permissions
      operationId: listDriveItemPermissions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericList'
  /shares/{shareId}:
    parameters:
      - in: path
        name: shareId
        required: true
        schema: { type: string }
    get:
      tags: [Sharing]
      summary: Access driveItem by share id
      operationId: getSharedItem
      responses:
        '200':
          description: OK
  /sites/{siteId}/drive:
    parameters:
      - in: path
        name: siteId
        required: true
        schema: { type: string }
    get:
      tags: [Drives]
      summary: Get default drive for SharePoint site
      operationId: getSiteDrive
      responses:
        '200':
          description: OK
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    DriveId:
      in: path
      name: driveId
      required: true
      schema: { type: string }
    ItemId:
      in: path
      name: itemId
      required: true
      schema: { type: string }
  schemas:
    GenericObject:
      type: object
      additionalProperties: true
    GenericList:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/GenericObject'
      additionalProperties: true