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

# List workbooks

> List the workbooks linked to an account.

This endpoint returns a paginated list of workbooks.



## OpenAPI

````yaml get /v1/workbooks
openapi: 3.1.0
info:
  title: GRID API
  summary: Spreadsheets run the world. Now you can run spreadsheets.
  description: >-
    GRID's API transforms spreadsheets into powerful, programmable APIs. Our
    platform supports seamless integration of spreadsheet data into your
    applications, supporting dynamic interactions with spreadsheets, including
    real-time data querying with ephemeral updates.
  version: 1.0.0
servers:
  - url: https://api.grid.is
security: []
tags:
  - name: workbooks
    description: Interact with workbooks and their data
paths:
  /v1/workbooks:
    get:
      tags:
        - workbooks
      summary: List workbooks
      description: |-
        List the workbooks linked to an account.

        This endpoint returns a paginated list of workbooks.
      operationId: list_workbooks
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: Number of items to return per page
            lte: 100
            default: 25
            title: Limit
          description: Number of items to return per page
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            description: >-
              Cursor for the next page of items. If not provided, the first
              batch of items will be returned.
            title: Cursor
          description: >-
            Cursor for the next page of items. If not provided, the first batch
            of items will be returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkbookListResponse'
        '400':
          description: Error returned when you make a bad request
          content:
            application/json:
              example:
                error_code: invalid_json
                error_message: Bad request
                error_details: RequestJsonParsingFailed
        '403':
          description: Error returned when you don't have permission to query a workbook
          content:
            application/json:
              example:
                error_message: Forbidden
                error_details: Only API keys can access the workbook engine API
        '429':
          description: Error returned when you exceed your API rate limit
          content:
            application/json:
              example:
                error_code: rate_limit_exceeded
                error_message: Rate limit exceeded
                error_details: 'Retry after: 60'
      security:
        - apiKey: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Grid from '@grid-is/api';

            const client = new Grid({
              apiKey: 'My API Key',
            });

            // Automatically fetches more pages as needed.
            for await (const workbookListResponse of client.workbooks.list()) {
              console.log(workbookListResponse.id);
            }
        - lang: Python
          source: |-
            from grid_api import Grid

            client = Grid(
                api_key="My API Key",
            )
            page = client.workbooks.list()
            page = page.items[0]
            print(page.id)
        - lang: Java
          source: |-
            package is.grid.api.example;

            import is.grid.api.client.GridClient;
            import is.grid.api.client.okhttp.GridOkHttpClient;
            import is.grid.api.models.workbooks.WorkbookListPage;
            import is.grid.api.models.workbooks.WorkbookListParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    GridClient client = GridOkHttpClient.fromEnv();

                    WorkbookListPage page = client.workbooks().list();
                }
            }
components:
  schemas:
    WorkbookListResponse:
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        items:
          items:
            $ref: '#/components/schemas/WorkbookItem'
          type: array
          title: Items
      type: object
      required:
        - pagination
        - items
      title: WorkbookListResponse
    Pagination:
      properties:
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            The cursor to pass on as query parameter for the next batch of
            items, if any
      type: object
      title: Pagination
    WorkbookItem:
      properties:
        id:
          type: string
          title: Id
          description: A workbook's unique identifier
        filename:
          type: string
          title: Filename
          description: The original filename of the uploaded workbook
        state:
          $ref: '#/components/schemas/WorkbookState'
          description: The current state of the most recent version of the workbook
        defect:
          $ref: '#/components/schemas/WorkbookDefect'
          description: >-
            The defect that was found in the most recent version of the
            workbook, if any
        version:
          type: integer
          title: Version
          description: The most recent version of the workbook
        latest_ready_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Latest Ready Version
          description: The latest version of the workbook that has a 'ready' state
        created:
          type: string
          format: date-time
          title: Created
          description: The date/time the workbook was created
        modified:
          type: string
          format: date-time
          title: Modified
          description: The date/time the workbook was last modified
      type: object
      required:
        - id
        - filename
        - state
        - defect
        - version
        - created
        - modified
      title: WorkbookItem
    WorkbookState:
      type: string
      enum:
        - processing
        - ready
        - error
      title: WorkbookState
      description: >-
        The state of a workbook. If the state is `processing`, the workbook is
        not yet ready to query.

        If the state is `error`, the workbook has encountered an error during
        processing. An explanation

        of the error can be found in the `defect` field.
    WorkbookDefect:
      type: string
      enum:
        - ''
        - too_big
        - converted_workbook_too_big
        - unrecognized_format
        - cannot_fetch_from_remote
        - processing_timeout
        - conversion_error
      title: WorkbookDefect
      description: Problems that may be found when processing a workbook.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````