> ## 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 Test Plans

> Retrieve a paginated list of test plans for your project.

<Info>
  **Permission Required**: `project:read-runs`
</Info>

Retrieve a paginated list of test plans for your project.

## Query Parameters

<ParamField query="search" type="string">
  Search by test plan name
</ParamField>

<ParamField query="sort_by" type="string" default="name">
  Field to sort by: `name`, `test_count`, `modified_at`, or `created_at`
</ParamField>

<ParamField query="sort_order" type="string" default="asc">
  Sort direction: `asc` or `desc`
</ParamField>

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

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

## Response

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

<ResponseField name="pagination" type="object" required>
  Pagination information

  <Expandable title="pagination properties">
    <ResponseField name="pagination.page" type="integer">
      Current page number
    </ResponseField>

    <ResponseField name="pagination.page_size" type="integer">
      Results per page
    </ResponseField>

    <ResponseField name="pagination.total_count" type="integer">
      Total number of test plans
    </ResponseField>

    <ResponseField name="pagination.total_pages" type="integer">
      Total number of pages
    </ResponseField>
  </Expandable>
</ResponseField>

### TestPlanSummary Object

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

<ResponseField name="project_id" type="string" required>
  Project the test plan belongs to
</ResponseField>

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

<ResponseField name="test_count" type="integer" required>
  Number of tests in the plan
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when the test plan was created
</ResponseField>

<ResponseField name="created_by" type="string">
  Who created the test plan
</ResponseField>

<ResponseField name="modified_at" type="string">
  ISO 8601 timestamp when the test plan was last modified
</ResponseField>

<ResponseField name="modified_by" type="string">
  Who last modified the test plan
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  curl -X GET "https://nunu.ai/api/v1/project/your-project-id/test-plans?search=smoke&sort_by=name&page=0&page_size=10" \
    -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/test-plans?search=smoke&sort_by=name&page=0&page_size=10",
    {
      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
  import os

  response = requests.get(
      "https://nunu.ai/api/v1/project/your-project-id/test-plans",
      headers={"X-Api-Key": os.environ["NUNU_API_TOKEN"]},
      params={"search": "smoke", "sort_by": "name", "page": 0, "page_size": 10}
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  {
    "data": [
      {
        "id": "b3f1a2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
        "project_id": "test",
        "name": "Smoke Tests",
        "test_count": 5,
        "created_at": "2026-03-01T10:00:00.000000+00:00",
        "created_by": "user@example.com",
        "modified_at": "2026-03-15T14:30:00.000000+00:00",
        "modified_by": "user@example.com"
      },
      {
        "id": "c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f",
        "project_id": "test",
        "name": "Smoke Tests - Mobile",
        "test_count": 3,
        "created_at": "2026-03-05T12:00:00.000000+00:00",
        "created_by": "user@example.com",
        "modified_at": "2026-03-10T09:15:00.000000+00:00",
        "modified_by": "user@example.com"
      }
    ],
    "pagination": {
      "page": 0,
      "page_size": 10,
      "total_count": 2,
      "total_pages": 1
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /project/{projectId}/test-plans
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}/test-plans:
    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:
        - Test Plans
      summary: List Test Plans
      description: Retrieve a paginated list of test plans for your project.
      operationId: listTestPlans
      parameters:
        - name: search
          in: query
          description: Search by test plan name
          schema:
            type: string
        - name: sort_by
          in: query
          description: Field to sort by
          schema:
            type: string
            enum:
              - name
              - test_count
              - modified_at
              - created_at
            default: name
        - name: sort_order
          in: query
          description: Sort direction
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
        - 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: 20
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTestPlansResponse'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - API key lacks required permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ListTestPlansResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TestPlanSummary'
        pagination:
          type: object
          properties:
            page:
              type: integer
            page_size:
              type: integer
            total_count:
              type: integer
            total_pages:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        details:
          type: object
    TestPlanSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        name:
          type: string
        test_count:
          type: integer
          description: Number of tests in the plan
        created_at:
          type: string
          format: date-time
          nullable: true
        created_by:
          type: string
          nullable: true
        modified_at:
          type: string
          format: date-time
          nullable: true
        modified_by:
          type: string
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key for authentication

````