Happo exposes a public, REST-like, API that you can use to create or enhance custom integrations. The API resides at https://happo.io, and all endpoints use the /api namespace.
Want to use Happo from Claude, ChatGPT, Cursor, or another AI assistant? Happo also runs an MCP server with OAuth so AI agents can list comparisons, inspect diffs, and accept, reject, or report flakes for them.
Authentication
All API endpoints are auth protected. To successfully issue a command, you need to provide an authentication header with your request. There are two ways to authenticate. JWT authentication is more secure but can be a little tricky to set up. HTTP Basic authentication is a less secure alternative, but is a good option if you want a simpler setup.
Basic authentication
With Basic authentication, you provide an Authorization: Basic <token> header where the token is a base64 encoded string of your apiKey:apiSecret tokens.
JWT authentication
This auth token is a JSON web token generated based on your API key and API secret. Pass { key: <your API key> } as the payload of the JWT call and the API secret as the secret, and set a kid header equal to the API key. Pass the resulting token as a Authorization: Bearer <generated token> header in all API requests.
An example of how to construct the JWT token can be found in the source code for the happo.io client.
Endpoints
Here's a full list of API paths you can call. All endpoints speak JSON. Body params are sent as a JSON blob in the body of the request. Responses are sent as JSON in the body of the HTTP response.
Reports
Create report
POST /
Uploads a list of snapshots for a certain identifier (usually a commit sha). If there is an existing report for the same sha, it will be overwritten as a result of calling this endpoint, unless you're posting partial reports.
URL params
:shaStringThe id of the report.
Body params
snapsArray<Snapshot>A list of snapshot objects associated with the report
projectoptional StringThe identifying name of the project this report should belong to. If none is specified, the default project will be used.
linkoptional StringURL to the source of the report (e.g. PR URL).
messageoptional StringA short string describing the source of the report (e.g. PR title).
partialoptional BooleanSet this to true to amend the report instead of overwriting it. This is useful if you are running multiple processes for the same sha. Remember to call the Complete Report endpoint once you are done uploading all the partials, otherwise the report will never be fully constructed and useful.
Response
jsonReportStatusAn object containing a url where the uploaded report can be accessed
Error responses
400The snapshot data is invalid (e.g. missing required fields), or the report has been archived and can no longer be modified.
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get report
GET /
Gets a list of snapshots for a certain identifier (usually a commit sha).
URL params
:shaStringThe id of the report.
Query params
projectoptional StringThe identifying name of the project this report belongs to. If none is specified, the default project will be assumed.
Response
jsonArray<Snapshot>A list of snapshots associated with this sha.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No report found for the given sha and project.
Get report status
GET /
Gets some metadata about a report.
To fetch status for multiple projects in one request, pass a comma-separated
list of project names in the projects query parameter:
GET /api/reports/abc123/status?projects=web,mobile,ios
The response is an array with one entry per project, in the same order as the
input. If no report exists for a given project the entry will contain an
error field instead of the usual status fields:
[
{
"project": "web",
"url": "https://happo.io/a/1/p/2/report/abc123",
"snapshotCount": 42,
"completedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:00:00.000Z"
},
{
"project": "mobile",
"error": "report not found"
},
{
"project": "ios",
"url": "https://happo.io/a/1/p/4/report/abc123",
"snapshotCount": 18,
"completedAt": "2024-01-15T10:45:00.000Z",
"createdAt": "2024-01-15T10:05:00.000Z"
}
]
URL params
:shaStringThe id of the report.
Query params
projectoptional StringThe identifying name of the project this report belongs to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
projectsoptional StringComma-separated list of project names to fetch status for (e.g. "web,mobile,ios"). When provided, the response will be an array of ReportStatus objects, each including a "project" field. If no report exists for a project, that item will include an "error" field instead. Cannot be combined with "project".
Response
jsonReportStatus | Array<ReportStatus>A ReportStatus object, or an array of ReportStatus objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if no report was found for that project.
Error responses
400Both
projectandprojectswere specified (they are mutually exclusive), orprojectsis not a valid comma-separated string.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No report found for the given sha and project. Only returned when using the
projectparameter — when usingprojects, missing reports appear as{ project, error }items in the 200 response array instead.
Complete a report
POST /
When you're uploading partial reports (via the Create Report endpoint), you need to use this endpoint to signal that all the partials have been added and that the report is complete.
URL params
:shaStringThe id of the report.
Body params
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
projectsoptional Array<String>An array of project names to complete in a single request. When provided, the response will be an array of ReportStatus objects, each including a "project" field. Cannot be combined with "project".
Response
jsonReportStatus | Array<ReportStatus>A ReportStatus object, or an array of ReportStatus objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if completion failed for that project.
Error responses
400Both
projectandprojectswere specified (they are mutually exclusive), orprojectsis not an array.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No partial report found to complete. Only returned when using the
projectparameter — when usingprojects, failures appear as{ project, error }items in the 200 response array instead.
Clone report
POST /
Clones a report from one identifier/sha to another. This is useful if you know a commit doesn't introduce any visual changes but you still want it to be associated with a report. An example use-case of this would be if you have some logic to skip a Happo run if a PR has already run Happo on a commit, and a subsequent commit does not touch any UI code. You can then clone the existing report (from the previous commit) to the new commit. After that you can run a comparison with the cloned report set as the "after" report to trigger a Happo build status on the PR.
Cloning a report does not affect your snapshot usage.
URL params
:fromShaStringThe id of the report to clone from
:toShaStringThe id of the report to clone to
Body params
projectoptional StringThe identifying name of the project for which the clone should be created. If none is specified, the default project will be used.
linkoptional StringURL to the source of the report (e.g. PR URL). If omitted, the link from the source/from report will be used
messageoptional StringA short string describing the source of the report (e.g. PR title). If omitted, the link from the source/from report will be used.
Response
jsonReportStatusAn object containing a url where the uploaded report can be accessed
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404The source report (
fromSha) does not exist for the given project.
Skip report
POST /
Tells Happo to skip running for a certain commit SHA. This is useful if you have Happo configured as a required check for your PRs but want to avoid running Happo tests (e.g. because no UI code changed). The given SHA must be present in your origin repo (e.g. on GitHub) before calling this endpoint. Calling this endpoint will post a successful build status to the PR/commit.
If the skip is successful, this endpoint will return a 204 status code, or with
ifNotStarted, a 200 with { "posted": true }, or { "posted": false, "reason": "…" } when a run had already started. If the SHA is not present in
the origin repo, the call will fail with a 404 error.
Without ifNotStarted, a project that already has a Happo run on the commit
is taken out of that run.
Example, in the CI step that decides not to run Happo:
curl --fail-with-body --silent --show-error \
--retry 5 --retry-max-time 30 --max-time 10 \
-u "$HAPPO_API_KEY:$HAPPO_API_SECRET" \
--json '{"project": "components", "group": true, "ifNotStarted": true}' \
"https://happo.io/api/skip/$HEAD_SHA"
URL params
:shaStringThe SHA of the commit to skip. This must be the full SHA, not a partial SHA.
Body params
projectoptional StringThe identifying name of the project associated with the call (default is the default project for the account).
labeloptional StringAn optional message to use with the build status (default is "Skipped")
groupoptional Boolean | StringThe status check group to post the status for, when no job has the project:
truefor the default group'sHappostatus check, or a group's name forHappo (<group>). Leave empty to post the project's own status.ifNotStartedoptional BooleanPost nothing when a Happo run for the project (or, with a group, for any project in the group) has already started on the commit, instead of taking the project out of it. The response is then a JSON object saying whether a status was posted. Pass
truewherever CI calls this in place of running Happo.
Response
jsonSkipResultWhat the skip did, when called with
ifNotStarted.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404The given SHA is not present in the origin repository.
Comparisons
Compare reports
POST /
Compare reports and get useful information on the possible differences.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Body params
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed. Cannot be combined with "projects".
projectsoptional Array<String>An array of project names to compare in a single request. When provided, the response will be an array of Comparison objects, each including a "project" field. If a comparison fails for an individual project (e.g. no report exists for that sha), that item will include an "error" field instead of comparison data — the other projects in the array are unaffected. Cannot be combined with "project".
linkoptional StringURL to the source of the report (e.g. PR URL).
messageoptional StringA short string describing the source of the report (e.g. PR title).
notifyoptional StringAn email address, or a list of comma-separated email addresses that you want to notify with the results of the comparison.
isAsyncoptional BooleanSet this option to
trueto make calls return immediately, without waiting for comparison results. You'll have to rely on the build status for the results. Using this option will also allow you to schedule future comparisons on reports that are currently being processed.fallbackShasoptional Array<String>Provide a list of shas/report identifiers that the comparison is allowed to fall back to, if the
sha1param isn't matching any reports. The order of this list matters -- put the most desirable fallback first in the list.deepCompareoptional DeepCompareSettingsOverride project deep compare settings for this comparison. When provided, these settings override any settings on the project.
blockApprovaloptional BlockApprovalWhat keeps this comparison from being approved. The
happolibrary sends itsblockApprovalconfig option here. It applies to this comparison only, and replaces what an earlier request for the same two reports set.runoptional ObjectWhat fingerprint selection decided for the run, which Happo keeps with the job's run (
createJob'srun). Read withisAsynconly.
Response
jsonComparison | AsyncComparison | Array<Comparison> | Array<AsyncComparison>When
isAsyncis false (default): a Comparison object, or an array of Comparison objects when "projects" is used. WhenisAsyncis true: an AsyncComparison object, or an array of AsyncComparison objects when "projects" is used. Each array item includes a "project" field identifying the project, and an "error" field if the comparison failed for that project.
Error responses
400Both
projectandprojectswere specified (they are mutually exclusive),projectsis not an array, or another validation error occurred. When usingprojects, per-project failures are returned as{ project, error }items in the 200 response array rather than as a 400 status.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get comparison status
GET /
Get the comparison status between two reports. This endpoint can be used after the "Compare two reports" endpoint has been used, to check for the current resolution status.
An async comparison (isAsync: true) can compare with another "before"
report than sha1: the report the "after" report extends, or a fallback or
earlier commit when sha1 has no report. Asked for with sha1, this
endpoint answers with that comparison, whose sha1 is the report it
compared with. Until an async comparison is done, it answers 404.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Query params
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
Response
jsonComparisonStatusAn object with the current comparison status
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No comparison found for the given sha pair and project, or an async comparison of them that is not done yet.
Get comparison statuses
GET /
Get all comparison statuses for a sha. The response will contain a list of comparison statuses where the report is either the "before" report or the "after" report.
URL params
:shaStringThe id of a report.
Query params
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
Response
jsonArray<ComparisonStatus>A list of comparison statuses for the :sha
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get comparison results
GET /
Get the full comparison results between two reports, including all snapshots grouped by their status: diffs, added, deleted, unchanged, and ignored diffs.
This endpoint is useful for programmatically reviewing visual changes — for example, to enable AI agents to inspect diffs for pull requests they are opening.
Pass include=measurements to also get measurements: where each diff
changed, as boxes in the before and after images, so a script or an agent can
crop the images to the change rather than diff them itself.
Pass exclude=unchanged to leave out the unchanged snapshots, which
on a large report are most of the response: unchanged is then empty, and
unchangedCount says how many there were.
To look up results using a Happo comparison URL
(/a/{accountId}/p/{projectId}/compare/{sha1}/{sha2}), extract the sha1
and sha2 path segments and use them as the path parameters here.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Query params
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
includeoptional StringPass
measurementsto addmeasurementsto the response: where each diff changed, as boxes in the before and after images, ready to crop them to.excludeoptional StringPass
unchangedto leave the unchanged snapshots out of the response:unchangedis then empty, andunchangedCountsays how many there were. On a large report the list is most of the response.
Response
jsonComparisonA Comparison object with full snapshot data for all diffs, added, deleted, unchanged, and ignored diffs.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No comparison found for the given sha pair and project.
Get comparisons
GET /
Get comparisons from your account.
Query params
fromoptional Date(An ISO 8601 string) Get comparisons created after this timestamp.
tooptional Date(An ISO 8601 string) Get comparisons created before this timestamp.
limitoptional NumberDefault 10. Controls how many items are returned.
projectoptional StringThe name of the project to return comparisons for. If left out, comparisons for all projects will be returned.
Response
jsonArray<ComparisonStatus>A list of comparison statuses
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Jobs
Create job
POST /
Tell Happo that you are about to run a comparison between two shas. A job will either be created (when no orchestration job exists for the same shas) or reused (when an orchestration job exists for the shas).
When you pass a group, every project for the same shas joins one job
instead, without an orchestration call, and the job posts one status check per
group: Happo for the default group (true), and Happo (<group>)
for a named one.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Body params
projectoptional StringThe project (identifying name) which this job is running for. Leave empty to use the default project.
projectsoptional Array<String>Pass an array of project names to create multiple jobs in one go. If orchestration is used, only one job will be created. If multiple jobs are created, the response will be an array of jobs.
groupoptional Boolean | StringThe status check group the project reports to:
truefor the default group, which posts theHappostatus check, or a name for a group of its own,Happo (<group>). Leave empty (or passfalse) to get a job of its own for the project, as before groups existed.linkoptional StringURL to the source of the job (e.g. PR URL).
messageoptional StringA short string describing the source of the job (e.g. PR title).
runoptional ObjectHow the run was made.
Response
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Create orchestration job
POST /
Tell Happo that you are about to run multiple comparisons between two shas. A special report will be created and a single, combined build status will be posted to GitHub.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Body params
projectsArray<String>A list of projects (identifying names) that you want to be part of the job.
linkoptional StringURL to the source of the orchestration job (e.g. PR URL).
messageoptional StringA short string describing the source of the job (e.g. PR title).
Response
jsonJobAn object with details about the job that was created/found.
Error responses
400projectsmust be an array.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Cancel job
POST /
Tell Happo that a job comparing two shas had to be cancelled for some reason. It might have been cancelled in CI or failed in some other way. When you're using orchestrated jobs, this can help prevent orchestrated jobs getting in an infinite "pending" state.
If the job is successfully cancelled, this endpoint will return a 204 No Content response.
If no job is found for the given SHA pair, this endpoint will return a 404 Not Found response.
If the job has already been completed, this endpoint will return a 409 Conflict response. This is expected behavior when the job has already finished processing.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Body params
projectoptional StringThe project (identifying name) which this job is running for. Leave empty to use the default project.
statusoptional StringEither "failure" or "success". This will control what status will be posted to GitHub. The default is "failure".
linkoptional StringURL to the source of the report (e.g. PR URL).
messageoptional StringA description of why the job was cancelled, e.g. "Cancelled in CI"
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No job found for the given sha pair and project.
409The job has already been completed and cannot be cancelled. This is expected when the job has already finished processing.
Get jobs
GET /
Get jobs from your account. A job encompasses creating a report and comparing that report with a previous report. Jobs can be automatically created (if you e.g. use any of the happo-ci* scripts) or manually via the API.
Query params
fromoptional Date(An ISO 8601 string) Get jobs created after this timestamp.
tooptional Date(An ISO 8601 string) Get jobs created before this timestamp.
limitoptional NumberDefault 10. Controls how many items are returned. Max is 100 -- if you specify a larger number you will still get at most 100 back.
Response
jsonArray<JobDetails>A list of jobs
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get job
GET /
Get a job by its ID
URL params
:idNumberThe ID of the job
Response
jsonJobDetailsDetails about the job
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No job found with the given ID.
Miscellaneous
Resolve comparison
POST /
Approve or reject the comparison between two reports, the same way a reviewer does from the Happo comparison page. The resolution isn't attributed to a Happo user. If the comparison is linked to a pull request, its Happo status check is updated too.
Pull request tokens can't be used with this endpoint. On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
URL params
:sha1StringThe id of the "before" report.
:sha2StringThe id of the "after" report.
Body params
resolutionStringEither "success" (approve the comparison) or "failure" (reject it).
projectoptional StringThe identifying name of the project the reports belong to. If none is specified, the default project will be assumed.
Response
jsonComparisonStatusAn object with the updated comparison status
Error responses
400resolutionis missing or not one of the allowed values, orprojectis not a string.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
403The request was authenticated with a pull request token, or the account only lets selected users review and the API key was not created by one of them.
404No project with the given name, or no comparison found for the given sha pair and project.
409The comparison cannot be approved because of what its
blockApprovalholds against it: examples in the after report failed to render, the after report introduces new accessibility violations, pages start to scroll sideways, or added snapshots are flaky or still being checked for flakes. Rejecting is still allowed.
Get flakes
GET /
Get a list of reported flakes for the current account, optionally filtered by project, component, variant, target, or sha.
Query params
projectoptional StringThe identifying name of the project to filter flakes for. If omitted, flakes for all projects are returned.
limitoptional NumberDefault 100. Controls how many items are returned. Max is 1000.
pageoptional NumberPage number for pagination. First page is 1.
componentoptional StringFilter flakes by component name.
variantoptional StringFilter flakes by variant name.
targetoptional StringFilter flakes by target name.
shaoptional StringFilter flakes by comparisons that include this sha as before or after.
Response
jsonArray<Flake>A list of reported flakes
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Ignore diff
POST /
Use this endpoint to mark a diff between two snapshots as ignored. The
snapshotId1/snapshotId2 params need to correspond to ids from Snapshot
objects.
An ignored diff counts as accepted in every comparison that contains it. On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
Body params
snapshot1IdStringA snapshot id
snapshot2IdStringA snapshot id
projectoptional StringThe name of the project to ignore the diff for. If omitted, the project will be looked up in the database. Providing a project name is more efficient.
Response
jsonObjectAn empty object.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
403The account only lets selected users review, and the request did not come from one of them (or from an API key one of them created).
404One or both snapshot IDs do not match any known snapshot.
Delete ignored diff
DELETE /
Use this endpoint to remove an ignored diff between two snapshots. The
snapshot1Id/snapshot2Id params need to correspond to ids from Snapshot
objects.
On an account that only lets selected users review, the request has to come from one of those reviewers: an API key one of them created, or their own Google IAP identity.
Body params
snapshot1IdStringA snapshot id
snapshot2IdStringA snapshot id
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
403The account only lets selected users review, and the request did not come from one of them (or from an API key one of them created).
404One or both snapshot IDs were not provided or do not match any known ignored diff.
Add component subscriptions
POST /
Add subscribers (email addresses) to a specific UI component. When a diff is found in a component, subscribers are notified with a link to the Happo comparison. Users can themselves unsubscribe manually. If you try adding an email address that has been unsubscribed by the user, it will be ignored and the user will continue to be unsubscribed.
URL params
:componentStringThe name of a component. Should match component names that are in the reports.
Body params
emailAddressesArray<String>A list of email addresses to add as subscribers.
Error responses
400emailAddressesis missing or contains invalid email addresses.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Remove component subscriptions
DELETE /
Remove subscribers for a specific UI component.
URL params
:componentStringThe name of a component. Should match component names that are in the reports.
Body params
emailAddressesArray<String>A list of email addresses to remove subscriptions for.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get snapshotExperimental
GET /
Get the latest snapshot for a component variant.
URL params
:componentStringThe name of a component. Should match component names that are in the reports.
:variantStringThe name of the variant. Should match variant names that are in the reports.
:targetStringThe target of the snapshot. Should match target names that are in the reports.
Query params
projectoptional StringThe identifying name of the project this report belongs to. If none is specified, the default project will be assumed.
Response
jsonSnapshotAn object with details about the snapshot.
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404No snapshot found for the given component, variant, and target.
Get diff counts
GET /
Get a sorted list of components and the number of diffs they have in the project's comparisons. This endpoint can be used to figure out what components contribute the most to flaky/spurious diffs. Diffs are kept for a limited time (10 days by default), so a longer date range has no more to count.
Query params
projectoptional StringThe identifying name of the project to fetch diff counts for. If none is specified, the default project will be used.
fromoptional Date(An ISO 8601 string) Show diff counts after this point in time. Default is 30 days ago.
tooptional Date(An ISO 8601 string) Show diff counts up until this point in time. If you don't pass in this parameter, you'll get diff counts up until the current timestamp.
Response
jsonArrayAn ordered list of components and their respective diff counts.
Error responses
400The
fromortodate parameter is not a valid ISO 8601 date string.401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Get current usage
GET /
Get the snapshots usage in the current billing cycle. If there is no active subscription for the account, you'll receive a 404 response.
Response
jsonUsageUsage information for the current billing cycle
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
404The account has no active subscription.
Get projects
GET /
Get all active projects (not archived) for the current account.
Response
jsonArray<ProjectInfo>A list of projects
Error responses
401Missing or invalid authentication credentials. All endpoints require authentication via Basic auth or Bearer token.
Objects
These are the domain objects you can come across while communicating with the API.
Snapshot
An object describing a screenshot of a certain component variant
urlStringURL of the screenshot image. It's important that the URL is deterministically generated based on the contents of the image. A hash function (like md5) is of good help here, so that two images that have the same bitmap content end up having the same URL.
variantStringThe name of the variant (e.g. "disabled")
targetStringThe snapshot's target (e.g. "firefox", "iphone 7")
componentStringThe name of the component shown in the screenshot (e.g. "Button")
widthNumberThe pixel width of the screenshot image
heightNumberThe pixel height of the screenshot image
idStringA unique identifier for the snapshot
SnapshotInfo
An object with information about a screenshot image.
urlStringURL leading to the screenshot image
widthNumberThe pixel width of the screenshot image
heightNumberThe pixel height of the screenshot image
ReportStatus
An object with useful properties for a report.
urlStringA URL leading to the report page
completedAtDate(An ISO 8601 string) Present if all the partials for a report have been added. Null otherwise. If you're not using partial reports, this value is always present.
createdAtDate(An ISO 8601 string) The timestamp for when the report was initially created.
snapshotCountNumberThe total number of snapshots included in the report
IgnoredDiffDetails
An object with details about why a diff was ignored.
byNameStringThe display name of the user who ignored the diff, or null when there is none to name: an automatic ignore, a flake reported with an API key, or one whose reporter has since deleted their profile (see
ignoredBy).byEmailStringThe email of the user who ignored the diff, or null when there is none to name: an automatic ignore, a flake reported with an API key, or one whose reporter has since deleted their profile (see
ignoredBy).createdAtDateISO 8601 timestamp for when the ignore was recorded.
ignoredByStringWho ignored the diff:
"user"for a flake a person reported on the comparison page (even if they have since deleted their profile, and for any flake reported before Happo recorded where from),"api"for one reported through the API (with an API key, or signed in),"mcp"for one reported through the Happo MCP server, or"automated"for a diff Happo ignored itself, most often because the project's deep-compare thresholds (compareThresholdandignoreThreshold) let it through.dataHappoHideoptional BooleanPresent and true when the diff was automatically ignored because the element uses the
data-happo-hideattribute.reasonoptional StringPresent when Happo ignored the diff by itself for a reason other than its deep-compare thresholds (
compareThresholdandignoreThreshold).antialiasing: every pixel that differs is anti-aliasing, the smoothing along the edges of text and shapes.identical: the two images have the same pixels, and only their files differ.sourceComparisonoptional ObjectPresent when the diff was ignored as a result of a reported flake. Contains
beforeSha,afterSha, andprojectIdidentifying the comparison that triggered the ignore.
Comparison
An object with useful properties describing the differences between two reports.
diffsArray<Array<Snapshot>>A list of snapshots that are different. Each item in the array is a tuple/array with the before snapshot and the after snapshot.
ignoredDiffsArray<[Snapshot, Snapshot, IgnoredDiffDetails]>A list of diffs that were ignored. Each item in the array is a tuple/array with the before snapshot, the after snapshot, and details about why the diff was ignored.
addedArray<Snapshot>Snapshots that have been added
deletedArray<Snapshot>Snapshots that have been removed
unchangedArray<Snapshot>A list of identical snapshots. Empty when Get comparison results was asked to leave them out with
exclude=unchanged.unchangedCountoptional NumberHow many snapshots are unchanged. Only from Get comparison results, and only with
exclude=unchanged.summaryStringA summary of the results, with the most important information listed
equalBooleanTrue if the two reports are identical, false otherwise. Also false when an example in the after report failed to render and the comparison was created with
blockApproval.renderErrorsrenderErrorsNumberThe number of examples in the after report that failed to render, and were reported as their error instead of a screenshot. A comparison with render errors cannot be approved when it was created with
blockApproval.renderErrors. Only accounts with render errors reported as text turned on get these; for everyone else it is 0.statusStringEither "failure" or "success". If the two reports are equal, or a user has manually accepted the comparison, the value is "success". If the two reports are not equal, or a user has manually rejected the comparison, the value is "failure".
compareUrlStringA link to a happo report page
statusImageUrlStringA link to an image showing the status for the comparison
measurementsoptional Array<DiffMeasurement>Where each diff changed. Only from Get comparison results, and only with
include=measurements.
DiffMeasurement
Where a diff changed, as Happo measured it, in each image's own pixels: crop the before and after images to `regions` to look at only what changed.
beforeSnapshotIdStringThe
idof the diff's before snapshot.afterSnapshotIdStringThe
idof the diff's after snapshot.measuredBooleanFalse when Happo has no measurement of the diff, which is not the same as nothing having changed. The other attributes below are then absent.
regionsoptional ArrayThe places the diff changed, largest first. Each has a
beforeand anafterbox (x,y,width,height) in that image's own pixels, which on a high-density target are a multiple of the snapshot'swidthandheight. A side is null where that image has none of the change. Absent when nothing could be placed reliably.contentShiftsoptional ArrayRows only one image has, top to bottom:
{ change: "added", y, height }atyin the after image, or{ change: "removed", y, height }atyin the before image. Everything below a shift moves, so a shift often explains a diff that looks changed everywhere.changedPixelsoptional NumberHow many pixels differ.
totalPixelsoptional NumberHow many pixels were compared.
maxColorDeltaoptional NumberThe largest color change of any pixel, from 0 to 1.
beforeWidthoptional NumberThe width the before image decoded to, which
regionsare in.beforeHeight,afterWidthandafterHeightare the rest of both sizes.
ComparisonStatus
An object with information about the status of a comparison.
sha1StringThe id of the "before" report.
sha2StringThe id of the "after" report.
statusStringOne of three values: "success" when the comparison is approved, "failure" when the comparison has been rejected or "needs review" when the comparison needs a review
urlStringA URL leading to the comparison page
createdAtDate(An ISO 8601 string) The timestamp for when the comparison was initially created.
diffsNumberThe number of diffs in this comparison
unchangedNumberThe number of unchanged snapshots
addedNumberThe number of added snapshots
deletedNumberThe number of deleted snapshots
linkStringA URL leading to the PR/commit that triggered the comparison
messageStringA description of the PR/commit that triggered the comparison
projectStringThe name of the project that this comparison belongs to
axeViolationsDeltaNumberHow many more accessibility violations the after report has than the before report (negative when it has fewer)
Flake
An object describing a reported flake.
projectStringThe name of the project that this flake belongs to. Null for a flake carried over from an ignored diff that had no project.
componentStringThe component name
variantStringThe variant name
targetStringThe target name
snapshotsArray<SnapshotInfo>An array with the before and after snapshots, in that order
comparisonComparisonStatusComparison status for the flake, if available
userObjectThe user who reported the flake. Null for a flake reported with an API key, or one whose reporter has since deleted their profile.
reportedViaStringWhere the flake was reported:
"ui"(the comparison page),"api"(the API, with an API key or signed in) or"mcp"(the Happo MCP server).nullfor a flake reported before Happo recorded this.createdAtDate(An ISO 8601 string) The creation timestamp
occurrenceCountNumberThe total number of times this flake has been detected across all comparisons
SkipResult
What a skip did, when it was called with `ifNotStarted`.
postedBooleanWhether Happo posted a passing status. False when a Happo run had already started on the commit, which posts the status instead.
reasonoptional StringWhy nothing was posted, when nothing was.
Job
A small object with basic properties for a job.
urlStringA URL leading to the job page
idNumberA unique identifier for the job
Usage
Snapshots usage information
totalNumberThe number of snapshots used in a billing cycle
quotaNumberThe number of snapshots included in the subscription (null for a plan without a limit)
ProjectInfo
A small object with basic properties for a project.
idNumberA unique identifier for the project
nameStringThe name of the project
JobDetails
An object with useful properties for a job.
idNumberA unique identifier for the job
createdAtDate(An ISO 8601 string) The creation timestamp for the job
finishedAtDate(An ISO 8601 string) The timestamp when the job finished
sha1StringThe ID of the "before" report
sha2StringThe ID of the "after" report
descriptionStringA description of the status that the job has
statusStringCan be "failure", "success", or "pending"
linkStringURL to the source of the job (e.g. PR URL).
messageStringA short string describing the source of the job (e.g. PR title).
urlStringA URL leading to the job page
projectsArray<ProjectInfo>A list of projects associated with the job
DeepCompareSettings
An object with settings for deep compare.
diffAlgorithmStringAlgorithm to use for diff comparison. Must be "color-delta" or "ssim".
compareThresholdNumberWith
color-delta, the color delta threshold: how different two pixels may be before they count as changed. Withssim, the SSIM threshold: the images count as equal when their structural difference (1 minus the SSIM of the whole images) is below it. A float between 0 and 1.ignoreThresholdNumberThe pixel threshold, for the
color-deltaalgorithm: the share of pixels in the image that may be abovecompareThresholdbefore the images count as different. E.g. a value of 0.01 means 1% of the pixels can be abovecompareThreshold(float between 0 and 1).ignoreWhitespaceBooleanWhether to ignore whitespace in the diff. If true, whitespace differences will be ignored when comparing images.
applyBlurBooleanWhether to apply blur to the diff. This can be used to smooth out subtle differences that would otherwise be above
compareThreshold.
BlockApproval
What keeps a comparison from being approved. Every attribute is optional, and leaving one out means it is not specified. Approving a blocked comparison is refused with a 409, and an approval carried over from an earlier comparison does not apply to it.
renderErrorsBooleanWhen true, the comparison cannot be approved while an example in the after report failed to render, whether the error is new or was already in the before report, and the comparison is never
equal. Only has an effect for accounts with render errors reported as text turned on. When not specified, render errors do not block approval.animationErrorsBooleanWhen true, the comparison cannot be approved while an animated snapshot in the after report could not be captured as asked (its
expectwas not met, the capture was over itsmaxBytes, or Happo's own capture failed), whether that is new or was already in the before report, and the comparison is neverequal. Only has an effect for snapshots Happo reported as text, which it does for every comparison happo.io makes. When not specified, animated snapshots that could not be captured do not block approval.accessibilityViolationsBooleanWhen true, the comparison cannot be approved while the after report has accessibility violations that the before report did not have. When not specified, new accessibility violations do not block approval.
horizontalOverflowBooleanWhen true, the comparison cannot be approved while a page in the after report scrolls sideways where it fit in the before report, or a snapshot only the after report has scrolls sideways. Only targets that set
detectHorizontalOverflowmeasure it, and a before snapshot taken without it doesn't count as having fit. When not specified, pages that start to scroll sideways do not block approval.flakyAddedSnapshotsBooleanWhen true, the comparison cannot be approved while a snapshot only the after report has is flaky: Happo renders each added snapshot again once the comparison is done, once as it was and once with the page's clock moved ahead, and this one came out different in a way a comparison would show as a diff. Approval also waits while that check is still running, for up to 30 minutes. A snapshot the check could not render again does not block. Only a comparison created with
isAsync: true(as the happo package creates them) is checked: one created without it is not, and this blocks nothing for it. When not specified, flaky added snapshots do not block approval.timedOutAddedSnapshotsBooleanWhen true, the comparison cannot be approved while a snapshot only the after report has timed out waiting for something it asks for: its
waitForContenttext orwaitForSelectorselector never showed up, or its Storybook story'swaitFornever returned true, in the after report and every time the check that renders each added snapshot again for flakes rendered it. How long a snapshot takes to render doesn't count. Approval also waits while that check is still running, for up to 30 minutes. A snapshot the check could not render again does not block. As forflakyAddedSnapshots, only a comparison created withisAsync: trueis checked. When not specified, added snapshots that time out do not block approval.
AsyncComparison
An object returned when a comparison is created with `isAsync: true`. The comparison will be completed asynchronously in the background.
idNumberThe id of the async comparison.
statusImageUrlStringA URL to an SVG image showing the current status of the comparison.
compareUrlStringA URL to the comparison page.