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

# List stat views

> Lists active saved stat views the caller owns or can read through sharing. Views store stat selections and employee filters, rather than snapshots of stat values. Results are ordered by case-insensitive name, then view ID. Pagination starts at page 1 with 20 views per page by default and at most 100. Request include.total to add the matching count as pagination.total. Requires access to Analytics in the workspace. Sharing a view shares its saved selections; each viewer can still read only the employee stats their own permissions allow.



## OpenAPI

````yaml https://api.gowindmill.com/api/v2/openapi.json get /c/{companyId}/stats/views
openapi: 3.1.0
info:
  title: Windmill API
  version: 2.0.0
  description: >-
    Use the Windmill API to integrate your systems, automate workflows, and
    build applications on your organization's data. Authenticate with an API key
    or OAuth access token. Each request uses the authenticated user's
    permissions within the selected workspace.
servers:
  - url: https://api.gowindmill.com/api/v2
security:
  - bearerAuth: []
paths:
  /c/{companyId}/stats/views:
    get:
      tags:
        - Stat views
      summary: List stat views
      description: >-
        Lists active saved stat views the caller owns or can read through
        sharing. Views store stat selections and employee filters, rather than
        snapshots of stat values. Results are ordered by case-insensitive name,
        then view ID. Pagination starts at page 1 with 20 views per page by
        default and at most 100. Request include.total to add the matching count
        as pagination.total. Requires access to Analytics in the workspace.
        Sharing a view shares its saved selections; each viewer can still read
        only the employee stats their own permissions allow.
      operationId: stats.views.query
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            description: >-
              Company ID. A URL slug is also accepted. The caller must have
              access to this company.
            title: Company ID
            example: company-acme
          required: true
          description: >-
            Company ID. A URL slug is also accepted. The caller must have access
            to this company.
          name: companyId
          in: path
        - schema:
            type: string
            maxLength: 120
            description: >-
              Case-insensitive text matched against view names. Omit for all
              readable views.
            title: View name search
            example: Engineering
          required: false
          description: >-
            Case-insensitive text matched against view names. Omit for all
            readable views.
          name: search
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 90071992547409
            default: 1
            description: One-based page number. Defaults to 1.
            title: Page number
            example: 1
          required: false
          description: One-based page number. Defaults to 1.
          name: page
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            description: Maximum views per page, from 1 to 100. Defaults to 20.
            title: Page size
            example: 20
          required: false
          description: Maximum views per page, from 1 to 100. Defaults to 20.
          name: pageSize
          in: query
        - schema:
            type: object
            properties:
              total:
                type: boolean
                description: >-
                  Set true to include the total number of readable views
                  matching search, independent of pagination, in
                  pagination.total.
                title: Include total count
                example: true
            description: Additional listing details to calculate. Omit to skip the count.
            title: Additional response details
            example:
              total: true
          required: false
          description: Additional listing details to calculate. Omit to skip the count.
          name: include
          in: query
      responses:
        '200':
          description: Accessible stat views in deterministic name order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryStatViewsResponse'
        '400':
          description: Bad request or request validation failed
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - BAD_REQUEST
                          message:
                            type: string
                          requestId:
                            type: string
                        required:
                          - code
                          - message
                          - requestId
                    required:
                      - error
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - VALIDATION_ERROR
                          message:
                            type: string
                          requestId:
                            type: string
                          details:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                message:
                                  type: string
                              required:
                                - path
                                - message
                        required:
                          - code
                          - message
                          - requestId
                          - details
                    required:
                      - error
        '401':
          description: >-
            Authentication is missing or invalid. Send a valid API key or OAuth
            access token in the Authorization: Bearer <TOKEN> header before
            retrying.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - UNAUTHORIZED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - FORBIDDEN
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - NOT_FOUND
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '429':
          description: >-
            The API-client request budget is exhausted. API keys allow 500
            requests per minute per key; OAuth clients allow 500 per minute per
            client and workspace. Reads and writes share the budget. One HTTP
            request counts once, including bulk requests. Wait for the
            Retry-After delay before retrying.
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying the request.
              required: true
              schema:
                type: integer
                minimum: 0
                example: 42
            RateLimit:
              description: >-
                Current request budget: limit is the maximum count, remaining is
                the unused count, and reset is seconds until the window resets,
                not a timestamp.
              required: true
              schema:
                type: string
                example: limit=500, remaining=0, reset=42
            RateLimit-Policy:
              description: >-
                Request limit and window length in seconds, formatted as
                <limit>;w=<seconds>.
              required: true
              schema:
                type: string
                example: 500;w=60
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - RATE_LIMITED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
      security:
        - bearerAuth: []
