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

# List workspaces

> Lists all workspaces the authenticated user belongs to. No X-Workspace-Id needed.



## OpenAPI

````yaml /openapi.json get /v1/workspaces
openapi: 3.1.0
info:
  title: CNAP API
  version: 1.0.0
  description: >-
    Public API for managing CNAP workspaces, clusters, templates, products, and
    deployments.


    Authenticate with a Personal Access Token via the `Authorization: Bearer
    cnap_pat_...` header.


    Workspace-scoped endpoints require the `X-Workspace-Id` header.
servers:
  - url: https://api.cnap.tech
    description: Production
security: []
paths:
  /v1/workspaces:
    get:
      tags:
        - Workspaces
      summary: List workspaces
      description: >-
        Lists all workspaces the authenticated user belongs to. No
        X-Workspace-Id needed.
      parameters:
        - schema:
            type: string
            description: Pagination cursor from previous response
          required: false
          description: Pagination cursor from previous response
          name: cursor
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            description: Items per page (1-100)
            example: 50
          required: false
          description: Items per page (1-100)
          name: limit
          in: query
      responses:
        '200':
          description: List of workspaces
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    WorkspaceList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Workspace'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
            message:
              type: string
              example: Resource not found
            param:
              type: string
              description: The request field that caused the error
              example: name
            suggestion:
              type: string
              example: Run `cnap clusters list` to see available clusters
            details: {}
          required:
            - code
            - message
      required:
        - error
    Workspace:
      type: object
      properties:
        id:
          type: string
          example: j572abc123def456
        name:
          type: string
          example: My Workspace
        icon:
          type:
            - string
            - 'null'
          example: null
        created_at:
          type: number
          description: Unix timestamp (seconds)
      required:
        - id
        - name
        - icon
        - created_at
    Pagination:
      type: object
      properties:
        cursor:
          type:
            - string
            - 'null'
          description: Cursor for next page, null if no more
        has_more:
          type: boolean
      required:
        - cursor
        - has_more
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at
        https://cnap.tech/account/tokens

````