VisualQ
API Reference

CI endpoints

API endpoints for triggering and monitoring test runs.

POST /api/ci/run

Triggers a new visual regression test or baseline capture.

Request

POST https://visualq.ai/api/ci/run
Content-Type: application/json
X-API-Key: your-api-key

Request body

FieldTypeRequiredDescription
projectstringYesProject slug
typestringNo"test" (default), "baseline", "perf", "seo", or "tracking"
environmentstringNoEnvironment name or slug (e.g., "staging")
scenariosstring[]NoScenario labels to filter
browsersstring[]NoBrowsers: "chromium", "firefox", "webkit"
commitShastringNoGit commit SHA
branchstringNoGit branch name
prNumbernumberNoPR number
prUrlstringNoPR URL
ciProviderstringNoCI system name (e.g., "github-actions")
jiraKeystringNoJira issue key
perfBudgetsobjectNoPerformance budget thresholds (when type: "perf"). Keys: lcp, fcp, cls, tbt, ttfb, score

When environment is provided, the run targets that environment's base URL. The resolved environment is included in the response.

When using a project-scoped API key, the project field is optional — the key's associated project is used automatically.

Response (202 Accepted)

{
  "success": true,
  "runId": "run_abc123",
  "projectId": "proj_xyz",
  "type": "test",
  "environmentId": "env_abc",
  "environmentName": "Staging",
  "statusUrl": "/api/ci/status/run_abc123",
  "message": "VRT test started"
}

environmentId and environmentName are only present when an environment was specified in the request.

Errors

StatusResponse
400{"error": "project is required (use the project slug)"}
404{"error": "Project \"slug\" not found"}

GET /api/ci/status/{runId}

Returns the current status and results of a test run.

Request

GET https://visualq.ai/api/ci/status/\{runId\}
X-API-Key: your-api-key

Response

{
  "runId": "run_abc123",
  "projectId": "proj_xyz",
  "status": "completed",
  "type": "test",
  "environmentId": "env_abc",
  "environmentName": "Staging",
  "duration": 12345,
  "summary": {
    "total": 10,
    "passed": 8,
    "failed": 2
  },
  "error": null
}
FieldTypeDescription
runIdstringRun identifier
projectIdstringProject identifier
statusstring"running", "completed", or "failed"
typestring"vrt-test", "baseline", "perf-test", "seo-test", or "tracking-test"
environmentIdstring | undefinedEnvironment identifier (when present on the run)
environmentNamestring | undefinedEnvironment name (when present on the run)
durationnumberDuration in milliseconds (when complete)
summaryobject | nullComparison results
errorstring | nullError message if failed
perfScorenumber | undefinedPerformance score 0–100 (perf runs only)
perfAvgLcpnumber | undefinedAverage LCP in ms (perf runs only)
perfBudgetResultstring | undefined"pass" or "fail" (perf runs with budgets)
seoScorenumber | undefinedSEO score 0–100 (SEO runs only)
seoPassednumber | undefinedNumber of passed SEO checks
seoFailednumber | undefinedNumber of failed SEO checks
seoWarningsnumber | undefinedNumber of SEO warnings
seoLighthouseScorenumber | undefinedLighthouse SEO score (SEO runs only)

Errors

StatusResponse
404{"error": "Run not found"}

GET /api/ci/projects

Lists all projects accessible with the current API key.

Request

GET https://visualq.ai/api/ci/projects
X-API-Key: your-api-key

Response

{
  "projects": [
    {
      "id": "proj_xyz",
      "name": "My Website",
      "slug": "my-website",
      "baseUrl": "https://example.com",
      "scenarioCount": 12
    }
  ],
  "count": 1
}

When using a project-scoped API key, the response contains only the single associated project.

On this page