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

# Get Test Case

> Get one test case by id, with its reference SQL, chart definition and sampled preview rows.



## OpenAPI

````yaml get /v2/api/projects/{projectId}/workspaces/{workspaceId}/test-cases/{caseId}
openapi: 3.1.0
info:
  title: Upsolve API
  version: 1.5.0
servers:
  - url: https://api.upsolve.ai
security: []
tags: []
paths:
  /v2/api/projects/{projectId}/workspaces/{workspaceId}/test-cases/{caseId}:
    get:
      summary: Get one test case by id, with its reference SQL, …
      description: >-
        Get one test case by id, with its reference SQL, chart definition and
        sampled preview rows.
      operationId: GetV2ApiProjectsProjectIdWorkspacesWorkspaceIdTestCasesCaseId
      parameters:
        - name: apiKey
          in: query
          required: false
          description: >-
            Upsolve API key, generated under Account → Developer settings in the
            Upsolve Hub. Keys are user-scoped: pass organizationId alongside the
            key to select which org to act on.
          schema:
            type: string
            minLength: 1
            description: >-
              Upsolve API key, generated under Account → Developer settings in
              the Upsolve Hub. Keys are user-scoped: pass organizationId
              alongside the key to select which org to act on.
            examples:
              - up_embed_************
          examples:
            example1:
              value: up_embed_************
        - name: organizationId
          in: query
          required: false
          description: >-
            Your Upsolve organization's UUID — the org that owns the API key and
            project. This is NOT a project organization: do not pass a value
            registered via /projects/register-organization, and do not pass an
            `externalId` (only `projectOrganizationId` accepts those). Omit it
            when using an org-bound API key — the org is read from the key and
            any value sent here is ignored. Required only for user-scoped API
            keys (created under Account → Developer settings) and for the
            Supabase JWT path, where the org is ambiguous and membership is
            verified against it.
          schema:
            description: >-
              Your Upsolve organization's UUID — the org that owns the API key
              and project. This is NOT a project organization: do not pass a
              value registered via /projects/register-organization, and do not
              pass an `externalId` (only `projectOrganizationId` accepts those).
              Omit it when using an org-bound API key — the org is read from the
              key and any value sent here is ignored. Required only for
              user-scoped API keys (created under Account → Developer settings)
              and for the Supabase JWT path, where the org is ambiguous and
              membership is verified against it.
            examples:
              - 123e4567-e89b-12d3-a456-426614174000
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
          examples:
            example1:
              value: 123e4567-e89b-12d3-a456-426614174000
        - name: projectId
          in: path
          required: true
          description: >-
            GET
            /v2/api/projects/:projectId/workspaces/:workspaceId/test-cases/:caseId
            Parameter
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: workspaceId
          in: path
          required: true
          description: >-
            GET
            /v2/api/projects/:projectId/workspaces/:workspaceId/test-cases/:caseId
            Parameter
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: caseId
          in: path
          required: true
          description: The test case's id, as the listing and a create both return.
          schema:
            type: string
            description: The test case's id, as the listing and a create both return.
        - name: goldenAssetsVersion
          in: query
          required: false
          description: >-
            Which version's golden assets decide useAsGoldenAsset. Omit (or 0)
            for the draft.
          schema:
            description: >-
              Which version's golden assets decide useAsGoldenAsset. Omit (or 0)
              for the draft.
            type: integer
            minimum: 0
            maximum: 9007199254740991
      responses:
        '200':
          description: >-
            GET
            /v2/api/projects/:projectId/workspaces/:workspaceId/test-cases/:caseId
            Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The test case's id.
                      question:
                        type: string
                        description: The question the agent must answer.
                      sql_query:
                        type: string
                        description: The reference SQL that correctly answers it.
                      chart_definition:
                        type: string
                        description: The reference chart definition, or an empty string.
                      use_as_example_question:
                        type: boolean
                        description: >-
                          Whether it is offered as a suggestion chip in the
                          chat.
                      useAsGoldenAsset:
                        type: boolean
                        description: >-
                          Whether the agent uses it as a golden asset (a
                          reference example), in the draft or the version asked
                          for.
                      workspace_id:
                        type: string
                      workspace_version:
                        type: number
                        description: >-
                          The workspace version it is anchored to. 0 means
                          unpublished.
                      organization_id:
                        type: string
                      supersedes:
                        type: string
                        description: >-
                          The earlier case this one replaces, or an empty
                          string.
                      change_classification:
                        type: string
                        description: Why it replaced that case, or an empty string.
                      preview:
                        type: array
                        items: {}
                        description: >-
                          Sampled rows stored with the SQL, for the card's
                          chart.
                    required:
                      - id
                      - question
                      - sql_query
                      - chart_definition
                      - use_as_example_question
                      - useAsGoldenAsset
                      - workspace_id
                      - workspace_version
                      - organization_id
                      - supersedes
                      - change_classification
                      - preview
                    additionalProperties: {}
                    description: One workspace test case.
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: >-
            GET
            /v2/api/projects/:projectId/workspaces/:workspaceId/test-cases/:caseId
            Negative response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - message
                    additionalProperties: false
                required:
                  - status
                  - error
                additionalProperties: false
      security:
        - APIKEY_2: []
components:
  securitySchemes:
    APIKEY_2:
      type: apiKey
      in: query
      name: apiKey

````

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