Skip to main content
GET
/
api
/
trpc
/
test.findMany
List Tests
curl --request GET \
  --url https://app.tryiris.dev/api/trpc/test.findMany \
  --header 'IRIS_ACCESS_TOKEN: <iris_access_token>'
[
  {
    "result": {
      "data": {
        "json": [
          {
            "id": "c5147ecb-22d0-4704-9a30-932ebf28302f",
            "name": "Login Flow",
            "description": "This will test the login flow",
            "url": "https://example.com",
            "naturalLanguageInput": "Goto https://example.com\nClick on login...",
            "status": "DRAFT",
            "isActive": true,
            "projectId": "d0a010ca-aa50-457b-9957-0d133d34886a",
            "testRuns": [
              {
                "id": "c3a99503-b2e5-4958-8787-922a483d933f",
                "status": "PENDING",
                "errorLog": null,
                "reportUrl": null
              }
            ]
          }
        ]
      }
    }
  }
]

List Tests

Fetch a list of tests associated with a project, optionally including their latest test runs and project details.

Headers

IRIS_ACCESS_TOKEN
string
required
Your Iris API access token

Query Parameters

batch
number
required
Must be set to 1 to enable request batching
input
object
required
The query parameters in JSON format

Batching Requests

You can batch multiple related requests together for better performance. To batch requests, use the following format:
{
  "0": {
    "json": {
      "where": {
        "id": "<project-id>"
      }
    }
  },
  "1": {
    "json": {
      "where": {
        "projectId": "<project-id>",
        "name": {
          "contains": "",
          "mode": "insensitive"
        }
      },
      "include": {
        "testRuns": {
          "orderBy": {
            "createdAt": "desc"
          },
          "take": 1
        }
      }
    }
  }
}

Response

result
array
Array containing test objects with the following structure:
[
  {
    "result": {
      "data": {
        "json": [
          {
            "id": "c5147ecb-22d0-4704-9a30-932ebf28302f",
            "name": "Login Flow",
            "description": "This will test the login flow",
            "url": "https://example.com",
            "naturalLanguageInput": "Goto https://example.com\nClick on login...",
            "status": "DRAFT",
            "isActive": true,
            "projectId": "d0a010ca-aa50-457b-9957-0d133d34886a",
            "testRuns": [
              {
                "id": "c3a99503-b2e5-4958-8787-922a483d933f",
                "status": "PENDING",
                "errorLog": null,
                "reportUrl": null
              }
            ]
          }
        ]
      }
    }
  }
]

Tips

  1. Use batching to combine related queries and reduce network requests
  2. The batch=1 query parameter enables request batching
  3. You can combine project.findFirst and test.findMany in a single request
  4. Use the include parameter to fetch related test runs
  5. The mode: "insensitive" option in name search enables case-insensitive searching

Error Codes

401
object
Unauthorized - Invalid or missing API token
404
object
Project not found
500
object
Internal server error