> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deasylabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Onedrive Sites

> List all OneDrive sites in the tenant (same Graph API as SharePoint).



## OpenAPI

````yaml /deasy-openapi-stainless.yml post /onedrive/list_sites
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: /rest/unstructured
security: []
paths:
  /onedrive/list_sites:
    post:
      tags:
        - Data Connectors
      summary: List Onedrive Sites
      description: List all OneDrive sites in the tenant (same Graph API as SharePoint).
      operationId: list_onedrive_sites_onedrive_list_sites_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListOnedriveSitesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOnedriveSitesResponse'
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      security:
        - BasicAuth: []
        - BearerAuth: []
          UserIdAuth: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from unstructured import UnstructuredClient

            client = UnstructuredClient(
                username=os.environ.get("UNSTRUCTURED_USERNAME"),  # This is the default and can be omitted
                password=os.environ.get("UNSTRUCTURED_PASSWORD"),  # This is the default and can be omitted
            )
            response = client.data_source.list_onedrive_sites(
                client_id="client_id",
                client_secret="client_secret",
                tenant_id="tenant_id",
            )
            print(response.sites)
        - lang: JavaScript
          source: |-
            import UnstructuredClient from 'unstructured-sdk';

            const client = new UnstructuredClient({
              authMethod: 'My Auth Method',
              username: process.env['UNSTRUCTURED_USERNAME'], // This is the default and can be omitted
              password: process.env['UNSTRUCTURED_PASSWORD'], // This is the default and can be omitted
            });

            const response = await client.dataSource.listOnedriveSites({
              client_id: 'client_id',
              client_secret: 'client_secret',
              tenant_id: 'tenant_id',
            });

            console.log(response.sites);
components:
  schemas:
    ListOnedriveSitesRequest:
      properties:
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          title: Client Secret
        tenant_id:
          type: string
          title: Tenant Id
      type: object
      required:
        - client_id
        - client_secret
        - tenant_id
      title: ListOnedriveSitesRequest
      description: Request model for listing OneDrive sites.
    ListOnedriveSitesResponse:
      properties:
        sites:
          items:
            $ref: '#/components/schemas/OnedriveSiteInfo'
          type: array
          title: Sites
      type: object
      required:
        - sites
      title: ListOnedriveSitesResponse
      description: Response model for listing OneDrive sites.
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OnedriveSiteInfo:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
      type: object
      required:
        - id
        - name
        - url
      title: OnedriveSiteInfo
      description: Information about a single OneDrive site.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````