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

# List test cases

> Returns a paginated list of the scoped project's test cases with optional filtering, along with the project's latest test-cases sync error.



## OpenAPI

````yaml /api-reference/openapi.generated.json get /api/v2/test-cases
openapi: 3.1.0
info:
  title: Empirical API
  version: 1.0.0
  description: Programmatic access to Empirical test runs, snoozes, and more.
  contact:
    name: Empirical
    url: https://empirical.run
servers:
  - url: https://api.empirical.run
security:
  - Bearer: []
tags:
  - name: Test Runs
    description: Trigger, list, and inspect end-to-end test runs.
  - name: Test Cases
    description: >-
      Browse the Playwright test cases synced from a project's repository and
      manage their tags.
  - name: Environments
    description: >-
      Named deployment targets (slug + Playwright project filters) a project's
      tests run against.
  - name: Snoozes
    description: Temporarily suppress known test failures for specific Playwright tests.
  - name: KV
    description: >-
      Project-scoped key-value store shared by test runs, shards and agent
      sessions. Every entry expires; conditional writes make it safe for locks.
  - name: Analytics
    description: Aggregated test-run, test-count and test-case analytics for a project.
  - name: Allowed recipients
    description: >-
      Domains and addresses a project's inboxes may send email to, besides
      @empiricalrun.email addresses and people who emailed the inbox. Each one
      is verified in one of two ways. **Email from it**: send an email from the
      domain (any mailbox on it) or from the exact address to the verification
      address, with the verification code in the subject. It must pass DMARC.
      **Emailed code**, for addresses that can't send (e.g.
      `support@acme.zendesk.com`): we email the address a 6-digit code, and you
      enter it from wherever that address delivers. A domain covers exactly that
      domain, not its subdomains; add a subdomain such as `inbound.acme.com` on
      its own, and an email from `@acme.com` verifies it. Public mail providers
      (gmail.com, outlook.com and similar) can't be added as domains; add the
      exact address instead. An address also covers its plus-variants. Domains
      reserved for examples and tests (example.com, example.net, example.org,
      and anything under .test, .example, .invalid or .localhost) can't receive
      email, so codes are never emailed to them.
  - name: Badges
    description: Public README status badge images (SVG) for project environments.
  - name: Files
    description: >-
      Upload files of any type and get a link to use in tasks, sessions and
      messages. Agents should use the `upload_file` tool, which returns a
      project-wide `file@<id>` handle (`<id>` is the file `id` below).
  - name: Inboxes
    description: >-
      Test email addresses on @empiricalrun.email that a project claims. Only
      the claiming project can read an inbox, and only mail received after the
      claim. Typical flow: claim an address, sign up or log in to your app with
      it, then list the inbox's messages. Inboxes can also send mail, e.g. to
      test an app that processes inbound email: to @empiricalrun.email
      addresses, to anyone who emailed the inbox, and to the project's allowed
      recipients. Replies land back in the sending inbox.
  - name: Infra
    description: >-
      Infrastructure details customers configure against, such as static egress
      IPs.
  - name: Reporter Configuration
    description: Reporters a project can use in environment and run reporter configs.
  - name: Webhook Captures
    description: >-
      Throwaway URLs that record every request sent to them, for testing
      webhooks your app sends.
