API Docs

Routes

Generated from Fastify route registrations and route JSDoc blocks.
Generated from Fastify registrations in apps/api/src/routes. Edit the JSDoc block above a route to update its public API copy.

auth

POST/api/auth/forgot-password

Request a password reset link.

Request a password reset link. Creates a short-lived reset token when the email exists. The response is intentionally generic so callers cannot discover registered emails.

Auth
None
Status
200
Body
ForgotPasswordInput
Returns
MessageResponse
apps/api/src/routes/auth.ts:142
POST/api/auth/login

Sign in with email and password.

Sign in with email and password. Sets the same httpOnly session cookie used by the web app and returns the authenticated user payload.

Auth
None
Status
200
Body
LoginInput
Returns
AuthResponse
apps/api/src/routes/auth.ts:79
POST/api/auth/logout

Clear the current session cookie.

Clear the current session cookie. Use this from the browser when a user signs out. It is safe to call even when the cookie is already missing.

Auth
None
Status
200
Returns
MessageResponse
apps/api/src/routes/auth.ts:104
GET/api/auth/me

Return the current signed-in user.

Return the current signed-in user. Reads the JWT from the session cookie and returns the browser-safe user shape used to hydrate the dashboard session.

Auth
Required
Status
200
Returns
MeResponse
apps/api/src/routes/auth.ts:124
POST/api/auth/register

Create an account and sign the user in.

Create an account and sign the user in. Stores a password-based user, sets the session cookie and returns the safe user payload with a JWT for non-browser clients.

Auth
None
Status
201
Body
RegisterInput
Returns
AuthResponse
apps/api/src/routes/auth.ts:53
POST/api/auth/reset-password

Reset a password with a valid reset token.

Reset a password with a valid reset token. Verifies the token, stores the new password hash and consumes the token so it cannot be reused.

Auth
None
Status
200
Body
ResetPasswordInput
Returns
MessageResponse
apps/api/src/routes/auth.ts:184

baseline-versions

GET/api/baseline-versions

List baseline versions for a page.

List baseline versions for a page. Returns immutable baseline history entries newest first. Pass a viewport to narrow the list for compare dropdowns.

Auth
None
Status
200
Query
{ suiteId?: string; path?: string; viewport?: string }
Returns
BaselineVersionsListResponse
apps/api/src/routes/baselineVersions.ts:37
GET/api/baseline-versions/:id

Get one baseline version.

Get one baseline version. Returns a single immutable baseline history entry, including reviewer attribution when available.

Auth
None
Status
200
Params
{ id: string }
Returns
BaselineVersion
apps/api/src/routes/baselineVersions.ts:69
POST/api/baseline-versions/compare

Compare any two baseline versions.

Compare any two baseline versions. Generates an on-demand diff image between immutable versions. The versions must use the same viewport.

Auth
None
Status
200
Body
CompareBaselinesInput
Returns
CompareBaselinesResponse
apps/api/src/routes/baselineVersions.ts:92

baselines

GET/api/baselines

List current baselines for a test suite.

List current baselines for a test suite. Returns the approved baseline pointer documents, newest first. Use baseline versions when you need the full approval history.

Auth
None
Status
200
Query
{ testSuiteId?: string }
Returns
BaselinesListResponse
apps/api/src/routes/baselines.ts:37
DELETE/api/baselines/:id

Delete a baseline and its screenshot file.

Delete a baseline and its screenshot file. Removes the database document and best-effort deletes the referenced image file. Missing files are logged but do not block the delete.

Auth
None
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/baselines.ts:77
GET/api/baselines/:id

Get one current baseline.

Get one current baseline. Fetches the current approved screenshot pointer by baseline id.

Auth
None
Status
200
Params
{ id: string }
Returns
BaselineResponse
apps/api/src/routes/baselines.ts:56
POST/api/baselines/:id/approve

Approve one changed page result.

Approve one changed page result. The id is a PageResult id. Manual and branch runs promote the current screenshot immediately; PR runs mark the change accepted for merge-time promotion.

Auth
Required
Status
200
Params
{ id: string }
Returns
MessageResponse
apps/api/src/routes/baselines.ts:106

integrations

GET/api/integrations/github/installations

List GitHub App installations.

List GitHub App installations. Best-effort reconciles live installation data from GitHub unless `sync=0` is passed, then returns the stored installation list.

Auth
None
Status
200
Query
{ sync?: string }
Returns
GitHubInstallationsResponse
apps/api/src/routes/integrations.ts:70
GET/api/integrations/github/installations/:installationId/repos

List repositories for one GitHub App installation.

