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

# List workspaces

> Page through the workspaces your API key can access.



## OpenAPI

````yaml api-reference/accounts/openapi.json GET /v1/workspaces
openapi: 3.0.3
info:
  title: Persistence Accounts and Workspaces API
  version: '1.0'
  description: Manage Persistence workspaces and their API keys.
servers:
  - url: https://api.persistence.dev
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Accounts and workspaces
    description: Workspace management and API key creation.
paths:
  /v1/workspaces:
    get:
      tags:
        - Accounts and workspaces
      summary: List workspaces
      description: >-
        List the workspaces the API key can access. Results are paginated and
        can be sorted and filtered by search text.
      operationId: listWorkspaces
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
          description: Page number
        - name: perPage
          in: query
          required: false
          schema:
            type: integer
          description: Items per page
        - name: column
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
          description: Sort column
        - name: order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
          description: Sort order
        - name: searchText
          in: query
          required: false
          schema:
            type: string
          description: Search text
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WorkspaceListResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PagedWorkspaces'
        success:
          type: boolean
    Error:
      type: object
      properties:
        code:
          type: string
        error:
          type: string
    PagedWorkspaces:
      type: object
      properties:
        column:
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/Workspace'
        order:
          $ref: '#/components/schemas/SortOrder'
        page:
          type: integer
        perPage:
          type: integer
        searchText:
          type: string
        totalCount:
          type: integer
    Workspace:
      type: object
      properties:
        id:
          type: string
        meta:
          type: object
          additionalProperties: {}
        name:
          type: string
        path:
          type: string
        scope:
          type: string
    SortOrder:
      type: string
      enum:
        - ASC
        - DESC
      x-enum-varnames:
        - SortOrderAsc
        - SortOrderDesc
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key issued for your workspace.

````