components:
  schemas:
    QueryStatViewsResponse:
      type: object
      properties:
        views:
          type: array
          items:
            $ref: '#/components/schemas/StatViewSummary'
          description: >-
            Readable active views ordered by case-insensitive name, then view
            ID.
          title: Stat views
        pagination:
          $ref: '#/components/schemas/SearchPaginationResponse'
      required:
        - views
        - pagination
      title: Stat views listing response
    StatViewSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Saved stat view UUID.
          title: Stat view ID
          example: 22222222-2222-4222-8222-222222222222
        name:
          type: string
          description: Display name of the saved view.
          title: View name
          example: Engineering activity
        createdAt:
          type: string
          description: Creation time as an ISO 8601 timestamp.
          title: Created at
          example: '2026-01-01T10:00:00.000Z'
        updatedAt:
          type: string
          description: Last change time as an ISO 8601 timestamp.
          title: Updated at
          example: '2026-01-01T10:00:00.000Z'
        version:
          type: integer
          exclusiveMinimum: 0
          description: >-
            Current version. Send this as expectedVersion when updating or
            changing sharing.
          title: Version
          example: 1
        creator:
          $ref: '#/components/schemas/StatViewCreator'
        sharingAccess:
          $ref: '#/components/schemas/StatViewSharingAccess'
        isOwner:
          type: boolean
          description: Whether the authenticated workspace member created this view.
          title: Is owner
          example: true
        canWrite:
          type: boolean
          description: >-
            Whether the caller can modify, share, or archive the view. Only its
            owner can.
          title: Can edit
          example: true
      required:
        - id
        - name
        - createdAt
        - updatedAt
        - version
        - creator
        - sharingAccess
        - isOwner
        - canWrite
      title: Stat view summary
      description: >-
        Saved view identity, creator, version, sharing, and caller-specific
        permissions.
    SearchPaginationResponse:
      type: object
      properties:
        page:
          type: integer
          minimum: 1
          default: 1
          description: One-based page number. Defaults to 1.
          title: Page number
          example: 1
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
          description: Maximum results per page, from 1 to 100. Defaults to 20.
          title: Page size
          example: 20
        hasMore:
          type: boolean
          description: Whether there are more matching results after this page.
          title: Has another page
          example: false
        total:
          type: integer
          minimum: 0
          description: >-
            Total matching items, independent of pagination. The route
            determines the item type.
          title: Total matches
          example: 1
      required:
        - page
        - pageSize
        - hasMore
      description: >-
        Returned page and page size, plus hasMore. Total is omitted unless
        include.total was requested.
      title: Pagination
    StatViewCreator:
      type: object
      properties:
        id:
          type: string
          description: Employee ID of the view's creator.
          title: Creator employee ID
          example: employee-morgan
        firstName:
          type:
            - string
            - 'null'
          description: Creator's first name, or null when unavailable.
          title: First name
          example: Morgan
        lastName:
          type:
            - string
            - 'null'
          description: Creator's last name, or null when unavailable.
          title: Last name
          example: Lee
        avatarUrl:
          type:
            - string
            - 'null'
          description: Creator's avatar URL, or null when unset.
          title: Avatar URL
          example: null
        archivedAt:
          type:
            - string
            - 'null'
          description: >-
            Creator employee's archive time as an ISO 8601 timestamp, or null
            when active.
          title: Archived at
          example: null
      required:
        - id
        - firstName
        - lastName
        - avatarUrl
        - archivedAt
      title: Creator
      description: Employee profile of the view's creator.
    StatViewSharingAccess:
      type: object
      properties:
        companyAccess:
          type: string
          enum:
            - none
            - read
            - write
          description: Workspace-wide sharing level.
          title: Workspace access
          example: read
        employeeAccess:
          type: array
          items:
            type: object
            properties:
              employeeId:
                type: string
                minLength: 1
                description: >-
                  Employee ID in this workspace. For a subtree grant, identifies
                  its root employee.
                title: Employee ID
                example: employee-avery
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: >-
                  Sharing level: none, read, or write. Only the owner can write
                  a stat view.
                title: Access level
                example: read
            required:
              - employeeId
              - access
          description: Direct employee sharing grants, including the owner's access.
          title: Employee access
        groupAccess:
          type: array
          items:
            type: object
            properties:
              groupId:
                type: string
                minLength: 1
                description: >-
                  ID of an employee group in this workspace that the caller can
                  read.
                title: Group ID
                example: group-engineering
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: >-
                  Sharing level: none, read, or write. Only the owner can write
                  a stat view.
                title: Access level
                example: read
            required:
              - groupId
              - access
          description: Sharing grants for members of employee groups.
          title: Group access
        automationAccess:
          type: array
          items:
            type: object
            properties:
              companyAutomationId:
                type: string
                minLength: 1
                description: >-
                  Workspace automation ID. Automation sharing is not supported
                  for stat views.
                title: Automation ID
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: >-
                  Sharing level: none, read, or write. Only the owner can write
                  a stat view.
                title: Access level
                example: read
            required:
              - companyAutomationId
              - access
          description: >-
            Automation grants. New stat view sharing requests do not support
            this audience.
          title: Automation access
          example: []
        subtreeAccess:
          type: array
          items:
            type: object
            properties:
              employeeId:
                type: string
                minLength: 1
                description: >-
                  Employee ID in this workspace. For a subtree grant, identifies
                  its root employee.
                title: Employee ID
                example: employee-avery
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: >-
                  Sharing level: none, read, or write. Only the owner can write
                  a stat view.
                title: Access level
                example: read
            required:
              - employeeId
              - access
          description: Reporting-team grants rooted at the named employee.
          title: Reporting team access
        allManagersAccess:
          type: string
          enum:
            - none
            - read
            - write
          description: Sharing level for all managers.
          title: All managers access
          example: read
        capabilitiesAccess:
          type: array
          items:
            type: object
            properties:
              capability:
                type: string
                minLength: 1
                description: >-
                  Capability name. Capability-based sharing is not supported for
                  stat views.
                title: Capability
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: >-
                  Sharing level: none, read, or write. Only the owner can write
                  a stat view.
                title: Access level
                example: read
            required:
              - capability
              - access
          description: >-
            Capability grants. New stat view sharing requests do not support
            this audience.
          title: Capability access
          example: []
      required:
        - companyAccess
        - employeeAccess
        - groupAccess
        - automationAccess
        - subtreeAccess
        - allManagersAccess
        - capabilitiesAccess
      title: Stat view sharing access
      description: >-
        Structured sharing grants for the saved configuration. Sharing a view
        does not grant access to the employees' stat data.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an API key or OAuth access token. Enter only the token in the
        authorization dialog; requests send it as `Authorization: Bearer
        <TOKEN>`.


        Create an API key in your workspace's **Settings → API keys**. Keys
        start with `wm_api_` and only work in the workspace where they were
        created. Read-only keys can read data; creating, updating, or deleting
        data requires a read-write key.


        ```http

        Authorization: Bearer wm_api_example

        ```


        OAuth access tokens are issued for connected Windmill applications.


        ```http

        Authorization: Bearer <OAUTH_ACCESS_TOKEN>

        ```


        Both token types use the authenticated user's workspace permissions.
        Each endpoint's permission requirements and the sharing settings of the
        requested items still apply.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.