List repositories for one GitHub App installation. Reads live repository access from GitHub so the suite-linking UI can show the repos available to that installation.

Auth
None
Status
200
Params
{ installationId: string }
Returns
GitHubReposResponse
apps/api/src/routes/integrations.ts:118
POST/api/integrations/github/installations/sync

Force a GitHub installation sync.

Force a GitHub installation sync. Calls GitHub for the current installation list, stores it locally and returns the refreshed records.

Auth
None
Status
200
Returns
GitHubInstallationsResponse
apps/api/src/routes/integrations.ts:94
GET/api/integrations/github/status

Get GitHub App integration status.

Get GitHub App integration status. Tells the UI whether the app is configured, where to install it and which Check Run name viz will report.

Auth
None
Status
200
Returns
GitHub status payload
apps/api/src/routes/integrations.ts:28

manual-runs

GET/api/manual-runs

List manual-run buckets.

List manual-run buckets. Returns lightweight single-URL buckets with run counts and their latest run, newest first.

Auth
None
Status
200
Returns
ManualRunsListResponse
apps/api/src/routes/manualRuns.ts:73
POST/api/manual-runs

Create a manual-run bucket and start its first run.

Create a manual-run bucket and start its first run. Adds the supplied URL as the only tracked page. The first run captures the initial approved baseline for later comparisons.

Auth
Optional
Status
201
Body
CreateManualRunInput
Returns
CreateManualRunResponse
apps/api/src/routes/manualRuns.ts:106
DELETE/api/manual-runs/:id

Delete a manual-run bucket and its related data.

Delete a manual-run bucket and its related data. Removes page results, runs, tracked page records, baselines and then the bucket itself.

Auth
None
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/manualRuns.ts:221
GET/api/manual-runs/:id

Get a manual-run bucket with recent runs and baselines.

Get a manual-run bucket with recent runs and baselines. Manual-run buckets are stored as TestSuite documents with `kind: MANUAL`.

Auth
None
Status
200
Params
{ id: string }
Returns
ManualRunResponse
apps/api/src/routes/manualRuns.ts:166
POST/api/manual-runs/:id/run

Start another run for a manual-run bucket.

Start another run for a manual-run bucket. Re-tests the bucket's single URL and compares it with the baseline captured by the first run.

Auth
None
Status
202
Params
{ id: string }
Returns
RunManualRunResponse
apps/api/src/routes/manualRuns.ts:197

test-runs

GET/api/test-runs

List test runs with pagination.

List test runs with pagination. Returns recent runs, optionally filtered by suite or run status, with a small suite summary and page-result count for list screens.

Auth
None
Status
200
Query
ListTestRunsParams
Returns
TestRunsListResponse
apps/api/src/routes/testRuns.ts:51
DELETE/api/test-runs/:id

Delete a test run.

Delete a test run. Removes the TestRun document. Related screenshots and page results are not cleaned up by this endpoint.

Auth
None
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/testRuns.ts:178
GET/api/test-runs/:id

Get a test run with its suite and page results.

Get a test run with its suite and page results. Powers the run detail screen, including per-page screenshot, baseline and diff data.

Auth
None
Status
200
Params
{ id: string }
Returns
TestRunResponse
apps/api/src/routes/testRuns.ts:97
PATCH/api/test-runs/:id

Update a running test run.

Update a running test run. Currently supports the `cancel` action, which removes the queued job when possible and marks the run as cancelled.

Auth
None
Status
200
Params
{ id: string }
Body
UpdateTestRunInput
Returns
MessageResponse with the updated test run
apps/api/src/routes/testRuns.ts:129
POST/api/test-runs/:id/approve-visuals

Approve every changed page in a run.

Approve every changed page in a run. Manual and branch runs promote baselines immediately. PR runs mark changes accepted and unblock the GitHub Check Run; promotion happens on merge.

Auth
Required
Status
200
Params
{ id: string }
Returns
ApproveVisualsResponse
apps/api/src/routes/testRuns.ts:199
GET/api/test-runs/:id/logs

List stored logs for a test run.

List stored logs for a test run. Returns historical structured log entries in timestamp order. Live updates are streamed separately over Socket.io.

Auth
None
Status
200
Params
{ id: string }
Query
{ limit?: string }
Returns
TestRunLogsResponse
apps/api/src/routes/testRuns.ts:315
POST/api/test-runs/:id/rerun

Re-run errored viewports for one page.

Re-run errored viewports for one page. Targets only ERROR-status results for the supplied URL inside an existing finished run, then updates those results in place.

Auth
None
Status
200
Params
{ id: string }
Body
RerunPageInput
Returns
RerunPageResponse
apps/api/src/routes/testRuns.ts:255

