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/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/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/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/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/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/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/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
Required — VIEWER
Status
200
Query
{ suiteId?: string; path?: string; viewport?: string }
Returns
BaselineVersionsListResponse
apps/api/src/routes/baselineVersions.ts:48
GET/baseline-versions/:id

Get one baseline version.

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

Auth
Required — VIEWER
Status
200
Params
{ id: string }
Returns
BaselineVersion
apps/api/src/routes/baselineVersions.ts:83
POST/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 and belong to the same test suite.

Auth
Required — VIEWER
Status
200
Body
CompareBaselinesInput
Returns
CompareBaselinesResponse
apps/api/src/routes/baselineVersions.ts:108

baselines

GET/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
Required — VIEWER
Status
200
Query
{ testSuiteId?: string }
Returns
BaselinesListResponse
apps/api/src/routes/baselines.ts:48
DELETE/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
Required — EDITOR
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/baselines.ts:94
GET/baselines/:id

Get one current baseline.

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

Auth
Required — VIEWER
Status
200
Params
{ id: string }
Returns
BaselineResponse
apps/api/src/routes/baselines.ts:71
POST/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 — APPROVER
Status
200
Params
{ id: string }
Returns
MessageResponse
apps/api/src/routes/baselines.ts:125

integrations

GET/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
Required
Status
200
Query
{ sync?: string }
Returns
GitHubInstallationsResponse
apps/api/src/routes/integrations.ts:77
GET/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
Required
Status
200
Params
{ installationId: string }
Returns
GitHubReposResponse
apps/api/src/routes/integrations.ts:125
POST/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
Required
Status
200
Returns
GitHubInstallationsResponse
apps/api/src/routes/integrations.ts:101
GET/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
Required
Status
200
Returns
GitHub status payload
apps/api/src/routes/integrations.ts:35

internal

GET/internal/cron/recrawl

Scan for suites due for a scheduled recrawl and enqueue them.

Scan for suites due for a scheduled recrawl and enqueue them. Wired to a Vercel Cron (hourly). Locally: `curl -H 'x-vercel-cron: 1' ...`.

Auth
Cron secret or Vercel Cron header
Status
200
Returns
{ enqueued: number }
apps/api/src/routes/internal.ts:40

manual-runs

GET/manual-runs

List manual-run buckets.

List manual-run buckets. Returns lightweight single-URL buckets with run counts and their latest run, newest first. Only buckets the caller owns or has been granted access to are returned — scoped exactly like `GET /test-suites`.

Auth
Required
Status
200
Returns
ManualRunsListResponse
apps/api/src/routes/manualRuns.ts:102
POST/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. The caller becomes the owner and holds an implicit, non-removable ADMIN role on the bucket.

Auth
Required
Status
201
Body
CreateManualRunInput
Returns
CreateManualRunResponse
apps/api/src/routes/manualRuns.ts:156
DELETE/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, every access grant on it, and then the bucket itself.

Auth
Required — ADMIN
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/manualRuns.ts:279
GET/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
Required — VIEWER
Status
200
Params
{ id: string }
Returns
ManualRunResponse
apps/api/src/routes/manualRuns.ts:217
POST/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
Required — EDITOR
Status
202
Params
{ id: string }
Returns
RunManualRunResponse
apps/api/src/routes/manualRuns.ts:255

test-runs

GET/test-runs

List test runs with pagination.

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

Auth
Required — VIEWER
Status
200
Query
ListTestRunsParams
Returns
TestRunsListResponse
apps/api/src/routes/testRuns.ts:68
DELETE/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
Required — EDITOR
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/testRuns.ts:205
GET/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
Required — VIEWER
Status
200
Params
{ id: string }
Returns
TestRunResponse
apps/api/src/routes/testRuns.ts:130
PATCH/test-runs/:id

Update a running test run.

Update a running test run. Currently supports the `cancel` action, which marks the run as cancelled. In-flight job runners check status and stop when they see CANCELLED.

Auth
Required — EDITOR
Status
200
Params
{ id: string }
Body
UpdateTestRunInput
Returns
MessageResponse with the updated test run
apps/api/src/routes/testRuns.ts:164
POST/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 — APPROVER
Status
200
Params
{ id: string }
Returns
ApproveVisualsResponse
apps/api/src/routes/testRuns.ts:229
GET/test-runs/:id/logs

List stored logs for a test run.