paths:
  /api/v2/test-cases:
    get:
      tags:
        - Test Cases
      summary: List test cases
      description: >-
        Returns a paginated list of the scoped project's test cases with
        optional filtering, along with the project's latest test-cases sync
        error.
      operationId: listTestCases
      parameters:
        - schema:
            type: string
            description: >-
              Comma-separated Playwright test IDs to filter by. Capped at the
              first 100.
          required: false
          description: >-
            Comma-separated Playwright test IDs to filter by. Capped at the
            first 100.
          name: ids
          in: query
        - schema:
            type: string
            description: Filter to test cases whose file path starts with this value.
          required: false
          description: Filter to test cases whose file path starts with this value.
          name: file_path
          in: query
        - schema:
            type: string
            description: Filter to test cases in this Playwright project.
          required: false
          description: Filter to test cases in this Playwright project.
          name: playwright_project
          in: query
        - schema:
            type: string
            description: >-
              Comma-separated tags; returns test cases having any of the given
              tags.
          required: false
          description: >-
            Comma-separated tags; returns test cases having any of the given
            tags.
          name: tags
          in: query
        - schema:
            type: string
            description: Free-text search across the test case name and file path.
          required: false
          description: Free-text search across the test case name and file path.
          name: search
          in: query
        - schema:
            type: string
            description: Filter to test cases first seen at this commit SHA.
          required: false
          description: Filter to test cases first seen at this commit SHA.
          name: first_seen_commit_sha
          in: query
        - schema:
            type: string
            description: Filter to test cases last seen at this commit SHA.
          required: false
          description: Filter to test cases last seen at this commit SHA.
          name: last_seen_commit_sha
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              When `true` (default), restrict to test cases present at the
              project's last synced commit. Set `false` to include all test
              cases.
          required: false
          description: >-
            When `true` (default), restrict to test cases present at the
            project's last synced commit. Set `false` to include all test cases.
          name: is_active
          in: query
        - schema:
            type: integer
            minimum: 1
            default: 1
            description: Page number (1-indexed). Defaults to 1.
          required: false
          description: Page number (1-indexed). Defaults to 1.
          name: page
          in: query
        - schema:
            type: integer
            minimum: 1
            default: 100
            description: Items per page. Defaults to 100.
          required: false
          description: Items per page. Defaults to 100.
          name: per_page
          in: query
      responses:
        '200':
          description: Paginated test cases and sync status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCaseListResponse'
        '400':
          description: Invalid request or project could not be resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Project not found or not accessible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TestCaseListResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            test_cases:
              type: array
              items:
                $ref: '#/components/schemas/TestCase'
              description: The page of test cases.
            sync_error:
              type: object
              nullable: true
              properties:
                message:
                  type: string
                  description: The error reported by the last test-cases sync.
                occurred_at:
                  type: string
                  nullable: true
                  description: ISO 8601 timestamp of the sync error, or null.
              required:
                - message
                - occurred_at
              description: >-
                Details of the project's last test-cases sync error, or null
                when the last sync succeeded.
          required:
            - test_cases
            - sync_error
          description: Test cases plus the project's sync status.
        pagination:
          $ref: '#/components/schemas/TestCaseListPagination'
      required:
        - data
        - pagination
    ErrorResponse:
      type: object
      properties:
        data:
          nullable: true
          description: Always null for error responses.
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
          required:
            - message
          description: Error details.
      required:
        - data
        - error
    TestCase:
      type: object
      properties:
        id:
          type: string
          description: >-
            Playwright test ID (pw_test_id), a 41-character hash that uniquely
            identifies the test.
        name:
          type: string
          description: Test case name.
        file_path:
          type: string
          description: File path of the test case.
        suites:
          type: array
          items:
            type: string
          description: Array of suite names the test belongs to.
        playwright_project:
          type: string
          description: Playwright project name.
        tags:
          type: array
          items:
            type: string
          description: Array of tags assigned to the test case.
        created_at:
          type: string
          description: ISO 8601 timestamp.
        updated_at:
          type: string
          description: ISO 8601 timestamp.
        first_seen_commit_sha:
          type: string
          nullable: true
          description: >-
            Commit SHA where this test case was first seen. Null if not
            available.
        last_seen_commit_sha:
          type: string
          nullable: true
          description: >-
            Commit SHA where this test case was last seen. Null if not
            available.
        dependencies:
          $ref: '#/components/schemas/TestCaseV2Dependencies'
      required:
        - id
        - name
        - file_path
        - suites
        - playwright_project
        - tags
        - created_at
        - updated_at
        - first_seen_commit_sha
        - last_seen_commit_sha
        - dependencies
    TestCaseListPagination:
      type: object
      properties:
        page:
          type: integer
          description: Current page (1-indexed).
        per_page:
          type: integer
          description: Items per page.
        total:
          type: integer
          description: Total number of items.
        total_pages:
          type: integer
          description: Total number of pages.
        has_more:
          type: boolean
          description: Whether more pages exist beyond the current one.
      required:
        - page
        - per_page
        - total
        - total_pages
        - has_more
      description: Pagination metadata.
    TestCaseV2Dependencies:
      type: object
      properties:
        playwright_serial:
          type: object
          properties:
            group_id:
              type: string
              description: ID of the serial dependency group.
            title_path:
              type: array
              items:
                type: string
              description: Full title path of the test within the group.
            file_path:
              type: string
              description: File path of the test within the group.
            playwright_project:
              type: string
              description: Playwright project of the group.
            dependency_order:
              type: integer
              description: Position of this test in the serial order.
            group_size:
              type: integer
              description: Number of tests in the serial group.
            depends_on:
              type: array
              items:
                type: string
              description: Test IDs this test depends on running first.
          required:
            - group_id
            - title_path
            - file_path
            - playwright_project
            - dependency_order
            - group_size
            - depends_on
          description: Serial-execution dependency group this test belongs to, if any.
      description: >-
        Dependency-group metadata for a test case (e.g. Playwright serial
        groups). Empty object when the test has no dependencies.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````

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