Skip to main content
POST
/
api
/
trpc
/
test.create
Create Test
curl --request POST \
  --url https://app.tryiris.dev/api/trpc/test.create \
  --header 'Content-Type: application/json' \
  --header 'IRIS_ACCESS_TOKEN: <iris_access_token>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "url": "<string>",
  "naturalLanguageInput": "<string>",
  "status": "<string>",
  "projectId": "<string>",
  "createdById": "<string>"
}
'
[
  {
    "result": {
      "data": {
        "json": {
          "id": "f7cee2e0-69bf-457e-a2e0-cd0dc0299dea",
          "name": "Pikachu",
          "description": "This is to test that wikipedia's pikachu page is live",
          "url": "https://en.wikipedia.org/wiki/Pikachu",
          "naturalLanguageInput": "Goto google.com\nLook for : https://en.wikipedia.org/wiki/Pikachu\nIf the page is live report success",
          "status": "DRAFT",
          "isActive": true,
          "projectId": "e52a06ec-6a16-4ae1-9a06-75cab17423c5",
          "createdById": "21a857f1-ba5f-4435-bcf6-f910ec07c0dc",
          "createdAt": "2025-01-01T08:43:07.964Z",
          "updatedAt": "2025-01-01T08:43:07.964Z"
        }
      }
    }
  }
]

Create Test

Create a new test case with specified parameters for automated testing.

Headers

IRIS_ACCESS_TOKEN
string
required
Your Iris API access token

Body

name
string
required
Name of the test case
description
string
required
Description of what the test does
url
string
required
Target URL to test
naturalLanguageInput
string
required
Test steps in natural language
status
string
required
Initial status of the test (e.g., “DRAFT”)
projectId
string
required
ID of the project this test belongs to
createdById
string
required
ID of the user creating the test

Response

Returns the created test details upon success.
{
  "0": {
    "json": {
      "data": {
        "name": "Pikachu",
        "description": "This is to test that wikipedia's pikachu page is live",
        "url": "https://en.wikipedia.org/wiki/Pikachu",
        "naturalLanguageInput": "Goto google.com\nLook for : https://en.wikipedia.org/wiki/Pikachu\nIf the page is live report success",
        "status": "DRAFT",
        "projectId": "e52a06ec-6a16-4ae1-9a06-75cab17423c5",
        "createdById": "21a857f1-ba5f-4435-bcf6-f910ec07c0dc"
      }
    }
  }
}
[
  {
    "result": {
      "data": {
        "json": {
          "id": "f7cee2e0-69bf-457e-a2e0-cd0dc0299dea",
          "name": "Pikachu",
          "description": "This is to test that wikipedia's pikachu page is live",
          "url": "https://en.wikipedia.org/wiki/Pikachu",
          "naturalLanguageInput": "Goto google.com\nLook for : https://en.wikipedia.org/wiki/Pikachu\nIf the page is live report success",
          "status": "DRAFT",
          "isActive": true,
          "projectId": "e52a06ec-6a16-4ae1-9a06-75cab17423c5",
          "createdById": "21a857f1-ba5f-4435-bcf6-f910ec07c0dc",
          "createdAt": "2025-01-01T08:43:07.964Z",
          "updatedAt": "2025-01-01T08:43:07.964Z"
        }
      }
    }
  }
]

Response Fields

id
string
Unique identifier for the created test
name
string
Name of the test case
description
string
Description of the test case
url
string
Target URL being tested
naturalLanguageInput
string
Test steps in natural language
status
string
Current status of the test
isActive
boolean
Whether the test is active
projectId
string
ID of the associated project
createdById
string
ID of the user who created the test
createdAt
date
Timestamp of when the test was created
updatedAt
date
Timestamp of when the test was last updated