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

# List Tests

> Retrieve a paginated list of test cases for your project, optionally filtered to a single folder.

<Info>
  **Authentication**: Any authenticated API key
</Info>

Retrieve a paginated list of test cases for your project, optionally filtered
to a single folder. The response is intentionally lean so it can be used for
scanning or building selectors — fetch [Get Test](/api-reference/tests/get-test)
for the full body of a specific test.

<Note>
  When neither `folder_path` nor `folder_id` is supplied, every test in the
  project is returned (including tests in nested folders). Specifying a folder
  returns only the tests **directly** inside that folder — recursion is not
  performed.
</Note>

## Query Parameters

<ParamField query="folder_path" type="string">
  Folder path (e.g. `"regression/smoke"`). `"/"` or omitting the field means root.
  Mutually exclusive with `folder_id` — supplying both returns `400`.
</ParamField>

<ParamField query="folder_id" type="string">
  Pre-resolved folder UUID. Mutually exclusive with `folder_path`.
</ParamField>

<ParamField query="page" type="integer" default="0">
  Page number (0-indexed)
</ParamField>

<ParamField query="page_size" type="integer" default="25">
  Results per page (1-100)
</ParamField>

## Response

<ResponseField name="data" type="TestSummary[]" required>
  Array of test summary objects
</ResponseField>

<ResponseField name="pagination" type="object" required>
  Pagination metadata (`page`, `page_size`, `total_count`, `total_pages`)
</ResponseField>

### TestSummary Object

<ResponseField name="id" type="string" required>
  Unique identifier for the test (UUID)
</ResponseField>

<ResponseField name="name" type="string" required>
  Test name
</ResponseField>

<ResponseField name="type" type="string" required>
  Test kind: `verification`, `discovery`, or `task`
</ResponseField>

<ResponseField name="folder_id" type="string">
  Folder UUID, or `null` if the test is at the project root
</ResponseField>

<ResponseField name="folder_path" type="string" required>
  Resolved folder path string (e.g. `"regression/smoke"`). `"/"` if at root.
</ResponseField>

<RequestExample>
  ```bash cURL (all tests) theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  curl -X GET "https://nunu.ai/api/v1/project/your-project-id/tests?page=0&page_size=25" \
    -H "X-Api-Key: YOUR_API_TOKEN"
  ```

  ```bash cURL (folder filter) theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  curl -X GET "https://nunu.ai/api/v1/project/your-project-id/tests?folder_path=regression/smoke" \
    -H "X-Api-Key: YOUR_API_TOKEN"
  ```

  ```typescript JavaScript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  const response = await fetch(
    "https://nunu.ai/api/v1/project/your-project-id/tests?folder_path=regression/smoke",
    { headers: { "X-Api-Key": process.env.NUNU_API_TOKEN } }
  );
  const data = await response.json();
  ```

  ```python Python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  import requests, os

  response = requests.get(
      "https://nunu.ai/api/v1/project/your-project-id/tests",
      headers={"X-Api-Key": os.environ["NUNU_API_TOKEN"]},
      params={"folder_path": "regression/smoke"},
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  {
    "data": [
      {
        "id": "a5060a07-d386-4269-98ce-b33fb894201e",
        "name": "Sanity smoke",
        "type": "verification",
        "folder_id": "f01a3b1c-9d2e-4f05-8c7a-1a2b3c4d5e6f",
        "folder_path": "regression/smoke"
      },
      {
        "id": "b1234567-89ab-cdef-0123-456789abcdef",
        "name": "Settings menu",
        "type": "verification",
        "folder_id": null,
        "folder_path": "/"
      }
    ],
    "pagination": {
      "page": 0,
      "page_size": 25,
      "total_count": 2,
      "total_pages": 1
    }
  }
  ```

  ```json 400 Bad Request theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  {
    "error": "supply either folder_path or folder_id, not both"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /project/{projectId}/tests
openapi: 3.1.0
info:
  title: nunu.ai API
  description: >-
    The nunu.ai Public API allows you to programmatically interact with your
    projects, manage test runs, and upload builds.
  version: 1.0.0
servers:
  - url: https://nunu.ai/api/v1
security:
  - apiKeyAuth: []
paths:
  /project/{projectId}/tests:
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
        description: >-
          The project ID. You can copy it from the project settings page or the
          project URL in the dashboard.
    get:
      tags:
        - Tests
      summary: List Tests
      description: >-
        Retrieve a paginated list of test cases for your project, optionally
        filtered to a single folder.
      operationId: listTests
      parameters:
        - name: folder_path
          in: query
          description: >-
            Folder path filter (mutually exclusive with folder_id). "/" or
            omitted means root.
          schema:
            type: string
        - name: folder_id
          in: query
          description: Folder UUID filter (mutually exclusive with folder_path)
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          description: Page number (0-indexed)
          schema:
            type: integer
            default: 0
        - name: page_size
          in: query
          description: Results per page (1-100)
          schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTestsResponse'
        '400':
          description: Bad Request - both folder_path and folder_id supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ListTestsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TestSummary'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        details:
          type: object
    TestSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
          enum:
            - verification
            - discovery
            - task
        folder_id:
          type: string
          format: uuid
          nullable: true
        folder_path:
          type: string
          description: Resolved folder path. "/" if at root.
    Pagination:
      type: object
      properties:
        page:
          type: integer
        page_size:
          type: integer
        total_count:
          type: integer
        total_pages:
          type: integer
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key for authentication

````