API Docs

Contracts

Generated from shared request, response, entity and enum types.
Generated from packages/types/src. These are the payloads shared by the Fastify API and the Next.js app.

packages/types/src/api.ts

interface

ApiError

Standard error body returned by every endpoint on failure.

NameTypeDescription
errorstring
detailsunknown
packages/types/src/api.ts:30
type

ApproveVisualsResponse

Body for POST /test-runs/:id/approve-visuals.

MessageResponse
packages/types/src/api.ts:317
interface

AuthResponse

NameTypeDescription
userUser
tokenstringJWT — also set as an httpOnly cookie; returned for non-browser clients.
packages/types/src/api.ts:70
type

BaselineResponse

Baseline
packages/types/src/api.ts:308
type

BaselinesListResponse

Baseline[]
packages/types/src/api.ts:306
interface

BaselineVersionRef

A version reduced to what the compare result needs to label each side.

NameTypeDescription
idstring
versionnumber
filePathstring
viewportstring
approvedAtISODateString
packages/types/src/api.ts:169
type

BaselineVersionsListResponse

Response of GET /baseline-versions?suiteId=&path=&viewport=

BaselineVersion[]
packages/types/src/api.ts:166
type

CancelTestRunAction

'cancel'
packages/types/src/api.ts:245
interface

CompareBaselinesInput

Body for POST /baseline-versions/compare — diff any two versions.

NameTypeDescription
fromVersionIdstring
toVersionIdstring
packages/types/src/api.ts:178
interface

CompareBaselinesResponse

Response of POST /baseline-versions/compare — an on-demand generated diff.

NameTypeDescription
fromBaselineVersionRef
toBaselineVersionRef
diffFilestringGenerated diff PNG URL.
diffScorenumberSimilarity score, 0–100 (100 = identical).
diffPercentagenumberPercentage of pixels that differ, 0–100.
dimensions{ width: number; height: number }
packages/types/src/api.ts:184
interface

CrawlSiteResponse

Response of POST /test-suites/:id/crawl.

NameTypeDescription
messagestring
packages/types/src/api.ts:219
interface

CreateManualRunInput

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.

NameTypeDescription
urlstringThe single URL to test (full, absolute).
namestringOptional label; defaults to the URL's host + path.
packages/types/src/api.ts:278
interface

CreateManualRunResponse

Response of POST /manual-runs — the created bucket plus its first run id.

NameTypeDescription
manualRunTestSuite
testRunIdstring
packages/types/src/api.ts:293
interface

CreateTestSuiteInput

NameTypeDescription
namestring
baseUrlstring
descriptionstring
configPartial<TestSuiteConfig>
packages/types/src/api.ts:82
interface

ForgotPasswordInput

NameTypeDescription
emailstring
packages/types/src/api.ts:61
type

GitHubInstallationsResponse

GitHubInstallation[]
packages/types/src/api.ts:312
type

GitHubReposResponse

GitHubRepo[]
packages/types/src/api.ts:314
interface

ListTestRunsParams

NameTypeDescription
testSuiteIdstring
statusstring
limitnumber
offsetnumber
packages/types/src/api.ts:225
interface

ListTestSuitesParams

Optional filters for GET /test-suites.

NameTypeDescription
kindTestSuiteKindRestrict to a single kind. Defaults to SUITE-only (manual buckets hidden).
packages/types/src/api.ts:111
interface

LogEventPayload

Payload broadcast to a `test-run-:id` room when a new log line is emitted.

NameTypeDescription
testRunIdstring
logTestRunLog
packages/types/src/api.ts:333
interface

LoginInput

NameTypeDescription
emailstring
passwordstring
packages/types/src/api.ts:50
type

ManualRun

A manual-run bucket is a TestSuite with kind === MANUAL.

TestSuite
packages/types/src/api.ts:286
type

ManualRunResponse

TestSuiteDetail
packages/types/src/api.ts:290
type

ManualRunsListResponse

TestSuiteWithCountAndRuns[]
packages/types/src/api.ts:288
interface

MeResponse

NameTypeDescription
userUser
packages/types/src/api.ts:76
interface

MessageResponse

Generic success message body.

