---
title: "Invoke action createUploadSession"
method: POST
path: "/drives/{driveId}/root/microsoft.graph.createUploadSession"
tags: ["drives.driveItem"]
---

# Invoke action createUploadSession

`POST /drives/{driveId}/root/microsoft.graph.createUploadSession`

## Path parameters

- `driveId` string, required

## Request body

- DriveItemIdMicrosoftGraphCreateUploadSessionBody
  - `item` DriveItemUploadableProperties
    - `description` string, nullable — Provides a user-visible description of the item. Read-write. Only on OneDrive Personal.
    - `driveItemSource` DriveItemSource
      - `application` 'teams' | 'yammer' | 'sharePoint' | 'oneDrive' | 'stream' | 'powerPoint' | 'office' | 'loki' | 'loop' | 'other' | 'unknownFutureValue'
      - `externalId` string, nullable — The external identifier for the drive item from the source.
    - `fileSize` number, nullable — Provides an expected file size to perform a quota check before uploading. Only on OneDrive Personal.
    - `fileSystemInfo` FileSystemInfo
      - `createdDateTime` string, date-time, nullable — The UTC date and time the file was created on a client.
      - `lastAccessedDateTime` string, date-time, nullable — The UTC date and time the file was last accessed. Available for the recent file list only.
      - `lastModifiedDateTime` string, date-time, nullable — The UTC date and time the file was last modified on a client.
    - `mediaSource` MediaSource
      - `contentCategory` 'meeting' | 'liveStream' | 'presentation' | 'screenRecording' | 'story' | 'profile' | 'chat' | 'note' | 'comment' | 'unknownFutureValue'
    - `name` string, nullable — The name of the item (filename and extension). Read-write.

## Response `2XX`

Success

- UploadSession
  - `expirationDateTime` string, date-time, nullable — The date and time in UTC that the upload session expires. The complete file must be uploaded before this expiration time is reached. Each fragment uploaded during the session extends the expiration time.
  - `nextExpectedRanges` string[] — A collection of byte ranges that the server is missing for the file. These ranges are zero indexed and of the format 'start-end' (for example '0-26' to indicate the first 27 bytes of the file). When uploading files as Outlook attachments, instead of a collection of ranges, this property always indicates a single value '{start}', the location in the file where the next upload should begin.
  - `uploadUrl` string, nullable — The URL endpoint that accepts PUT requests for byte ranges of the file.

## Other responses

- `default` — error

---

[API](https://skmtc.net/ballerina-platform/apis/files.md) · [All operations](https://skmtc.net/ballerina-platform/apis/files/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ballerina-platform/files/versions/c34150e97737/schema)