List stored logs for a test run. Returns structured log entries in timestamp order. Pass `after` (ISO timestamp) to fetch only newer lines for incremental polling.

Auth
Required — VIEWER
Status
200
Params
{ id: string }
Query
{ limit?: string; after?: string }
Returns
TestRunLogsResponse
apps/api/src/routes/testRuns.ts:341
POST/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
Required — APPROVER
Status
200
Params
{ id: string }
Body
RerunPageInput
Returns
RerunPageResponse
apps/api/src/routes/testRuns.ts:279

test-suites

GET/test-suites

List the caller's test suites with run counts and latest run.

List the caller's test suites with run counts and latest run. Only suites the caller owns or has been granted access to are returned; `scope` narrows that to just owned or just shared-with-me. Crawl-based suites are returned by default — pass `kind=MANUAL` for the lightweight manual-run buckets instead.

Auth
Required
Status
200
Query
ListTestSuitesParams
Returns
TestSuitesListResponse
apps/api/src/routes/testSuites.ts:123
POST/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. The creator becomes the owner and holds an implicit, non-removable ADMIN role on the suite.

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

Delete a test suite.

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

Auth
Required — ADMIN
Status
204
Params
{ id: string }
Returns
Empty response
apps/api/src/routes/testSuites.ts:334
GET/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
Required — VIEWER
Status
200
Params
{ id: string }
Returns
TestSuiteResponse
apps/api/src/routes/testSuites.ts:234
PUT/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. Requires EDITOR, except for linking or unlinking a GitHub repo, which is an ADMIN action — it changes who the suite reports to outside the app.

Auth
Required — EDITOR (ADMIN to change the GitHub link)
Status
200
Params
{ id: string }
Body
UpdateTestSuiteInput
Returns
TestSuite
apps/api/src/routes/testSuites.ts:276
GET/test-suites/:id/access

List who a suite is shared with.

List who a suite is shared with. Returns the owner separately (they hold an implicit ADMIN that has no grant row), every grant, and the caller's own access so the UI knows whether to render the management controls at all.

Auth
Required — VIEWER
Status
200
Params
{ id: string }
Returns
TestSuiteAccessResponse
apps/api/src/routes/testSuites.ts:773
POST/test-suites/:id/access

Share a suite with a person (or, once teams ship, a team).

Share a suite with a person (or, once teams ship, a team). Identify the grantee by `email` or `userId`; the account must already exist. Re-sharing with someone who already has a grant updates their role rather than failing, so the UI can use one code path for both.

Auth
Required — ADMIN
Status
201
Params
{ id: string }
Body
ShareTestSuiteInput
Returns
TestSuiteGrantResponse
apps/api/src/routes/testSuites.ts:809
DELETE/test-suites/:id/access/:grantId

Revoke a share.

Revoke a share. The owner has no grant row, so this can never remove the owner's access.

Auth
Required — ADMIN
Status
204
Params
{ id: string; grantId: string }
Returns
Empty response
apps/api/src/routes/testSuites.ts:922
PATCH/test-suites/:id/access/:grantId

Change the role on an existing share.

Auth
Required — ADMIN
Status
200
Params
{ id: string; grantId: string }
Body
UpdateTestSuiteGrantInput
Returns
TestSuiteGrantResponse
apps/api/src/routes/testSuites.ts:880
POST/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
Required — EDITOR
Status
202
Params
{ id: string }
Returns
CrawlSiteResponse
apps/api/src/routes/testSuites.ts:368
GET/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
Required — VIEWER
Status
200
Params
{ id: string }
Returns
SitePagesResponse
apps/api/src/routes/testSuites.ts:406
PATCH/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
Required — EDITOR
Status
200
Params
{ id: string }
Body
SitePageBulkActionInput
Returns
SitePageBulkActionResponse
apps/api/src/routes/testSuites.ts:634
GET/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
Required — VIEWER
Status
200
Params
{ id: string; pageId: string }
Returns
PageDetailResponse
apps/api/src/routes/testSuites.ts:476
GET/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
Required — VIEWER
Status
200
Params
{ id: string; pageId: string }
Query
{ viewport?: string }
Returns
PageHistoryResponse
apps/api/src/routes/testSuites.ts:562
POST/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
Required — EDITOR
Status
202
Params
{ id: string }
Body
RunTestSuiteInput
Returns
RunTestSuiteResponse
apps/api/src/routes/testSuites.ts:717

webhooks

POST/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/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