NameTypeDescription
messagestring
packages/types/src/api.ts:36
interface

PageDetailResponse

Response of GET /test-suites/:id/pages/:pageId — a single page with its current per-viewport baselines and latest run outcome.

NameTypeDescription
pageSitePageWithResult
baselinesPageCurrentBaseline[]Current baseline per viewport (latest version of each).
viewportsstring[]Viewports this page has baseline history for.
versionCountnumberTotal baseline versions across all viewports.
packages/types/src/api.ts:143
interface

PageHistoryResponse

Response of GET /test-suites/:id/pages/:pageId/history — the baseline timeline, newest first. Optional ?viewport= filter narrows to one viewport.

NameTypeDescription
page{ id: string; path: string; title?: string | null; url: string }
eventsBaselineVersionEvent[]
viewportsstring[]
packages/types/src/api.ts:157
interface

Pagination

Offset-based pagination envelope.

NameTypeDescription
totalnumber
limitnumber
offsetnumber
hasMoreboolean
packages/types/src/api.ts:41
interface

RegisterInput

NameTypeDescription
emailstring
passwordstring
namestring
packages/types/src/api.ts:55
interface

RerunPageInput

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.

NameTypeDescription
urlstringThe page URL whose errored viewport results should be re-run.
packages/types/src/api.ts:257
interface

RerunPageResponse

Response of POST /test-runs/:id/rerun.

NameTypeDescription
messagestring
testRunIdstring
rerunCountnumberHow many errored viewport results were queued for re-running.
packages/types/src/api.ts:263
interface

ResetPasswordInput

NameTypeDescription
tokenstring
passwordstring
packages/types/src/api.ts:65
interface

RunManualRunResponse

Response of POST /manual-runs/:id/run — re-test the bucket's URL.

NameTypeDescription
messagestring
testRunIdstring
packages/types/src/api.ts:299
interface

RunTestSuiteInput

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.

NameTypeDescription
targetBaseUrlstring
branchstring
runTypeRunType
packages/types/src/api.ts:104
interface

RunTestSuiteResponse

NameTypeDescription
messagestring
testRunIdstring
packages/types/src/api.ts:120
type

SitePageAction

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:197
interface

SitePageBulkActionInput

Body for PATCH /test-suites/:id/pages.

NameTypeDescription
actionSitePageAction
pageIdsstring[]
packages/types/src/api.ts:208
interface

SitePageBulkActionResponse

NameTypeDescription
messagestring
affectednumber
packages/types/src/api.ts:213
interface

SitePagesResponse

Response of GET /test-suites/:id/pages — the combined sitemap view.

NameTypeDescription
pagesSitePageWithResult[]
crawlSuiteCrawlState
counts{ total: number; tracked: number; new: number; removed: number; }
packages/types/src/api.ts:128
type

SocketEvent

(typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS]
packages/types/src/api.ts:330
interface

TestRunLogsResponse

NameTypeDescription
testRunIdstring
logsTestRunLog[]
countnumber
packages/types/src/api.ts:239
type

TestRunResponse

TestRunDetail
packages/types/src/api.ts:237
interface

TestRunsListResponse

NameTypeDescription
testRunsTestRunWithSuite[]
paginationPagination
packages/types/src/api.ts:232
type

TestSuiteResponse

TestSuiteDetail
packages/types/src/api.ts:118
type

TestSuitesListResponse

TestSuiteWithCountAndRuns[]
packages/types/src/api.ts:116
interface

UpdateTestRunInput

NameTypeDescription
actionCancelTestRunAction
packages/types/src/api.ts:247
interface

UpdateTestSuiteInput

NameTypeDescription
namestring
baseUrlstring
descriptionstring
configPartial<TestSuiteConfig>
isActiveboolean
githubTestSuiteGitHubLink | nullLink/unlink a GitHub repo. Pass null to unlink.
packages/types/src/api.ts:89

packages/types/src/config.ts

type

RecrawlInterval

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:19
interface

TestSuiteConfig

Test suite configuration Contains all settings for test execution, crawling, and comparison

