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

# List Projects

> List the projects the authenticated user can access, across workspaces.

A user-credential-only discovery op (no ``project_id``). Projects are
flattened across the user's workspaces and tagged with their owning
workspace; the answer is what you pass as ``project_id`` to a project-scoped
request.

Args:
    request (Request): Incoming request (rate-limit plumbing).
    response (Response): Outgoing response (rate-limit plumbing).
    auth (AccountStampedAuth): Account-scope user auth (session token or CLI
        access JWT); carries the resolved ``user_id`` and stamps the per-user
        rate-limit identity.
    workspace_id (str | None): Optional filter; when given, only projects in
        that workspace are returned.

Returns:
    PublicProjectListResponse: The accessible projects (id, name,
        workspace_id, workspace_name).



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/projects
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/projects:
    get:
      tags:
        - Account
      summary: List Projects
      description: >-
        List the projects the authenticated user can access, across workspaces.


        A user-credential-only discovery op (no ``project_id``). Projects are

        flattened across the user's workspaces and tagged with their owning

        workspace; the answer is what you pass as ``project_id`` to a
        project-scoped

        request.


        Args:
            request (Request): Incoming request (rate-limit plumbing).
            response (Response): Outgoing response (rate-limit plumbing).
            auth (AccountStampedAuth): Account-scope user auth (session token or CLI
                access JWT); carries the resolved ``user_id`` and stamps the per-user
                rate-limit identity.
            workspace_id (str | None): Optional filter; when given, only projects in
                that workspace are returned.

        Returns:
            PublicProjectListResponse: The accessible projects (id, name,
                workspace_id, workspace_name).
      operationId: list_projects
      parameters:
        - description: Restrict the result to projects in this workspace.
          in: query
          name: workspace_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Restrict the result to projects in this workspace.
            title: Workspace Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicProjectListResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    PublicProjectListResponse:
      description: >-
        Account-scope discovery: the projects the user can access.


        Returned by ``list_projects`` — a user-credential-only op. Projects are

        flattened across the user's workspaces; an optional ``workspace_id``
        query

        narrows the result to one workspace.
      properties:
        data:
          items:
            $ref: '#/components/schemas/ProjectListItem'
          title: Data
          type: array
      required:
        - data
      title: PublicProjectListResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ProjectListItem:
      description: A project the user can access, tagged with its owning workspace.
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        workspace_id:
          title: Workspace Id
          type: string
        workspace_name:
          title: Workspace Name
          type: string
      required:
        - id
        - name
        - workspace_id
        - workspace_name
      title: ProjectListItem
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

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