# List Projects (Paginated)

`GET /v1/projects/list`

List projects for the current user with cursor-based pagination.

Each item says whether it is the organization's default workspace, its
icon, and the caller's role there
(``my_role``, null when the roles could not be read). A key restricted
to workspaces lists only the workspaces on its allowlist, and its page
says nothing of how many others exist.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `search` (query, string | null): Search project name

  ```yaml
  maxLength: 200
  type:
    - string
    - "null"
  ```
- `limit` (query, integer)

  ```yaml
  type: integer
  maximum: 1000
  minimum: 1
  default: 20
  ```
- `cursor` (query, string | null): Pagination cursor
- `sort` (query, string): One of: `newest`, `oldest`, `updated`, `name`.

  ```yaml
  type: string
  default: newest
  ```

## Responses

- `200` Paginated list of projects: `application/json` `PaginatedProjectsResponse`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `422` Invalid pagination parameters

## Schemas

```yaml
PaginatedProjectsResponse:
  properties:
    items:
      items:
        $ref: "#/components/schemas/ProjectItem"
      type: array
    page_info:
      $ref: "#/components/schemas/PageInfo"
  type: object
  required:
    - page_info
  title: PaginatedProjectsResponse
ProjectItem:
  properties:
    project_id:
      type: string
      format: uuid
    name:
      type: string
    description:
      type:
        - string
        - "null"
    created_at:
      type: string
      format: date-time
    updated_at:
      type: string
      format: date-time
    is_default:
      type: boolean
      description: The organization's default workspace; it cannot be deleted
      default: false
    icon:
      description: Its icon, a name from the dashboard's set; null for none
      type:
        - string
        - "null"
    my_role:
      description: The caller's role there (for an API key, its creator's; the key's scopes cap what it may do with it); null when it could not be read
      nullable: true
      type: string
      enum:
        - viewer
        - contributor
        - admin
        - owner
  type: object
  required:
    - project_id
    - name
    - created_at
    - updated_at
  title: ProjectItem
  description: A workspace (a project), as the dashboard's workspace pages show it.
PageInfo:
  properties:
    has_next:
      type: boolean
      description: Whether more items exist after this page
    end_cursor:
      description: Cursor for the next page
      type:
        - string
        - "null"
    total_count:
      description: Total matching items
      type:
        - integer
        - "null"
  type: object
  required:
    - has_next
  title: PageInfo
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
```
