Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview

List test cases in a version or the draft

List the cases of a published version (default: the latest), or of the draft with version=‘draft’.

GET/v1/projects/{projectId}/test-suites/{testSuiteId}/cases
Authorization
AuthorizationPersonal API key · headerrequired

Your personal API key from Settings > Personal API Keys, sent as Bearer <key>.

X-Organization-IdOrganization ID · headerrequired

The organization to act in. Copy it with Copy organization ID in the organization menu or the settings sidebar.

Path parameters
projectIdstring<uuid>required
testSuiteIdstring<uuid>required
Query parameters
versionstring

A version number or draft; defaults to the latest published version, or the draft if nothing is published.

matches ^([1-9][0-9]*|draft)$
offsetinteger
min 0
limitinteger
min 1 · max 100
Responses
200

Response for status 200

versionintegerrequired
draftbooleanrequired

Whether version is the unpublished draft, numbered as it will publish.

casesTestCase[]required
Show properties
Array of TestCase
case_idstring<uuid>required
namestring | nullrequired
Show properties
Any of:
string
string
null
null
inputanyrequired
expectedobjectrequired
tagsstring[]required
metadataobjectrequired
version_addedintegerrequired
judge_namesobjectrequired

Names of the judges in these cases' checks, by judge id. Deleted judges are left out.

next_offsetinteger | nullrequired
Show properties
Any of:
integer
integer
null
null
404

Response for status 404

errorstringrequired
messagestring
codestring
detailsstring[]
409

Response for status 409

errorstringrequired
messagestring
codestring
detailsstring[]
422

Response for status 422

errorstringrequired
messagestring
codestring
detailsstring[]
Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.judgmentlabs.ai/v1/projects/YOUR_PROJECT_ID/test-suites/YOUR_TEST_SUITE_ID/cases' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Organization-Id: YOUR_ORGANIZATION_ID' \
  -H 'Accept: application/json'
Response
{
  "version": 0,
  "draft": true,
  "cases": [
    {
      "case_id": "c74269e5-1f97-4e20-9164-ffbe3494d8d6",
      "name": "string",
      "input": null,
      "expected": {},
      "tags": [
        "string"
      ],
      "metadata": {},
      "version_added": 0
    }
  ],
  "judge_names": {},
  "next_offset": 0
}

Was this page helpful?