ApiError
Standard error body returned by every endpoint on failure.
| Name | Type | Description |
|---|---|---|
error | string | |
details | unknown |
API Docs
packages/types/src. These are the payloads shared by the Fastify API and the Next.js app.Standard error body returned by every endpoint on failure.
| Name | Type | Description |
|---|---|---|
error | string | |
details | unknown |
Body for POST /test-runs/:id/approve-visuals.
MessageResponsepackages/types/src/api.ts:317| Name | Type | Description |
|---|---|---|
user | User | |
token | string | JWT — also set as an httpOnly cookie; returned for non-browser clients. |
Baselinepackages/types/src/api.ts:308Baseline[]packages/types/src/api.ts:306A version reduced to what the compare result needs to label each side.
| Name | Type | Description |
|---|---|---|
id | string | |
version | number | |
filePath | string | |
viewport | string | |
approvedAt | ISODateString |
Response of GET /baseline-versions?suiteId=&path=&viewport=
BaselineVersion[]packages/types/src/api.ts:166'cancel'packages/types/src/api.ts:245Body for POST /baseline-versions/compare — diff any two versions.
| Name | Type | Description |
|---|---|---|
fromVersionId | string | |
toVersionId | string |
Response of POST /baseline-versions/compare — an on-demand generated diff.
| Name | Type | Description |
|---|---|---|
from | BaselineVersionRef | |
to | BaselineVersionRef | |
diffFile | string | Generated diff PNG URL. |
diffScore | number | Similarity score, 0–100 (100 = identical). |
diffPercentage | number | Percentage of pixels that differ, 0–100. |
dimensions | { width: number; height: number } |
Response of POST /test-suites/:id/crawl.
| Name | Type | Description |
|---|---|---|
message | string |
Body for POST /manual-runs — create a quick single-URL bucket. The URL's origin becomes the bucket's baseUrl and the URL is added directly as a tracked page (no crawl). The first run is kicked off automatically and captures the baseline; later runs diff against it.
| Name | Type | Description |
|---|---|---|
url | string | The single URL to test (full, absolute). |
name | string | Optional label; defaults to the URL's host + path. |
Response of POST /manual-runs — the created bucket plus its first run id.
| Name | Type | Description |
|---|---|---|
manualRun | TestSuite | |
testRunId | string |
| Name | Type | Description |
|---|---|---|
name | string | |
baseUrl | string | |
description | string | |
config | Partial<TestSuiteConfig> |
| Name | Type | Description |
|---|---|---|
email | string |
GitHubInstallation[]packages/types/src/api.ts:312GitHubRepo[]packages/types/src/api.ts:314| Name | Type | Description |
|---|---|---|
testSuiteId | string | |
status | string | |
limit | number | |
offset | number |
Optional filters for GET /test-suites.
| Name | Type | Description |
|---|---|---|
kind | TestSuiteKind | Restrict to a single kind. Defaults to SUITE-only (manual buckets hidden). |
Payload broadcast to a `test-run-:id` room when a new log line is emitted.
| Name | Type | Description |
|---|---|---|
testRunId | string | |
log | TestRunLog |
| Name | Type | Description |
|---|---|---|
email | string | |
password | string |
A manual-run bucket is a TestSuite with kind === MANUAL.
TestSuitepackages/types/src/api.ts:286TestSuiteDetailpackages/types/src/api.ts:290TestSuiteWithCountAndRuns[]packages/types/src/api.ts:288| Name | Type | Description |
|---|---|---|
user | User |
Generic success message body.
| Name | Type | Description |
|---|---|---|
message | string |
Response of GET /test-suites/:id/pages/:pageId — a single page with its current per-viewport baselines and latest run outcome.
| Name | Type | Description |
|---|---|---|
page | SitePageWithResult | |
baselines | PageCurrentBaseline[] | Current baseline per viewport (latest version of each). |
viewports | string[] | Viewports this page has baseline history for. |
versionCount | number | Total baseline versions across all viewports. |
Response of GET /test-suites/:id/pages/:pageId/history — the baseline timeline, newest first. Optional ?viewport= filter narrows to one viewport.
| Name | Type | Description |
|---|---|---|
page | { id: string; path: string; title?: string | null; url: string } | |
events | BaselineVersionEvent[] | |
viewports | string[] |
Offset-based pagination envelope.
| Name | Type | Description |
|---|---|---|
total | number | |
limit | number | |
offset | number | |
hasMore | boolean |
| Name | Type | Description |
|---|---|---|
email | string | |
password | string | |
name | string |
Body for POST /test-runs/:id/rerun — re-test the errored viewports of a single page (identified by its URL) within an existing run. Re-screenshots and re-compares only the ERROR-status results for that URL and overwrites them in place; passing/changed viewports are left untouched.
| Name | Type | Description |
|---|---|---|
url | string | The page URL whose errored viewport results should be re-run. |
Response of POST /test-runs/:id/rerun.
| Name | Type | Description |
|---|---|---|
message | string | |
testRunId | string | |
rerunCount | number | How many errored viewport results were queued for re-running. |
| Name | Type | Description |
|---|---|---|
token | string | |
password | string |
Response of POST /manual-runs/:id/run — re-test the bucket's URL.
| Name | Type | Description |
|---|---|---|
message | string | |
testRunId | string |
Optional body for POST /test-suites/:id/run. Omitted/empty => a MANUAL run against the suite's own baseUrl. A BRANCH run targets a preview URL and never mutates baselines or GitHub.
| Name | Type | Description |
|---|---|---|
targetBaseUrl | string | |
branch | string | |
runType | RunType |
| Name | Type | Description |
|---|---|---|
message | string | |
testRunId | string |
Bulk actions on a suite's discovered pages.
| 'track' /** Deselect pages from visual diffing. */ | 'untrack' /** Clear NEW flags without tracking (mark reviewed). */ | 'acknowledge' /** Delete page entries entirely (used to clean up REMOVED pages). */ | 'delete'packages/types/src/api.ts:197Body for PATCH /test-suites/:id/pages.
| Name | Type | Description |
|---|---|---|
action | SitePageAction | |
pageIds | string[] |
| Name | Type | Description |
|---|---|---|
message | string | |
affected | number |
Response of GET /test-suites/:id/pages — the combined sitemap view.
| Name | Type | Description |
|---|---|---|
pages | SitePageWithResult[] | |
crawl | SuiteCrawlState | |
counts | { total: number; tracked: number; new: number; removed: number; } |
(typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS]packages/types/src/api.ts:330| Name | Type | Description |
|---|---|---|
testRunId | string | |
logs | TestRunLog[] | |
count | number |
TestRunDetailpackages/types/src/api.ts:237| Name | Type | Description |
|---|---|---|
testRuns | TestRunWithSuite[] | |
pagination | Pagination |
TestSuiteDetailpackages/types/src/api.ts:118TestSuiteWithCountAndRuns[]packages/types/src/api.ts:116| Name | Type | Description |
|---|---|---|
action | CancelTestRunAction |
| Name | Type | Description |
|---|---|---|
name | string | |
baseUrl | string | |
description | string | |
config | Partial<TestSuiteConfig> | |
isActive | boolean | |
github | TestSuiteGitHubLink | null | Link/unlink a GitHub repo. Pass null to unlink. |
How often a suite's site map is automatically recrawled to discover added/removed pages. 'off' disables automatic recrawls.
'off' | '6h' | '12h' | 'daily' | 'weekly'packages/types/src/config.ts:19Test suite configuration Contains all settings for test execution, crawling, and comparison
| Name | Type | Description |
|---|---|---|
maxPages | number | Discovery crawl settings |
maxDepth | number | |
recrawlInterval | RecrawlInterval | Automatic sitemap recrawl cadence. Defaults to 'daily'. |
viewports | Viewport[] | Screenshot settings |
waitStrategy | string | |
waitTime | number | |
fullPage | boolean | |
customCss | string | Custom CSS injected into each page immediately before the screenshot is taken. Useful for hiding dynamic elements (ads, chat widgets, carousels, timestamps) that cause false-positive visual diffs. Empty string disables. |
threshold | number | Comparison settings |
failureThreshold | number | |
screenshotConcurrency | number | Performance settings |
comparisonConcurrency | number | |
crawlOptions | { followSitemap: boolean; respectRobots: boolean; userAgent: string; timeout: number; } | Advanced crawling options |
Viewport configuration for responsive testing
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
name | string |
Wait strategy options for page loading
'networkidle' | 'domcontentloaded' | 'load'packages/types/src/config.ts:81An approved reference screenshot for a URL/viewport pair.
| Name | Type | Description |
|---|---|---|
id | string | |
testSuiteId | string | |
url | string | |
path | string | null | URL pathname, used to match baselines across hosts (preview vs production). |
viewport | string | |
filePath | string | |
isApproved | boolean | |
createdAt | ISODateString | |
updatedAt | ISODateString |
An immutable record of one approved baseline for a (suite, path, viewport). Appended — never overwritten — every time a baseline is promoted, so a page accrues a full, attributable history. The newest version for a key is the current baseline (mirrored onto the Baseline pointer for the hot read path).
| Name | Type | Description |
|---|---|---|
id | string | |
testSuiteId | string | |
path | string | Host-independent path — canonical page identity. |
url | string | Canonical URL on the suite origin at approval time. |
viewport | string | |
version | number | Monotonic per (testSuiteId, path, viewport), starting at 1. |
filePath | string | S3/CloudFront URL of the approved screenshot. |
source | BaselineSource | |
approvedBy | UserSummary | null | Reviewer who approved this version; null for auto-seeded/legacy entries. |
approvedAt | ISODateString | |
testRunId | string | null | Run the screenshot came from, when applicable. |
pageResultId | string | null | The specific page result promoted, when applicable. |
diffScore | number | null | Diff % versus the version it replaced (null for the first version). |
prNumber | number | null | Set when source === PR_MERGE. |
note | string | null | Optional reviewer note. |
createdAt | ISODateString | |
updatedAt | ISODateString |
A single entry in a page's baseline timeline. Carries the previous version's file so the UI can render before→after without a second request.
| Name | Type | Description |
|---|---|---|
id | string | |
viewport | string | |
version | number | |
filePath | string | "After" — this version's screenshot. |
previousFilePath | string | null | "Before" — the prior version's screenshot for the same viewport. |
previousVersionId | string | null | The prior version's id (for a one-click "compare against previous"). |
source | BaselineSource | |
approvedBy | UserSummary | null | |
approvedAt | ISODateString | |
diffScore | number | null | |
prNumber | number | null | |
testRunId | string | null | |
note | string | null |
Counters describing what the most recent discovery crawl found.
| Name | Type | Description |
|---|---|---|
pagesFound | number | Total pages present in the latest crawl. |
pagesAdded | number | Pages discovered for the first time by the latest crawl. |
pagesRemoved | number | Previously known pages that were missing from the latest crawl. |
| Name | Type | Description |
|---|---|---|
totalTestSuites | number | |
recentTestRuns | TestRunWithSuite[] | |
runningTests | number |
A GitHub App installation that has granted this app access to repos.
| Name | Type | Description |
|---|---|---|
id | string | |
installationId | number | |
accountLogin | string | |
accountType | string | null | |
repos | string[] | |
createdAt | ISODateString | |
updatedAt | ISODateString |
A repo selectable when linking a suite (from the installation's repo list).
| Name | Type | Description |
|---|---|---|
owner | string | |
repo | string | |
fullName | string | |
private | boolean |
Record<string, PageResult[]>packages/types/src/entities.ts:388ISO-8601 timestamp string (e.g. "2026-06-02T10:00:00.000Z").
stringpackages/types/src/entities.ts:25The current baseline for one viewport, summarised for the page detail view.
| Name | Type | Description |
|---|---|---|
viewport | string | |
version | number | |
filePath | string | |
approvedBy | UserSummary | null | |
approvedAt | ISODateString | |
source | BaselineSource |
Summary of how a page fared in the most recent finished manual run, aggregated across viewports (worst status wins).
| Name | Type | Description |
|---|---|---|
testRunId | string | |
status | ResultStatus | Worst status across the page's viewports in that run. |
diffScore | number | null | Highest diff score across viewports (percentage), when compared. |
viewports | Record<string, ResultStatus> | Per-viewport statuses, e.g. { Desktop: 'PASS', Mobile: 'FAIL' }. |
The comparison outcome for one URL at one viewport within a run.
| Name | Type | Description |
|---|---|---|
id | string | |
testRunId | string | |
url | string | |
path | string | null | URL pathname (host-independent), used to match baselines across hosts. |
viewport | string | |
status | ResultStatus | |
approved | boolean | True once a reviewer approved this result's current image (PR runs). |
approvedById | string | null | Reviewer (user id) who approved this result in-app, if any. |
approvedAt | ISODateString | null | When the result was approved in-app. |
isNew | boolean | True when no baseline existed yet (PR/BRANCH runs report a new page). |
currentFile | string | null | |
baselineFile | string | null | |
diffFile | string | null | |
diffScore | number | null | |
error | string | null | Detailed error message when status is ERROR. |
createdAt | ISODateString | |
updatedAt | ISODateString |
A page discovered on a suite's site by the discovery crawl. Unique per (suite, path). `tracked` pages are the ones screenshotted/diffed by runs.
| Name | Type | Description |
|---|---|---|
id | string | |
testSuiteId | string | |
url | string | Full URL on the suite's own host. |
path | string | Host-independent pathname + search — the canonical identity of the page. |
title | string | null | <title> captured during discovery, when available. |
status | PageStatus | |
tracked | boolean | Whether this page is selected for visual diffing. |
firstSeenAt | ISODateString | |
lastSeenAt | ISODateString | |
removedAt | ISODateString | null | Set when the page went missing from a crawl (status === REMOVED). |
createdAt | ISODateString | |
updatedAt | ISODateString |
A site page enriched with its latest diff outcome for the pages view.
| Name | Type | Description |
|---|---|---|
latestResult | PageLatestResult | null |
The state of a suite's site-discovery crawl (stored on the suite).
| Name | Type | Description |
|---|---|---|
status | CrawlStatus | |
lastCrawledAt | ISODateString | null | |
lastStats | CrawlStats | null | |
error | string | null | Populated when status === FAILED. |
A single execution of a test suite.
| Name | Type | Description |
|---|---|---|
id | string | |
testSuiteId | string | |
status | RunStatus | |
runType | RunType | What triggered this run. Defaults to MANUAL. |
git | TestRunGitContext | null | Git/PR context — present for PR and BRANCH runs. |
reviewState | VisualReviewState | Visual review gate state (drives the GitHub check for PR runs). |
startedAt | ISODateString | null | |
endedAt | ISODateString | null | |
metadata | TestRunMetadata | null | |
createdAt | ISODateString | |
updatedAt | ISODateString |
| Name | Type | Description |
|---|---|---|
testSuite | TestSuite | null | |
pageResults | PageResult[] |
Git/PR context attached to a PR- or branch-triggered run.
| Name | Type | Description |
|---|---|---|
prNumber | number | |
headSha | string | |
branch | string | |
baseBranch | string | |
previewUrl | string | |
checkRunId | number | GitHub Check Run id created for the PR's head SHA. |
installationId | number | |
enqueued | boolean | Guard flag: set once the run has been enqueued (prevents double-enqueue). |
A single structured log line emitted during a run.
| Name | Type | Description |
|---|---|---|
id | string | |
testRunId | string | |
type | LogType | |
message | string | |
metadata | Record<string, unknown> | null | |
progress | number | null | |
timestamp | ISODateString | |
createdAt | ISODateString |
Aggregated counters recorded when a run finishes.
| Name | Type | Description |
|---|---|---|
totalPages | number | |
totalScreenshots | number | |
passedTests | number | |
failedTests | number | |
errorTests | number | |
error | string | |
cancelledAt | ISODateString | |
reason | string |
| Name | Type | Description |
|---|---|---|
total | number | |
passed | number | |
failed | number | |
errors | number | |
pending | number |
| Name | Type | Description |
|---|---|---|
pageResults | PageResult[] |
| Name | Type | Description |
|---|---|---|
testSuite | TestSuiteSummary | null | |
_count | { pageResults: number } |
A configured site/test target.
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
baseUrl | string | |
description | string | null | |
kind | TestSuiteKind | SUITE (default) for crawl-based suites; MANUAL for lightweight single-URL quick-test buckets that skip discovery. Both share the run/diff pipeline. |
config | Partial<TestSuiteConfig> | |
userId | string | |
isActive | boolean | |
github | TestSuiteGitHubLink | null | Linked GitHub repo enabling PR visual-regression checks (optional). |
crawl | SuiteCrawlState | null | Site-discovery crawl state. |
createdAt | ISODateString | |
updatedAt | ISODateString |
| Name | Type | Description |
|---|---|---|
testRuns | TestRun[] | |
baselines | Baseline[] |
Link between a test suite and a GitHub repository (one suite ↔ one repo).
| Name | Type | Description |
|---|---|---|
owner | string | |
repo | string | |
installationId | number | |
checkContext | string | Optional override for the Check Run name; defaults to the server's CHECK_NAME. |
Minimal suite info embedded in run responses.
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
baseUrl | string |
| Name | Type | Description |
|---|---|---|
_count | { testRuns: number } |
| Name | Type | Description |
|---|---|---|
_count | { testRuns: number } | |
testRuns | TestRun[] |
| Name | Type | Description |
|---|---|---|
testRuns | TestRun[] |
| Name | Type | Description |
|---|---|---|
passed | number | |
failed | number | |
errors | number | |
pending | number |
Authenticated user, safe for client exposure (never includes password).
| Name | Type | Description |
|---|---|---|
id | string | |
email | string | |
name | string | null | |
image | string | null | |
createdAt | ISODateString | |
updatedAt | ISODateString |
Minimal user shape for attribution (who approved a baseline, etc.) — embedded in history responses so the UI can show a name without a separate lookup.
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | null | |
email | string | null | |
image | string | null |
How an approved baseline came to exist. Stored on each immutable BaselineVersion so a page's history reads as a meaningful audit trail. - INITIAL: first screenshot captured for a page/viewport (new page, no prior baseline) — auto-seeded, no human approver. - MANUAL: approved from a MANUAL run in-app. - BRANCH: approved from a BRANCH diff in-app. - PR_MERGE: promoted when a linked GitHub PR merged. - API: promoted via the baselines API directly.
| Name | Type | Description |
|---|---|---|
INITIAL | 'INITIAL' | |
MANUAL | 'MANUAL' | |
BRANCH | 'BRANCH' | |
PR_MERGE | 'PR_MERGE' | |
API | 'API' |
Status of a suite's site-discovery crawl.
| Name | Type | Description |
|---|---|---|
IDLE | 'IDLE' | |
QUEUED | 'QUEUED' | |
CRAWLING | 'CRAWLING' | |
COMPLETED | 'COMPLETED' | |
FAILED | 'FAILED' |
Test run log message type
| Name | Type | Description |
|---|---|---|
INFO | 'INFO' | |
WARNING | 'WARNING' | |
ERROR | 'ERROR' | |
SUCCESS | 'SUCCESS' | |
PROGRESS | 'PROGRESS' | |
DEBUG | 'DEBUG' | |
SYSTEM | 'SYSTEM' |
Lifecycle status of a discovered site page. - NEW: discovered by a recrawl and not yet reviewed by the user. - ACTIVE: known page, present in the latest crawl. - REMOVED: previously discovered but missing from the latest crawl.
| Name | Type | Description |
|---|---|---|
NEW | 'NEW' | |
ACTIVE | 'ACTIVE' | |
REMOVED | 'REMOVED' |
Page comparison result status
| Name | Type | Description |
|---|---|---|
PENDING | 'PENDING' | |
PASS | 'PASS' | |
FAIL | 'FAIL' | |
ERROR | 'ERROR' | |
CANCELLED | 'CANCELLED' |
Test run EXECUTION status — answers "did the worker do its job?", nothing more. Visual differences do NOT make a run FAILED; that is tracked separately by VisualReviewState. A run that finished but has diffs is COMPLETED. - PENDING/RUNNING: in flight. - COMPLETED: the worker finished, whether or not diffs were found. - FAILED: genuine execution failure (worker threw, or every page errored). - CANCELLED: cancelled by the user.
| Name | Type | Description |
|---|---|---|
PENDING | 'PENDING' | |
RUNNING | 'RUNNING' | |
COMPLETED | 'COMPLETED' | |
FAILED | 'FAILED' | |
CANCELLED | 'CANCELLED' |
What triggered a test run. - MANUAL: started from the dashboard against the suite's own baseUrl. - PR: triggered by a GitHub pull request, run against its Vercel preview. - BRANCH: an ad-hoc branch/preview diff started from the dashboard.
| Name | Type | Description |
|---|---|---|
MANUAL | 'MANUAL' | |
PR | 'PR' | |
BRANCH | 'BRANCH' |
Distinguishes a full crawl-based test suite from a lightweight manual-run bucket. Stored on TestSuite so both share one run/baseline/diff pipeline. - SUITE: the standard suite — discovers pages via a sitemap crawl, the user tracks pages, and runs diff every tracked page. - MANUAL: a quick single-URL bucket. No crawl/sitemap ceremony — the URL is added directly as a tracked page so it can be screenshotted and re-tested over time against the first run's baseline.
| Name | Type | Description |
|---|---|---|
SUITE | 'SUITE' | |
MANUAL | 'MANUAL' |
Visual review gate for a run — the "have the visual changes been reviewed?" axis, kept separate from RunStatus (the "did the run execute?" axis). Applies to ALL run types: a run that finished but has diffs is COMPLETED with a PENDING gate, not FAILED. - NOT_REQUIRED: nothing to review — all pages passed, or only new pages were captured (no diffs). - PENDING: one or more changed pages awaiting approval. For PR runs this also blocks the GitHub check. - APPROVED: there were changes and they have all been approved. For MANUAL/BRANCH the baselines were updated immediately; for PR the GitHub check is unblocked and baselines promote on merge.
| Name | Type | Description |
|---|---|---|
NOT_REQUIRED | 'NOT_REQUIRED' | |
PENDING | 'PENDING' | |
APPROVED | 'APPROVED' |