Microsoft Excel Worksheets API

Operations for managing worksheets within a workbook.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

microsoft-excel-worksheets-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Microsoft Graph Excel Charts Worksheets API
  description: REST API for accessing and manipulating Excel workbooks stored in OneDrive for Business, SharePoint sites, or Group drives through Microsoft Graph.
  version: 1.0.0
  contact:
    name: Microsoft Graph Support
    url: https://developer.microsoft.com/graph/support
  license:
    name: Microsoft API Terms of Use
    url: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
  x-generated-from: documentation
  x-last-validated: '2026-04-18'
servers:
- url: https://graph.microsoft.com/v1.0
  description: Microsoft Graph v1.0 production endpoint
security:
- oauth2:
  - Files.Read
  - Files.ReadWrite
tags:
- name: Worksheets
  description: Operations for managing worksheets within a workbook.
paths:
  /me/drive/items/{item-id}/workbook/worksheets:
    get:
      operationId: listWorksheets
      summary: Microsoft Excel List Worksheets
      description: Retrieve a list of worksheets in the workbook.
      tags:
      - Worksheets
      parameters:
      - name: item-id
        in: path
        required: true
        description: The ID of the workbook file.
        schema:
          type: string
      - name: workbook-session-id
        in: header
        required: false
        description: Workbook session ID for performance.
        schema:
          type: string
      responses:
        '200':
          description: Worksheets returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorksheetCollection'
              examples:
                ListWorksheets200Example:
                  summary: Default listWorksheets 200 response
                  x-microcks-default: true
                  value:
                    value:
                    - id: '{00000000-0001-0000-0000-000000000000}'
                      name: Sheet1
                      position: 0
                      visibility: Visible
        '401':
          description: Unauthorized.
        '404':
          description: Workbook not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createWorksheet
      summary: Microsoft Excel Create Worksheet
      description: Add a new worksheet to the workbook.
      tags:
      - Worksheets
      parameters:
      - name: item-id
        in: path
        required: true
        description: The ID of the workbook file.
        schema:
          type: string
      - name: workbook-session-id
        in: header
        required: false
        description: Workbook session ID.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the new worksheet.
            examples:
              CreateWorksheetRequestExample:
                summary: Default createWorksheet request
                x-microcks-default: true
                value:
                  name: NewSheet
      responses:
        '201':
          description: Worksheet created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Worksheet'
              examples:
                CreateWorksheet201Example:
                  summary: Default createWorksheet 201 response
                  x-microcks-default: true
                  value:
                    id: '{75A18F35-34AA-4F44-97CC-FDC3C05D9F40}'
                    name: NewSheet
                    position: 5
                    visibility: Visible
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /me/drive/items/{item-id}/workbook/worksheets/{worksheet-id-or-name}:
    get:
      operationId: getWorksheet
      summary: Microsoft Excel Get Worksheet
      description: Retrieve a specific worksheet by ID or name.
      tags:
      - Worksheets
      parameters:
      - name: item-id
        in: path
        required: true
        description: The ID of the workbook file.
        schema:
          type: string
      - name: worksheet-id-or-name
        in: path
        required: true
        description: Worksheet ID or name.
        schema:
          type: string
      - name: workbook-session-id
        in: header
        required: false
        description: Workbook session ID.
        schema:
          type: string
      responses:
        '200':
          description: Worksheet returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Worksheet'
              examples:
                GetWorksheet200Example:
                  summary: Default getWorksheet 200 response
                  x-microcks-default: true
                  value:
                    id: '{00000000-0001-0000-0000-000000000000}'
                    name: Sheet1
                    position: 0
                    visibility: Visible
        '401':
          description: Unauthorized.
        '404':
          description: Worksheet not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      operationId: updateWorksheet
      summary: Microsoft Excel Update Worksheet
      description: Update worksheet properties such as name or position.
      tags:
      - Worksheets
      parameters:
      - name: item-id
        in: path
        required: true
        description: The ID of the workbook file.
        schema:
          type: string
      - name: worksheet-id-or-name
        in: path
        required: true
        description: Worksheet ID or name.
        schema:
          type: string
      - name: workbook-session-id
        in: header
        required: false
        description: Workbook session ID.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Worksheet'
            examples:
              UpdateWorksheetRequestExample:
                summary: Default updateWorksheet request
                x-microcks-default: true
                value:
                  name: RenamedSheet
                  position: 3
      responses:
        '200':
          description: Worksheet updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Worksheet'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '404':
          description: Worksheet not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteWorksheet
      summary: Microsoft Excel Delete Worksheet
      description: Delete a worksheet from the workbook.
      tags:
      - Worksheets
      parameters:
      - name: item-id
        in: path
        required: true
        description: The ID of the workbook file.
        schema:
          type: string
      - name: worksheet-id-or-name
        in: path
        required: true
        description: Worksheet ID or name.
        schema:
          type: string
      - name: workbook-session-id
        in: header
        required: false
        description: Workbook session ID.
        schema:
          type: string
      responses:
        '204':
          description: Worksheet deleted successfully.
        '401':
          description: Unauthorized.
        '404':
          description: Worksheet not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Worksheet:
      type: object
      description: Represents an Excel worksheet.
      properties:
        id:
          type: string
          description: Unique identifier for the worksheet.
          example: '{00000000-0001-0000-0000-000000000000}'
        name:
          type: string
          description: The display name of the worksheet.
          example: Sheet1
        position:
          type: integer
          description: The zero-based position of the worksheet.
          example: 0
        visibility:
          type: string
          description: Worksheet visibility.
          enum:
          - Visible
          - Hidden
          - VeryHidden
          example: Visible
    WorksheetCollection:
      type: object
      description: Collection of worksheets.
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/Worksheet'
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authorization using Microsoft Identity Platform
      flows:
        authorizationCode:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
          scopes:
            Files.Read: Read user files
            Files.ReadWrite: Read and write user files