NameTypeDescription
maxPagesnumberDiscovery crawl settings
maxDepthnumber
recrawlIntervalRecrawlIntervalAutomatic sitemap recrawl cadence. Defaults to 'daily'.
viewportsViewport[]Screenshot settings
waitStrategystring
waitTimenumber
fullPageboolean
customCssstringCustom 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.
thresholdnumberComparison settings
failureThresholdnumber
screenshotConcurrencynumberPerformance settings
comparisonConcurrencynumber
crawlOptions{ followSitemap: boolean; respectRobots: boolean; userAgent: string; timeout: number; }Advanced crawling options
packages/types/src/config.ts:42
interface

Viewport

Viewport configuration for responsive testing

NameTypeDescription
widthnumber
heightnumber
namestring
packages/types/src/config.ts:9
type

WaitStrategy

Wait strategy options for page loading

'networkidle' | 'domcontentloaded' | 'load'
packages/types/src/config.ts:81

packages/types/src/entities.ts

interface

Baseline

An approved reference screenshot for a URL/viewport pair.

NameTypeDescription
idstring
testSuiteIdstring
urlstring
pathstring | nullURL pathname, used to match baselines across hosts (preview vs production).
viewportstring
filePathstring
isApprovedboolean
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:214
interface

BaselineVersion

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).

NameTypeDescription
idstring
testSuiteIdstring
pathstringHost-independent path — canonical page identity.
urlstringCanonical URL on the suite origin at approval time.
viewportstring
versionnumberMonotonic per (testSuiteId, path, viewport), starting at 1.
filePathstringS3/CloudFront URL of the approved screenshot.
sourceBaselineSource
approvedByUserSummary | nullReviewer who approved this version; null for auto-seeded/legacy entries.
approvedAtISODateString
testRunIdstring | nullRun the screenshot came from, when applicable.
pageResultIdstring | nullThe specific page result promoted, when applicable.
diffScorenumber | nullDiff % versus the version it replaced (null for the first version).
prNumbernumber | nullSet when source === PR_MERGE.
notestring | nullOptional reviewer note.
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:233
interface

BaselineVersionEvent

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.

NameTypeDescription
idstring
viewportstring
versionnumber
filePathstring"After" — this version's screenshot.
previousFilePathstring | null"Before" — the prior version's screenshot for the same viewport.
previousVersionIdstring | nullThe prior version's id (for a one-click "compare against previous").
sourceBaselineSource
approvedByUserSummary | null
approvedAtISODateString
diffScorenumber | null
prNumbernumber | null
testRunIdstring | null
notestring | null
packages/types/src/entities.ts:277
interface

CrawlStats

Counters describing what the most recent discovery crawl found.

NameTypeDescription
pagesFoundnumberTotal pages present in the latest crawl.
pagesAddednumberPages discovered for the first time by the latest crawl.
pagesRemovednumberPreviously known pages that were missing from the latest crawl.
packages/types/src/entities.ts:91
interface

DashboardStats

NameTypeDescription
totalTestSuitesnumber
recentTestRunsTestRunWithSuite[]
runningTestsnumber
packages/types/src/entities.ts:374
interface

GitHubInstallation

A GitHub App installation that has granted this app access to repos.

NameTypeDescription
idstring
installationIdnumber
accountLoginstring
accountTypestring | null
reposstring[]
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:51
interface

GitHubRepo

