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.

GET /api/v1/tests

List tests

Parameters

ParameterTypeInRequiredDescription
limitintegerqueryNoMaximum tests to return.
cursoruuidqueryNoReturn tests with IDs lower than this test ID.
project_iduuidqueryNoFilter by project ID.

Example Request

curl
curl "http://app.aiqaramba.com/api/v1/tests" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
200Tenant tests.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
testsobject[]
tests[].iduuid
tests[].tenant_iduuid
tests[].project_iduuid
tests[].namestring
tests[].descriptionstring
tests[].entry_urlstringThe URL a browser agent starts at. Always empty for an android test.
tests[].instructionsstringPlain-language brief of the actions the agent performs.
tests[].validationsstring[]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[].sourcestring
tests[].statusstringValues: draft, active, archived.
tests[].importancestring
tests[].external_refstring
tests[].file_pathsstring[]
tests[].issue_statestring
tests[].issue_state_typestring
tests[].role_iduuid
tests[].devicestringValues: browser, android.
tests[].browser_typestringValues: chrome, firefox, edge.
tests[].app_artifact_iduuid
tests[].mailbox_namesstring[]
tests[].created_atdate-time
tests[].updated_atdate-time
next_cursoruuid
POST /api/v1/tests

Create a test

Request Body (application/json)

FieldTypeRequiredDescription
project_iduuidYesID of the project this test belongs to
namestringYesTest name
descriptionstringNoTest description
entry_urlstringNoAbsolute http(s) URL the agent starts at. Required for a browser test; must be omitted or empty for an android test.
instructionsstringYesPlain-language brief of the actions the agent performs. Supports {{ plan.variables.name }} references when the test runs inside a test plan.
validationsstring[]YesThe 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.
sourcestringNoOrigin of the test (e.g. 'discovery', 'manual')
statusstringNoLifecycle status: draft (not eligible for regression/schedules), active (eligible), or archived. Defaults to active for manually created tests, draft for generated ones.
importancestringNoTest importance level (e.g. 'critical', 'high', 'medium', 'low')
file_pathsstring[]NoPaths of tenant files to copy into the test run workspace when running this test
mailbox_namesstring[]NoMailbox names to save on the test. Each run inherits these mailboxes unless the run request overrides them.
role_iduuidNoDefault role for this test. A run can override it.
devicestringNoDevice type: browser or android
browser_typestringNoBrowser for browser tests: chrome, firefox, or edge
app_artifact_iduuidNoMobile app ID for Android tests

Example Request

curl
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

CodeDescription
201Test created.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.

Response Fields (201)

FieldTypeDescription
iduuid
tenant_iduuid
project_iduuid
namestring
descriptionstring
entry_urlstringThe URL a browser agent starts at. Always empty for an android test.
instructionsstringPlain-language brief of the actions the agent performs.
validationsstring[]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.
sourcestring
statusstringValues: draft, active, archived.
importancestring
external_refstring
file_pathsstring[]
issue_statestring
issue_state_typestring
role_iduuid
devicestringValues: browser, android.
browser_typestringValues: chrome, firefox, edge.
app_artifact_iduuid
mailbox_namesstring[]
created_atdate-time
updated_atdate-time
GET /api/v1/tests/{id}

Get a test

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesTest ID.

Example Request

curl
curl "http://app.aiqaramba.com/api/v1/tests/<id>" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
200Test found.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
iduuid
tenant_iduuid
project_iduuid
namestring
descriptionstring
entry_urlstringThe URL a browser agent starts at. Always empty for an android test.
instructionsstringPlain-language brief of the actions the agent performs.
validationsstring[]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.
sourcestring
statusstringValues: draft, active, archived.
importancestring
external_refstring
file_pathsstring[]
issue_statestring
issue_state_typestring
role_iduuid
devicestringValues: browser, android.
browser_typestringValues: chrome, firefox, edge.
app_artifact_iduuid
mailbox_namesstring[]
created_atdate-time
updated_atdate-time
DELETE /api/v1/tests/{id}

Delete a test

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesTest ID.

Example Request

curl
curl -X DELETE "http://app.aiqaramba.com/api/v1/tests/<id>" \
  -H "Authorization: Bearer $AIQA_API_KEY"

Status Codes