test-suites

GET/api/test-suites

List test suites with run counts and latest run.

List test suites with run counts and latest run. Crawl-based suites are returned by default. Pass `kind=MANUAL` to fetch the lightweight manual-run buckets instead.

Auth
None
Status
200
Query
ListTestSuitesParams
Returns
TestSuitesListResponse
apps/api/src/routes/testSuites.ts:91
POST/api/test-suites

Create a crawl-based test suite.

Create a crawl-based test suite. Creates the suite, queues the first discovery crawl and registers the automatic recrawl schedule from the suite settings.

Auth
Optional
Status
201
Body
CreateTestSuiteInput
Returns
TestSuite
apps/api/src/routes/testSuites.ts:128
DELETE/api/test-suites/:id

Delete a test suite.

Delete a test suite. Removes the suite, its discovered pages and its repeatable recrawl job. Run and baseline clean-up is handled separately.

Auth
None
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/testSuites.ts:265
GET/api/test-suites/:id

Get a suite with recent runs and current baselines.

Get a suite with recent runs and current baselines. Use this for the suite detail screen before drilling into pages or an individual run.

Auth
None
Status
200
Params
{ id: string }
Returns
TestSuiteResponse
apps/api/src/routes/testSuites.ts:183
PUT/api/test-suites/:id

Update a test suite.

Update a test suite. Updates basic settings, active state or GitHub link data. Changing the base URL queues a fresh discovery crawl because the sitemap is stale.

Auth
None
Status
200
Params
{ id: string }
Body
UpdateTestSuiteInput
Returns
TestSuite
apps/api/src/routes/testSuites.ts:215
POST/api/test-suites/:id/crawl

Queue a discovery crawl for a suite.

Queue a discovery crawl for a suite. Starts or restarts page discovery unless a recent crawl is already queued or running.

Auth
None
Status
202
Params
{ id: string }
Returns
CrawlSiteResponse
apps/api/src/routes/testSuites.ts:290
GET/api/test-suites/:id/pages

List discovered pages for a suite.

List discovered pages for a suite. Returns the sitemap view with crawl state, tracked counts and each page's outcome in the most recent finished manual run.

Auth
None
Status
200
Params
{ id: string }
Returns
SitePagesResponse
apps/api/src/routes/testSuites.ts:328
PATCH/api/test-suites/:id/pages

Apply a bulk action to discovered pages.

Apply a bulk action to discovered pages. Tracks, untracks, acknowledges or deletes selected page records within a suite's discovered sitemap.

Auth
None
Status
200
Params
{ id: string }
Body
SitePageBulkActionInput
Returns
SitePageBulkActionResponse
apps/api/src/routes/testSuites.ts:553
GET/api/test-suites/:id/pages/:pageId

Get one discovered page with current baselines.

Get one discovered page with current baselines. Returns the page, its latest per-viewport baselines and its latest manual run outcome for the page detail view.

Auth
None
Status
200
Params
{ id: string; pageId: string }
Returns
PageDetailResponse
apps/api/src/routes/testSuites.ts:398
GET/api/test-suites/:id/pages/:pageId/history

Get baseline history for one discovered page.

Get baseline history for one discovered page. Returns the timeline newest first. Each event includes the previous version where available so the UI can render before and after without another call.

Auth
None
Status
200
Params
{ id: string; pageId: string }
Query
{ viewport?: string }
Returns
PageHistoryResponse
apps/api/src/routes/testSuites.ts:484
POST/api/test-suites/:id/run

Queue a new suite run.

Queue a new suite run. Omit the body for a manual run against the suite base URL, or pass a target preview URL for a branch diff that does not mutate baselines or GitHub.

Auth
None
Status
202
Params
{ id: string }
Body
RunTestSuiteInput
Returns
RunTestSuiteResponse
apps/api/src/routes/testSuites.ts:633

webhooks

POST/api/webhooks/github

Receive GitHub App webhooks.

Receive GitHub App webhooks. Verifies the GitHub HMAC signature, records installation changes and creates or promotes PR visual-regression runs for linked suites.

Auth
Signed webhook
Status
202
Body
GitHub webhook payload
Returns
{ received: true }
apps/api/src/routes/webhooks.ts:271
POST/api/webhooks/vercel

Receive Vercel deployment webhooks.

Receive Vercel deployment webhooks. Verifies the Vercel signature and attaches ready preview deployment URLs to matching PR runs so screenshots can be queued.

Auth
Signed webhook
Status
202
Body
Vercel deployment webhook payload
Returns
{ received: true }
apps/api/src/routes/webhooks.ts:302