A repo selectable when linking a suite (from the installation's repo list).

NameTypeDescription
ownerstring
repostring
fullNamestring
privateboolean
packages/types/src/entities.ts:62
type

GroupedPageResults

Record<string, PageResult[]>
packages/types/src/entities.ts:388
type

ISODateString

ISO-8601 timestamp string (e.g. "2026-06-02T10:00:00.000Z").

string
packages/types/src/entities.ts:25
interface

PageCurrentBaseline

The current baseline for one viewport, summarised for the page detail view.

NameTypeDescription
viewportstring
versionnumber
filePathstring
approvedByUserSummary | null
approvedAtISODateString
sourceBaselineSource
packages/types/src/entities.ts:264
interface

PageLatestResult

Summary of how a page fared in the most recent finished manual run, aggregated across viewports (worst status wins).

NameTypeDescription
testRunIdstring
statusResultStatusWorst status across the page's viewports in that run.
diffScorenumber | nullHighest diff score across viewports (percentage), when compared.
viewportsRecord<string, ResultStatus>Per-viewport statuses, e.g. { Desktop: 'PASS', Mobile: 'FAIL' }.
packages/types/src/entities.ts:355
interface

PageResult

The comparison outcome for one URL at one viewport within a run.

NameTypeDescription
idstring
testRunIdstring
urlstring
pathstring | nullURL pathname (host-independent), used to match baselines across hosts.
viewportstring
statusResultStatus
approvedbooleanTrue once a reviewer approved this result's current image (PR runs).
approvedByIdstring | nullReviewer (user id) who approved this result in-app, if any.
approvedAtISODateString | nullWhen the result was approved in-app.
isNewbooleanTrue when no baseline existed yet (PR/BRANCH runs report a new page).
currentFilestring | null
baselineFilestring | null
diffFilestring | null
diffScorenumber | null
errorstring | nullDetailed error message when status is ERROR.
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:187
interface

SitePage

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.

NameTypeDescription
idstring
testSuiteIdstring
urlstringFull URL on the suite's own host.
pathstringHost-independent pathname + search — the canonical identity of the page.
titlestring | null<title> captured during discovery, when available.
statusPageStatus
trackedbooleanWhether this page is selected for visual diffing.
firstSeenAtISODateString
lastSeenAtISODateString
removedAtISODateString | nullSet when the page went missing from a crawl (status === REMOVED).
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:135
interface

SitePageWithResult

A site page enriched with its latest diff outcome for the pages view.

NameTypeDescription
latestResultPageLatestResult | null
packages/types/src/entities.ts:366
interface

SuiteCrawlState

The state of a suite's site-discovery crawl (stored on the suite).

NameTypeDescription
statusCrawlStatus
lastCrawledAtISODateString | null
lastStatsCrawlStats | null
errorstring | nullPopulated when status === FAILED.
packages/types/src/entities.ts:101
interface

TestRun

A single execution of a test suite.

NameTypeDescription
idstring
testSuiteIdstring
statusRunStatus
runTypeRunTypeWhat triggered this run. Defaults to MANUAL.
gitTestRunGitContext | nullGit/PR context — present for PR and BRANCH runs.
reviewStateVisualReviewStateVisual review gate state (drives the GitHub check for PR runs).
startedAtISODateString | null
endedAtISODateString | null
metadataTestRunMetadata | null
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:169
interface

TestRunDetail

NameTypeDescription
testSuiteTestSuite | null
pageResultsPageResult[]
packages/types/src/entities.ts:346
interface

TestRunGitContext

Git/PR context attached to a PR- or branch-triggered run.

NameTypeDescription
prNumbernumber
headShastring
branchstring
baseBranchstring
previewUrlstring
checkRunIdnumberGitHub Check Run id created for the PR's head SHA.
installationIdnumber
enqueuedbooleanGuard flag: set once the run has been enqueued (prevents double-enqueue).
packages/types/src/entities.ts:37
interface

TestRunLog

A single structured log line emitted during a run.

NameTypeDescription
idstring
testRunIdstring
typeLogType
messagestring
metadataRecord<string, unknown> | null
progressnumber | null
timestampISODateString
createdAtISODateString
packages/types/src/entities.ts:297
interface

TestRunMetadata

Aggregated counters recorded when a run finishes.

NameTypeDescription
totalPagesnumber
totalScreenshotsnumber
passedTestsnumber
failedTestsnumber
errorTestsnumber
errorstring
cancelledAtISODateString
reasonstring
packages/types/src/entities.ts:156
interface

TestRunStats

NameTypeDescription
totalnumber
passednumber
failednumber
errorsnumber
pendingnumber
packages/types/src/entities.ts:380
interface

TestRunWithResults

NameTypeDescription
pageResultsPageResult[]
packages/types/src/entities.ts:342
interface

TestRunWithSuite

NameTypeDescription
testSuiteTestSuiteSummary | null
_count{ pageResults: number }
packages/types/src/entities.ts:337
interface

TestSuite

A configured site/test target.

NameTypeDescription
idstring
namestring
baseUrlstring
descriptionstring | null
kindTestSuiteKindSUITE (default) for crawl-based suites; MANUAL for lightweight single-URL quick-test buckets that skip discovery. Both share the run/diff pipeline.
configPartial<TestSuiteConfig>
userIdstring
isActiveboolean
githubTestSuiteGitHubLink | nullLinked GitHub repo enabling PR visual-regression checks (optional).
crawlSuiteCrawlState | nullSite-discovery crawl state.
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:110
interface

TestSuiteDetail

NameTypeDescription
testRunsTestRun[]
baselinesBaseline[]
packages/types/src/entities.ts:325
interface

TestSuiteGitHubLink

Link between a test suite and a GitHub repository (one suite ↔ one repo).

NameTypeDescription
ownerstring
repostring
installationIdnumber
checkContextstringOptional override for the Check Run name; defaults to the server's CHECK_NAME.
packages/types/src/entities.ts:28
interface

TestSuiteSummary

Minimal suite info embedded in run responses.

NameTypeDescription
idstring
namestring
baseUrlstring
packages/types/src/entities.ts:331
interface

TestSuiteWithCount

NameTypeDescription
_count{ testRuns: number }
packages/types/src/entities.ts:312
interface

TestSuiteWithCountAndRuns

NameTypeDescription
_count{ testRuns: number }
testRunsTestRun[]
packages/types/src/entities.ts:320
interface

TestSuiteWithRuns

NameTypeDescription
testRunsTestRun[]
packages/types/src/entities.ts:316
interface

UrlStats

NameTypeDescription
passednumber
failednumber
errorsnumber
pendingnumber
packages/types/src/entities.ts:390
interface

User

Authenticated user, safe for client exposure (never includes password).

NameTypeDescription
idstring
emailstring
namestring | null
imagestring | null
createdAtISODateString
updatedAtISODateString
packages/types/src/entities.ts:70
interface

UserSummary

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.

NameTypeDescription
idstring
namestring | null
emailstring | null
imagestring | null
packages/types/src/entities.ts:83

packages/types/src/enums.ts

enum

BaselineSource

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.

NameTypeDescription
INITIAL'INITIAL'
MANUAL'MANUAL'
BRANCH'BRANCH'
PR_MERGE'PR_MERGE'
API'API'
packages/types/src/enums.ts:89
enum

CrawlStatus

Status of a suite's site-discovery crawl.

NameTypeDescription
IDLE'IDLE'
QUEUED'QUEUED'
CRAWLING'CRAWLING'
COMPLETED'COMPLETED'
FAILED'FAILED'
packages/types/src/enums.ts:112
enum

LogType

Test run log message type

NameTypeDescription
INFO'INFO'
WARNING'WARNING'
ERROR'ERROR'
SUCCESS'SUCCESS'
PROGRESS'PROGRESS'
DEBUG'DEBUG'
SYSTEM'SYSTEM'
packages/types/src/enums.ts:123
enum

PageStatus

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.

NameTypeDescription
NEW'NEW'
ACTIVE'ACTIVE'
REMOVED'REMOVED'
packages/types/src/enums.ts:103
enum

ResultStatus

Page comparison result status

NameTypeDescription
PENDING'PENDING'
PASS'PASS'
FAIL'FAIL'
ERROR'ERROR'
CANCELLED'CANCELLED'
packages/types/src/enums.ts:26
enum

RunStatus

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.

NameTypeDescription
PENDING'PENDING'
RUNNING'RUNNING'
COMPLETED'COMPLETED'
FAILED'FAILED'
CANCELLED'CANCELLED'
packages/types/src/enums.ts:15
enum

RunType

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.

NameTypeDescription
MANUAL'MANUAL'
PR'PR'
BRANCH'BRANCH'
packages/types/src/enums.ts:40
enum

TestSuiteKind

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.

NameTypeDescription
SUITE'SUITE'
MANUAL'MANUAL'
packages/types/src/enums.ts:55
enum

VisualReviewState

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.

NameTypeDescription
NOT_REQUIRED'NOT_REQUIRED'
PENDING'PENDING'
APPROVED'APPROVED'
packages/types/src/enums.ts:73