CodeDescription
204Test deleted.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.
PATCH /api/v1/tests/{id}

Update a test

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesTest ID.

Request Body (application/json)

FieldTypeRequiredDescription
namestringNoTest name
descriptionstringNoTest description
entry_urlstringNoAbsolute http(s) URL the agent starts at. Must be empty for an android test.
instructionsstringNoPlain-language brief of the actions the agent performs.
validationsstring[]NoReplaces the test's validations. At least one.
sourcestringNoOrigin of the test
statusstringNoLifecycle status: draft, active, or archived
importancestringNoTest importance level
file_pathsstring[]NoPaths of tenant files to copy into the test run workspace when running this test
mailbox_namesstring[]NoReplace the test's mailboxes. Omit this field to keep them. Send an empty array to remove them all.
role_iduuidNoDefault role for this test
devicestringNoDevice type: browser or android
browser_typestringNoBrowser for browser tests: chrome, firefox, or edge
app_artifact_iduuidNoMobile app ID for Android tests. Send null to clear it.

Example Request

curl
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

CodeDescription
200Test updated.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
404The requested resource does not exist.
500The server could not complete the request.

Response Fields (200)

FieldTypeDescription
iduuid
tenant_iduuid
project_iduuid
namestring
descriptionstring
entry_urlstringThe URL a browser agent starts at. Always empty for an android test.
instructionsstringPlain-language brief of the actions the agent performs.
validationsstring[]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.
sourcestring
statusstringValues: draft, active, archived.
importancestring
external_refstring
file_pathsstring[]
issue_statestring
issue_state_typestring
role_iduuid
devicestringValues: browser, android.
browser_typestringValues: chrome, firefox, edge.
app_artifact_iduuid
mailbox_namesstring[]
created_atdate-time
updated_atdate-time
POST /api/v1/tests/{id}/run

Run a test

Creates and queues an agent using the saved test configuration and optional overrides.

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesTest ID.

Request Body (application/json)

FieldTypeRequiredDescription
role_iduuidNoRole for this run. This value takes precedence over the role saved on the test.
mailbox_namesstring[]NoOverride the test's attached mailboxes for this run. When omitted, the test's stored attachments are inherited.
modelstringNoLLM model override for this run
thinking_levelstringNoOverride the executor model's reasoning depth for this run: MINIMAL, LOW, MEDIUM, or HIGH. Omit to use the model default.
auditor_thinking_levelstringNoReasoning depth for the auditor that reviews this run (MINIMAL, LOW, MEDIUM, HIGH).
auditor_modelstringNoLLM model for the auditor that reviews this run after it finishes. Lets you pick the review model independently of the run itself.
max_iterationsintegerNoMax iterations override for this run
filesjsonNoInline 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.
tunnelstringNoHostname 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
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

CodeDescription
201Test run created and queued.
400The request is malformed or failed validation.
401Authentication is missing or invalid.
402The tenant has exhausted its run allowance.
404The requested resource does not exist.
500The server could not complete the request.
503The requested feature is not configured on this server.

Response Fields (201)

FieldTypeDescription
iduuid
tenant_iduuid
project_iduuid
role_iduuid
statusstringValues: pending, running, waiting, auditing, completed, failed, stopped.
namestring
promptstring
modelstring
thinking_levelstring
auditor_thinking_levelstring
auditor_modelstring
browser_typestring
devicestring
kindstring
is_discoveryboolean
is_benchmarkboolean
messagesobject[]
iterationinteger
max_iterationsinteger
tokens_usedinteger
cached_tokensinteger
auditor_tokens_usedinteger
auditor_cached_tokensinteger
browser_urluri
tunnel_urluri
session_idstring
wait_conditionobject
resultobject
summaryobject
test_iduuid
discovery_iduuid
variablesobject
sourcestring
parent_agent_iduuid
test_plan_node_run_iduuid
schedule_iduuid
app_artifact_iduuid
issue_urluri
finding_iduuid
gh_ownerstring
gh_repostring
gh_base_branchstring
gh_base_shastring
error_classificationstring
error_explanationstring
failure_sourcestring
completion_nudgesobject
created_by_automatedboolean
created_atdate-time
updated_atdate-time
started_atdate-time
completed_atdate-time
interaction_urluri
warningsstring[]