Skip to main content
POST
/
api
/
trpc
/
test-runs.create
Create Test Run
curl --request POST \
  --url https://api.example.com/api/trpc/test-runs.create \
  --header 'Content-Type: application/json' \
  --data '
{
  "test_id": "<string>",
  "agent_id": "<string>",
  "environment": "<string>",
  "configuration": {
    "timeout": 123,
    "retry_count": 123,
    "parallel_steps": true,
    "screenshot_on_failure": true,
    "video_recording": true
  },
  "variables": {}
}
'
{
  "id": "<string>",
  "status": "<string>",
  "created_at": "<string>",
  "started_at": "<string>",
  "test": {
    "id": "<string>",
    "name": "<string>"
  },
  "agent": {
    "id": "<string>",
    "name": "<string>"
  },
  "400 Bad Request": {},
  "401 Unauthorized": {},
  "404 Not Found": {},
  "409 Conflict": {}
}

Request Body

test_id
string
required
The unique identifier of the test to run
agent_id
string
required
The unique identifier of the agent to use for this test run
environment
string
Override the default environment for this test run
configuration
object
variables
object
Environment variables for this test run

Response

id
string
The unique identifier of the test run
status
string
Current status of the test run: queued, running, completed, failed, timeout
created_at
string
ISO 8601 timestamp of when the test run was created
started_at
string
ISO 8601 timestamp of when the test run started executing
test
object
agent
object

Example Request

curl -X POST https://api.tryiris.dev/api/trpc/test-runs.create \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "0": {
      "json": {
        "data": {
          "test_id": "tst_1a2b3c4d5e",
          "agent_id": "agt_7f8d9e2a1b3c",
          "environment": "staging",
          "configuration": {
            "timeout": 300,
            "retry_count": 2,
            "parallel_steps": true,
            "screenshot_on_failure": true,
            "video_recording": true
          },
          "variables": {
            "USER_EMAIL": "test@example.com",
            "PRODUCT_SKU": "DEMO-123"
          }
        }
      }
    }
  }'

Example Response

{
  "id": "run_2f3e4d5c6b",
  "status": "queued",
  "created_at": "2024-01-20T14:00:00Z",
  "started_at": null,
  "test": {
    "id": "tst_1a2b3c4d5e",
    "name": "Product Purchase Flow"
  },
  "agent": {
    "id": "agt_7f8d9e2a1b3c",
    "name": "e2e-test-agent"
  },
  "configuration": {
    "timeout": 300,
    "retry_count": 2,
    "parallel_steps": true,
    "screenshot_on_failure": true,
    "video_recording": true
  },
  "variables": {
    "USER_EMAIL": "test@example.com",
    "PRODUCT_SKU": "DEMO-123"
  }
}

Error Responses

400 Bad Request
object
Invalid request body or parameters
{
  "error": "invalid_request",
  "message": "Invalid test_id provided"
}
401 Unauthorized
object
Missing or invalid API key
{
  "error": "unauthorized",
  "message": "Invalid API key provided"
}
404 Not Found
object
Test or agent not found
{
  "error": "not_found",
  "message": "Test not found"
}
409 Conflict
object
Agent is busy or unavailable
{
  "error": "conflict",
  "message": "Agent is currently executing another test"
}