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

# Get a test case

> Retrieves a single test case by its Playwright test ID. Access is derived from the test case's project, returning 403 when the caller cannot access it.



## OpenAPI

````yaml /api-reference/openapi.generated.json get /api/v2/test-cases/{id}
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: Analytics
    description: Aggregated test-run, test-count and test-case analytics for a project.
  - name: Analytics (Deprecated)
    description: >-
      Legacy analytics endpoints retained for backwards compatibility; prefer
      the v2 equivalents.
  - 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: Telemetry
    description: Product telemetry derived from analytics events, scoped to a project.
  - name: Test Cases
    description: >-
      Browse the Playwright test cases synced from a project's repository and
      manage their tags.
paths:
  /api/v2/test-cases/{id}:
    get:
      tags:
        - Test Cases
      summary: Get a test case
      description: >-
        Retrieves a single test case by its Playwright test ID. Access is
        derived from the test case's project, returning 403 when the caller
        cannot access it.
      operationId: getTestCase
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Playwright test ID (pw_test_id), the 41-character hash identifying
              the test case.
          required: true
          description: >-
            Playwright test ID (pw_test_id), the 41-character hash identifying
            the test case.
          name: id
          in: path
      responses:
        '200':
          description: The test case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTestCaseResponse'
        '403':
          description: The test case belongs to a project you cannot access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Test case not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GetTestCaseResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            test_case:
              $ref: '#/components/schemas/TestCase'
          required:
            - test_case
          description: Response payload.
      required:
        - data
    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
    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

````