Tests
A test saves the instructions and settings for a task you want to run more than once. Running a test spawns an agent with that setup. Aiqaramba links each run to the test so you can review results over time.
Overview
A test stores the setup for repeated agent runs. This setup includes the prompt, device, browser or app, files, mailboxes, and role.
Running a test spawns an agent and queues it for execution. The agent receives the saved setup plus any values supplied in the run request. Each agent links to the test, so repeated runs form a result history.
The test configures the run. The agent executes it and owns the state for that execution.
Success determination
The executor performs the test first. When it finishes, it stores result and moves the agent to auditing. The result contains the executor's reported success value and a short summary.
During auditing, a separate, heavier model reviews the trace, network events, console events, and existing findings. The auditor writes the summary object, records supported findings, and can correct result.success.
The API reads result.success as the pass or fail value. The following rules control audit corrections:
- A critical or high product finding changes a reported success to
false. - A successful audit can change a reported failure to
true. - A medium or low finding does not fail the test.
The status field describes the execution lifecycle. An agent can reach completed after the auditor finds a product issue.
Instructions template model
The instructions field carries the actions every agent created from the test performs; the agent starts at the test's entry_url and must resolve every entry of validations before it may finish.
The remaining features in this section apply only to test plan runs. A plan gives each step the values recorded by its ancestor steps. Refer to those values in plain language. Use {{ plan.variables.<name> }} when the instructions need a plan variable; references resolve only inside the instructions.
Example:
Navigate to {{ plan.variables.env_url }} and log in with the credentials recorded by the register step. Open the order created by the checkout step and verify its status is "confirmed".Standalone runs have no test plan context, so they leave plan.variables references unresolved.
List tests
Parameters
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
limit | integer | query | No | Maximum tests to return. |
cursor | uuid | query | No | Return tests with IDs lower than this test ID. |
project_id | uuid | query | No | Filter by project ID. |
Example Request
curl "http://app.aiqaramba.com/api/v1/tests" \ -H "Authorization: Bearer $AIQA_API_KEY"
Status Codes
| Code | Description |
|---|---|
200 | Tenant tests. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
500 | The server could not complete the request. |
Response Fields (200)
| Field | Type | Description |
|---|---|---|
tests | object[] | |
tests[].id | uuid | |
tests[].tenant_id | uuid | |
tests[].project_id | uuid | |
tests[].name | string | |
tests[].description | string | |
tests[].entry_url | string | The URL a browser agent starts at. Always empty for an android test. |
tests[].instructions | string | Plain-language brief of the actions the agent performs. |
tests[].validations | string[] | The things the executing agent must explicitly resolve before it may complete. Empty on a legacy test that has not been edited since the structured prompt was introduced. |
tests[].source | string | |
tests[].status | string | Values: draft, active, archived. |
tests[].importance | string | |
tests[].external_ref | string | |
tests[].file_paths | string[] | |
tests[].issue_state | string | |
tests[].issue_state_type | string | |
tests[].role_id | uuid | |
tests[].device | string | Values: browser, android. |
tests[].browser_type | string | Values: chrome, firefox, edge. |
tests[].app_artifact_id | uuid | |
tests[].mailbox_names | string[] | |
tests[].created_at | date-time | |
tests[].updated_at | date-time | |
next_cursor | uuid |
Create a test
Request Body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
project_id | uuid | Yes | ID of the project this test belongs to |
name | string | Yes | Test name |
description | string | No | Test description |
entry_url | string | No | Absolute http(s) URL the agent starts at. Required for a browser test; must be omitted or empty for an android test. |
instructions | string | Yes | Plain-language brief of the actions the agent performs. Supports {{ plan.variables.name }} references when the test runs inside a test plan. |
validations | string[] | Yes | The concrete things the executing agent must verify and explicitly resolve (passed or failed) before it may complete. At least one; a run with a failed validation cannot complete successfully. |
source | string | No | Origin of the test (e.g. 'discovery', 'manual') |
status | string | No | Lifecycle status: draft (not eligible for regression/schedules), active (eligible), or archived. Defaults to active for manually created tests, draft for generated ones. |
importance | string | No | Test importance level (e.g. 'critical', 'high', 'medium', 'low') |
file_paths | string[] | No | Paths of tenant files to copy into the test run workspace when running this test |
mailbox_names | string[] | No | Mailbox names to save on the test. Each run inherits these mailboxes unless the run request overrides them. |
role_id | uuid | No | Default role for this test. A run can override it. |
device | string | No | Device type: browser or android |
browser_type | string | No | Browser for browser tests: chrome, firefox, or edge |
app_artifact_id | uuid | No | Mobile app ID for Android tests |
Example Request
curl -X POST "http://app.aiqaramba.com/api/v1/tests" \
-H "Authorization: Bearer $AIQA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"project_id": "<uuid>",
"name": "<string>",
"instructions": "<string>",
"validations": ["<string>"]
}'Status Codes
| Code | Description |
|---|---|
201 | Test created. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
404 | The requested resource does not exist. |
500 | The server could not complete the request. |
Response Fields (201)
| Field | Type | Description |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
project_id | uuid | |
name | string | |
description | string | |
entry_url | string | The URL a browser agent starts at. Always empty for an android test. |
instructions | string | Plain-language brief of the actions the agent performs. |
validations | string[] | The things the executing agent must explicitly resolve before it may complete. Empty on a legacy test that has not been edited since the structured prompt was introduced. |
source | string | |
status | string | Values: draft, active, archived. |
importance | string | |
external_ref | string | |
file_paths | string[] | |
issue_state | string | |
issue_state_type | string | |
role_id | uuid | |
device | string | Values: browser, android. |
browser_type | string | Values: chrome, firefox, edge. |
app_artifact_id | uuid | |
mailbox_names | string[] | |
created_at | date-time | |
updated_at | date-time |
Get a test
Parameters
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
id | uuid | path | Yes | Test ID. |
Example Request
curl "http://app.aiqaramba.com/api/v1/tests/<id>" \ -H "Authorization: Bearer $AIQA_API_KEY"
Status Codes
| Code | Description |
|---|---|
200 | Test found. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
404 | The requested resource does not exist. |
500 | The server could not complete the request. |
Response Fields (200)
| Field | Type | Description |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
project_id | uuid | |
name | string | |
description | string | |
entry_url | string | The URL a browser agent starts at. Always empty for an android test. |
instructions | string | Plain-language brief of the actions the agent performs. |
validations | string[] | The things the executing agent must explicitly resolve before it may complete. Empty on a legacy test that has not been edited since the structured prompt was introduced. |
source | string | |
status | string | Values: draft, active, archived. |
importance | string | |
external_ref | string | |
file_paths | string[] | |
issue_state | string | |
issue_state_type | string | |
role_id | uuid | |
device | string | Values: browser, android. |
browser_type | string | Values: chrome, firefox, edge. |
app_artifact_id | uuid | |
mailbox_names | string[] | |
created_at | date-time | |
updated_at | date-time |
Delete a test
Parameters
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
id | uuid | path | Yes | Test ID. |
Example Request
curl -X DELETE "http://app.aiqaramba.com/api/v1/tests/<id>" \ -H "Authorization: Bearer $AIQA_API_KEY"
Status Codes
| Code | Description |
|---|---|
204 | Test deleted. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
404 | The requested resource does not exist. |
500 | The server could not complete the request. |
Update a test
Parameters
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
id | uuid | path | Yes | Test ID. |
Request Body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Test name |
description | string | No | Test description |
entry_url | string | No | Absolute http(s) URL the agent starts at. Must be empty for an android test. |
instructions | string | No | Plain-language brief of the actions the agent performs. |
validations | string[] | No | Replaces the test's validations. At least one. |
source | string | No | Origin of the test |
status | string | No | Lifecycle status: draft, active, or archived |
importance | string | No | Test importance level |
file_paths | string[] | No | Paths of tenant files to copy into the test run workspace when running this test |
mailbox_names | string[] | No | Replace the test's mailboxes. Omit this field to keep them. Send an empty array to remove them all. |
role_id | uuid | No | Default role for this test |
device | string | No | Device type: browser or android |
browser_type | string | No | Browser for browser tests: chrome, firefox, or edge |
app_artifact_id | uuid | No | Mobile app ID for Android tests. Send null to clear it. |
Example Request
curl -X PATCH "http://app.aiqaramba.com/api/v1/tests/<id>" \
-H "Authorization: Bearer $AIQA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "<string>",
"description": "<string>",
"entry_url": "<string>",
"instructions": "<string>",
"validations": ["<string>"],
"source": "<string>",
"status": "<string>",
"importance": "<string>",
"file_paths": ["<string>"],
"mailbox_names": ["<string>"],
"role_id": "<uuid>",
"device": "<string>",
"browser_type": "<string>",
"app_artifact_id": "<uuid>"
}'Status Codes
| Code | Description |
|---|---|
200 | Test updated. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
404 | The requested resource does not exist. |
500 | The server could not complete the request. |
Response Fields (200)
| Field | Type | Description |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
project_id | uuid | |
name | string | |
description | string | |
entry_url | string | The URL a browser agent starts at. Always empty for an android test. |
instructions | string | Plain-language brief of the actions the agent performs. |
validations | string[] | The things the executing agent must explicitly resolve before it may complete. Empty on a legacy test that has not been edited since the structured prompt was introduced. |
source | string | |
status | string | Values: draft, active, archived. |
importance | string | |
external_ref | string | |
file_paths | string[] | |
issue_state | string | |
issue_state_type | string | |
role_id | uuid | |
device | string | Values: browser, android. |
browser_type | string | Values: chrome, firefox, edge. |
app_artifact_id | uuid | |
mailbox_names | string[] | |
created_at | date-time | |
updated_at | date-time |
Run a test
Creates and queues an agent using the saved test configuration and optional overrides.
Parameters
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
id | uuid | path | Yes | Test ID. |
Request Body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
role_id | uuid | No | Role for this run. This value takes precedence over the role saved on the test. |
mailbox_names | string[] | No | Override the test's attached mailboxes for this run. When omitted, the test's stored attachments are inherited. |
model | string | No | LLM model override for this run |
thinking_level | string | No | Override the executor model's reasoning depth for this run: MINIMAL, LOW, MEDIUM, or HIGH. Omit to use the model default. |
auditor_thinking_level | string | No | Reasoning depth for the auditor that reviews this run (MINIMAL, LOW, MEDIUM, HIGH). |
auditor_model | string | No | LLM model for the auditor that reviews this run after it finishes. Lets you pick the review model independently of the run itself. |
max_iterations | integer | No | Max iterations override for this run |
files | json | No | Inline files delivered into the run's workspace before the agent starts. Each entry is {path, content} with base64-encoded content. Max 20 files / 50MB combined per request. |
tunnel | string | No | Hostname of a live tunnel owned by this tenant. The agent starts at the test's entry URL rewritten onto this host, and is instructed to substitute this host for any other URL the prompt mentions. |
Example Request
curl -X POST "http://app.aiqaramba.com/api/v1/tests/<id>/run" \
-H "Authorization: Bearer $AIQA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"role_id": "<uuid>",
"mailbox_names": ["<string>"],
"model": "<string>",
"thinking_level": "<string>",
"auditor_thinking_level": "<string>",
"auditor_model": "<string>",
"max_iterations": 1,
"files": {},
"tunnel": "<string>"
}'Status Codes
| Code | Description |
|---|---|
201 | Test run created and queued. |
400 | The request is malformed or failed validation. |
401 | Authentication is missing or invalid. |
402 | The tenant has exhausted its run allowance. |
404 | The requested resource does not exist. |
500 | The server could not complete the request. |
503 | The requested feature is not configured on this server. |
Response Fields (201)
| Field | Type | Description |
|---|---|---|
id | uuid | |
tenant_id | uuid | |
project_id | uuid | |
role_id | uuid | |
status | string | Values: pending, running, waiting, auditing, completed, failed, stopped. |
name | string | |
prompt | string | |
model | string | |
thinking_level | string | |
auditor_thinking_level | string | |
auditor_model | string | |
browser_type | string | |
device | string | |
kind | string | |
is_discovery | boolean | |
is_benchmark | boolean | |
messages | object[] | |
iteration | integer | |
max_iterations | integer | |
tokens_used | integer | |
cached_tokens | integer | |
auditor_tokens_used | integer | |
auditor_cached_tokens | integer | |
browser_url | uri | |
tunnel_url | uri | |
session_id | string | |
wait_condition | object | |
result | object | |
summary | object | |
test_id | uuid | |
discovery_id | uuid | |
variables | object | |
source | string | |
parent_agent_id | uuid | |
test_plan_node_run_id | uuid | |
schedule_id | uuid | |
app_artifact_id | uuid | |
issue_url | uri | |
finding_id | uuid | |
gh_owner | string | |
gh_repo | string | |
gh_base_branch | string | |
gh_base_sha | string | |
error_classification | string | |
error_explanation | string | |
failure_source | string | |
completion_nudges | object | |
created_by_automated | boolean | |
created_at | date-time | |
updated_at | date-time | |
started_at | date-time | |
completed_at | date-time | |
interaction_url | uri | |
warnings | string[] |