### Install Snapvisor CLI Source: https://snapvisor.io/docs/migrate-from-lost-pixel Install the Snapvisor CLI package as a development dependency. ```bash npm install --save-dev @snapvisor/cli ``` -------------------------------- ### Install @snapvisor/playwright Source: https://snapvisor.io/docs/sdks Install the Playwright SDK as a dev dependency. ```bash npm install --save-dev @snapvisor/playwright ``` -------------------------------- ### cURL request to list reviews Source: https://snapvisor.io/docs/api-reference/reviews/listReviews Example cURL command to GET the reviews for a build. Replace the placeholder strings with actual values. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/reviews" \ -H "Authorization: Bearer " ``` -------------------------------- ### Install Python SDK from GitHub Source: https://snapvisor.io/docs/sdks Install the Python SDK directly from GitHub until it is available on PyPI as 'snapvisor'. ```bash pip install git+https://github.com/DevinoSolutions/snapvisor-python ``` -------------------------------- ### Initialize environment and start containers Source: https://snapvisor.io/docs/self-hosting Copy the environment template and start the services using Docker Compose. ```bash cp .env.example .env # fill in the variables above, then: docker compose up -d ``` -------------------------------- ### Install and use @snapvisor/cli to upload screenshots Source: https://snapvisor.io/docs/sdks Install the CLI and upload a screenshots directory with a project token. The CLI also exposes commands to deploy, inspect, review builds, and more. ```bash npm install --save-dev @snapvisor/cli ``` ```bash ARGOS_TOKEN="" npx @snapvisor/cli upload ./screenshots ``` -------------------------------- ### Response body example Source: https://snapvisor.io/docs/api-reference/deployments/getDeployment Example JSON response body for a successful deployment retrieval. ```json { "id": "string", "status": "pending", "environment": "preview", "branch": "string", "commitSha": "string", "url": "http://example.com", "createdAt": "string" } ``` -------------------------------- ### Get Project Request Source: https://snapvisor.io/docs/api-reference/projects/getProject Example cURL request to retrieve a project by owner and project name. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### Install @snapvisor CLI and Playwright adapter Source: https://snapvisor.io/docs/getting-started Install the Snapvisor CLI and the Playwright adapter as dev dependencies. Official adapters also cover Cypress, Puppeteer, and Storybook. ```bash npm install --save-dev @snapvisor/cli @snapvisor/playwright ``` -------------------------------- ### JSON response for GET /me Source: https://snapvisor.io/docs/api-reference/users/getMe Example response body showing the user object, accounts array, and GitHub linkage. The response includes fields like id, name, email, and account type. ```json { "user": { "id": "string", "name": "string", "email": "string" }, "accounts": [ { "id": "string", "slug": "string", "name": "string", "type": "user", "mcpAccessIncluded": true } ], "github": { "connected": true, "login": "string" }} ``` -------------------------------- ### Response body example Source: https://snapvisor.io/docs/api-reference/builds/updateBuild Example JSON response body for a successful update, containing build details, status, stats, metadata, and notification information. ```json { "build": { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" } } } ``` -------------------------------- ### Install TypeScript API Client Source: https://snapvisor.io/docs/api Command to install the official typed client for TypeScript projects. ```bash npm install @snapvisor/api-client ``` -------------------------------- ### Response body example Source: https://snapvisor.io/docs/api-reference/builds/findBaseline Example JSON response from the baseline endpoint, showing the structure of a baseline build. ```json { "baseline": { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" } }} ``` -------------------------------- ### Example response body for list reviews Source: https://snapvisor.io/docs/api-reference/reviews/listReviews Example JSON response containing an array of review objects. Each review includes id, buildId, state, user, dismissedAt, dismissedBy, and date. ```json [ { "id": "string", "buildId": "string", "state": "approved", "user": { "id": "string", "slug": "string", "name": "string" }, "dismissedAt": "string", "dismissedBy": { "id": "string", "slug": "string", "name": "string" }, "date": "string" } ] ``` -------------------------------- ### cURL request to get a deployment Source: https://snapvisor.io/docs/api-reference/deployments/getDeployment Example cURL command to retrieve a deployment by its ID. Requires a project token in the Authorization header. ```bash curl -X GET "https://api.snapvisor.io/v2/deployments/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get build cURL request Source: https://snapvisor.io/docs/api-reference/builds/getBuild Example cURL command to retrieve a build by its number. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### List builds cURL request Source: https://snapvisor.io/docs/api-reference/builds/listBuilds Example cURL command to retrieve project builds. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds" \ -H "Authorization: Bearer " ``` -------------------------------- ### Response body example Source: https://snapvisor.io/docs/api-reference/comments/getComment Example JSON response body for a successful request. ```json { "id": "string", "buildId": "string", "threadId": "string", "body": null, "text": "string", "author": { "id": "string", "slug": "string", "name": "string" }, "screenshotDiffId": "string", "anchor": { "type": "point", "x": 0, "y": 0 }, "pending": true, "resolvedAt": "string", "editedAt": "string", "createdAt": "string", "reactions": [ { "emoji": "string", "count": 0, "users": [ { "id": "string", "slug": "string", "name": "string" } ] } ] } ``` -------------------------------- ### Configure MCP Client in JSON Source: https://snapvisor.io/docs/agents/mcp-server Example configuration for an MCP client using the mcpServers object. ```json { "mcpServers": { "snapvisor": { "url": "https://mcp.snapvisor.io" } } } ``` -------------------------------- ### cURL request example Source: https://snapvisor.io/docs/api-reference/comments/getComment Example cURL command to retrieve a single comment on a build. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create review cURL request Source: https://snapvisor.io/docs/api-reference/reviews/createReview Example cURL command to POST a review to a specific build. ```bash curl -X POST "https://api.snapvisor.io/v2/projects/string/string/builds/string/reviews" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{}' ``` -------------------------------- ### Create a build request Source: https://snapvisor.io/docs/api-reference/builds/createBuild Example cURL command to create a new build by sending a POST request to the builds endpoint. ```bash curl -X POST "https://api.snapvisor.io/v2/builds" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "commit": "string", "branch": "string", "screenshotKeys": [ "string" ] }' ``` -------------------------------- ### Authorization header example Source: https://snapvisor.io/docs/api-reference/comments/getComment Shows how to send a personal access token as a bearer token in the Authorization header. ```http Authorization: Bearer ``` -------------------------------- ### Response body for create project Source: https://snapvisor.io/docs/api-reference/projects/createProject Example JSON response returned on successful creation (201). Contains the project id, account object, name, defaultBaseBranch, and hasRemoteContentAccess. ```json { "id": "string", "account": { "id": "string", "slug": "string" }, "name": "string", "defaultBaseBranch": "string", "hasRemoteContentAccess": true } ``` -------------------------------- ### Production deployment branch patterns Source: https://snapvisor.io/docs/learn/deployments/environments Examples of glob patterns used to define which branches are treated as production deployments. ```text main {main,production} release/** ``` -------------------------------- ### cURL request to list build diffs Source: https://snapvisor.io/docs/api-reference/builds/listBuildDiffs Sends a GET request to the Snapvisor API to list diffs for a build. Requires an Authorization Bearer token. ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/diffs" \ -H "Authorization: Bearer " ``` -------------------------------- ### Finalize deployment request Source: https://snapvisor.io/docs/api-reference/deployments/finalizeDeployment Example cURL command to finalize a deployment using the POST method. ```bash curl -X POST "https://api.snapvisor.io/v2/deployments/string/finalize" \ -H "Authorization: Bearer " ``` -------------------------------- ### cURL request to list projects Source: https://snapvisor.io/docs/api-reference/projects/listProjects Example cURL command to list projects for an account. Replace 'string' in the URL with the account slug and provide a valid bearer token. ```bash curl -X GET "https://api.snapvisor.io/v2/accounts/string/projects" \ -H "Authorization: Bearer " ``` -------------------------------- ### Response body for listing projects Source: https://snapvisor.io/docs/api-reference/projects/listProjects Example JSON response body for the list projects endpoint. Shows the pagination info and an array of project objects. ```json { "pageInfo": { "total": 0, "page": 0, "perPage": 0 }, "results": [ { "id": "string", "account": { "id": "string", "slug": "string" }, "name": "string", "defaultBaseBranch": "string", "hasRemoteContentAccess": true } ] } ``` -------------------------------- ### JSON response for list build diffs Source: https://snapvisor.io/docs/api-reference/builds/listBuildDiffs Example response body containing pagination info and an array of diff results with base and head screenshot metadata. ```json { "pageInfo": { "total": 0, "page": 0, "perPage": 0 }, "results": [ { "id": "string", "name": "string", "status": "pending", "score": 0, "group": "string", "parentName": "string", "url": "http://example.com", "base": { "id": "string", "name": "string", "metadata": { "$schema": "https://api.argos-ci.com/v2/screenshot-metadata.json", "url": "string", "previewUrl": "string", "viewport": { "width": 0, "height": 0 }, "colorScheme": "light", "mediaType": "screen", "test": { "id": "string", "title": "string", "titlePath": [ "string" ], "retries": 0, "retry": 0, "repeat": 0, "location": { "file": "string", "line": 0, "column": 0 }, "annotations": [ { "type": "string", "description": "string", "location": { "file": "string", "line": 0, "column": 0 } } ], "tags": [ "string" ] }, "browser": { "name": "string", "version": "string" }, "automationLibrary": { "name": "string", "version": "string" }, "sdk": { "name": "string", "version": "string" }, "story": { "id": "string", "tags": [ "string" ], "mode": "string", "play": true }, "tags": [ "string" ] }, "width": 0, "height": 0, "url": "http://example.com", "contentType": "string" }, "head": { "id": "string", "name": "string", "metadata": { "$schema": "https://api.argos-ci.com/v2/screenshot-metadata.json", "url": "string", "previewUrl": "string", "viewport": { "width": 0, "height": 0 }, "colorScheme": "light", "mediaType": "screen", "test": { "id": "string", "title": "string", "titlePath": [ "string" ], "retries": 0, "retry": 0, "repeat": 0, "location": { "file": "string", "line": 0, "column": 0 }, "annotations": [ { "type": "string", "description": "string", "location": { "file": "string", "line": 0, "column": 0 } } ], "tags": [ "string" ] }, "browser": { "name": "string", "version": "string" }, "automationLibrary": { "name": "string", "version": "string" }, "sdk": { "name": "string", "version": "string" }, "story": { "id": "string", "tags": [ "string" ], "mode": "string", "play": true }, "tags": [ "string" ] }, "width": 0, "height": 0, "url": "http://example.com", "contentType": "string" }, "test": { "id": "string", "name": "string", "buildName": "string", "metrics": { "total": 0, "changes": 0, "uniqueChanges": 0, "stability": 0, "consistency": 0, "flakiness": 0 } }, "change": { "id": "string", "ignored": true, "occurrences": 0 } } ]} ``` -------------------------------- ### cURL request to POST /baseline Source: https://snapvisor.io/docs/api-reference/builds/findBaseline Example cURL command to call the baseline endpoint with a list of commits. ```bash curl -X POST "https://api.snapvisor.io/v2/baseline" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "commits": [ "string" ] }' ``` -------------------------------- ### cURL request to GET /me Source: https://snapvisor.io/docs/api-reference/users/getMe Sends a GET request to the /me endpoint with a bearer token in the Authorization header. The token is required for user actions. ```bash curl -X GET "https://api.snapvisor.io/v2/me" \ -H "Authorization: Bearer " ``` -------------------------------- ### Response body for finalize builds Source: https://snapvisor.io/docs/api-reference/builds/finalizeBuilds Example 200 response body showing the finalized build object with status accepted and conclusion no-changes. ```json { "builds": [ { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" } } ] } ``` -------------------------------- ### Upload sharded screenshots with Snapvisor CLI Source: https://snapvisor.io/docs/migrate-from-lost-pixel Use this command in each CI shard to upload screenshots to a single Snapvisor build. --parallel-index starts at 1 and --parallel-nonce must be identical across all shards of the same run; a CI run id is the natural choice. ```bash npx @snapvisor/cli upload ./screenshots \ --parallel \ --parallel-nonce "$GITHUB_RUN_ID" \ --parallel-total 10 \ --parallel-index "$SHARD_INDEX" ``` -------------------------------- ### Get build response body Source: https://snapvisor.io/docs/api-reference/builds/getBuild The JSON structure returned when successfully retrieving a build. ```json { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" }} ``` -------------------------------- ### GET /projects/{owner}/{project} Source: https://snapvisor.io/docs/api-reference/projects/getProject Retrieve a project by its owner (account slug) and project name. Requires a project token for authentication. ```APIDOC ## GET /projects/{owner}/{project} ### Description Retrieve a project by its owner (account slug) and project name. ### Method GET ### Endpoint `/projects/{owner}/{project}` ### Parameters #### Path Parameters - **owner** (string) - Required - Length `1 <= length` - **project** (string) - Required - Length `1 <= length` ### Authorization `projectToken` - Bearer Authenticate as a **project** with a project token. Send it as a bearer token in the `Authorization` header: Authorization: Bearer In: `header` ### Request Example curl -X GET "https://api.snapvisor.io/v2/projects/string/string" \ -H "Authorization: Bearer " ### Response #### Success Response (200) - **id** (string) - Project ID - **account** (object) - Account information - **id** (string) - Account ID - **slug** (string) - Account slug - **name** (string) - Project name - **defaultBaseBranch** (string) - Default base branch - **hasRemoteContentAccess** (boolean) - Whether remote content access is enabled #### Response Example { "id": "string", "account": { "id": "string", "slug": "string" }, "name": "string", "defaultBaseBranch": "string", "hasRemoteContentAccess": true } ### Error Responses - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### Add Reaction Request Source: https://snapvisor.io/docs/api-reference/comments/addCommentReaction Example cURL command to add an emoji reaction to a comment. ```bash curl -X POST "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments/string/reactions" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "emoji": "string" }' ``` -------------------------------- ### GET /projects/{owner}/{project}/builds/{buildNumber}/diffs Source: https://snapvisor.io/docs/api-reference/builds/listBuildDiffs List the screenshot diffs of a build, with pagination. Each diff compares a baseline screenshot to the one captured by the build. Each diff also carries its test's flakiness metrics and, when it is a change, its ignore state and occurrence count — so you can tell whether a change is worth reviewing or is just a flaky one. Use `needsReview` to return only the diffs that require review. ```APIDOC ## GET /projects/{owner}/{project}/builds/{buildNumber}/diffs ### Description List the screenshot diffs of a build, with pagination. Each diff compares a baseline screenshot to the one captured by the build. Each diff also carries its test's flakiness metrics and, when it is a change, its ignore state and occurrence count — so you can tell whether a change is worth reviewing or is just a flaky one. Use `needsReview` to return only the diffs that require review. ### Method GET ### Endpoint `/projects/{owner}/{project}/builds/{buildNumber}/diffs` ### Parameters #### Path Parameters - **owner** (string) - Required - Length `1 <= length` - **project** (string) - Required - Length `1 <= length` - **buildNumber** (string) - Required - The build number #### Query Parameters - **perPage** (string) - Optional - Number of items per page (max 100) - **page** (string) - Optional - Page number - **needsReview** (string) - Optional - Only return diffs that require review. Matches `changed`, `added`, and `removed`, except `removed` is excluded for subset builds. - **metricsPeriod** (string) - Optional - Period over which the test flakiness metrics are computed. Default `"LAST_7_DAYS"`. Value in: "LAST_24_HOURS", "LAST_3_DAYS", "LAST_7_DAYS", "LAST_30_DAYS", "LAST_90_DAYS" ### Authorization Authenticate as a **project** with a project token. Send it as a bearer token in the `Authorization` header: ``` Authorization: Bearer ``` In: `header` ``` -------------------------------- ### Retrieve account analytics via cURL Source: https://snapvisor.io/docs/api-reference/analytics/getAccountAnalytics Example request to fetch analytics for a specific account using cURL. ```bash curl -X GET "https://api.snapvisor.io/v2/accounts/string/analytics?from=2019-08-24T14%3A15%3A22Z&groupBy=day" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /v2/account/analytics Source: https://snapvisor.io/docs/api-reference Retrieve build and screenshot metrics for an account. The personal access token must be scoped to the account. ```APIDOC ## GET /v2/account/analytics ### Description Retrieve build and screenshot metrics for an account. The personal access token must be scoped to the account. ### Method GET ### Endpoint https://api.snapvisor.io/v2/account/analytics ### Authentication Bearer token in the Authorization header. Personal access token must be scoped to the account. ### Response #### Success Response (200) Build and screenshot metrics for the account. ``` -------------------------------- ### Example response for a posted comment Source: https://snapvisor.io/docs/api-reference/comments/createComment Shows the JSON structure returned after successfully posting a comment, including comment ID, author, anchor, and reactions. ```json { "id": "string", "buildId": "string", "threadId": "string", "body": null, "text": "string", "author": { "id": "string", "slug": "string", "name": "string" }, "screenshotDiffId": "string", "anchor": { "type": "point", "x": 0, "y": 0 }, "pending": true, "resolvedAt": "string", "editedAt": "string", "createdAt": "string", "reactions": [ { "emoji": "string", "count": 0, "users": [ { "id": "string", "slug": "string", "name": "string" } ] } ]} ``` -------------------------------- ### Lost Pixel pageShots configuration Source: https://snapvisor.io/docs/migrate-from-lost-pixel Example of a legacy Lost Pixel configuration using pageShots. ```javascript // lostpixel.config.js export const config = { pageShots: { baseUrl: "http://localhost:3000", pages: [{ path: "/", name: "home" }], mask: [{ selector: "[data-testid=timestamp]" }], breakpoints: [375, 1280], fullPage: true, }, }; ``` -------------------------------- ### GET /projects/{owner}/{project}/builds/{buildNumber}/reviews Source: https://snapvisor.io/docs/api-reference/reviews/listReviews Lists the reviews submitted on a build, with pagination. Requires user authentication via a personal access token. ```APIDOC ## GET /projects/{owner}/{project}/builds/{buildNumber}/reviews ### Description List the reviews submitted on a build, with pagination. ### Method GET ### Endpoint `/projects/{owner}/{project}/builds/{buildNumber}/reviews` ### Parameters #### Path Parameters - **owner** (string) - Required - Length: 1 <= length - **project** (string) - Required - Length: 1 <= length - **buildNumber** (string) - Required - The build number ### Authorization `personalAccessToken` Send as a bearer token in the `Authorization` header: ``` Authorization: Bearer ``` ### Request Example ``` curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/reviews" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) Returns an array of review objects. #### Response Example ``` [ { "id": "string", "buildId": "string", "state": "approved", "user": { "id": "string", "slug": "string", "name": "string" }, "dismissedAt": "string", "dismissedBy": { "id": "string", "slug": "string", "name": "string" }, "date": "string" } ] ``` ### Error Responses - 400 - Bad Request - 401 - Unauthorized - 403 - Forbidden - 404 - Not Found - 500 - Internal Server Error ``` -------------------------------- ### Get Project Response Body Source: https://snapvisor.io/docs/api-reference/projects/getProject The JSON structure returned upon a successful project retrieval. ```json { "id": "string", "account": { "id": "string", "slug": "string" }, "name": "string", "defaultBaseBranch": "string", "hasRemoteContentAccess": true} ``` -------------------------------- ### GET /projects/{owner}/{project}/builds/{buildNumber} Source: https://snapvisor.io/docs/api-reference/builds/getBuild Retrieve a single build by its number within a project, including its status and metadata. ```APIDOC ## GET /projects/{owner}/{project}/builds/{buildNumber} ### Description Retrieve a single build by its number within a project, including its status and metadata. ### Method GET ### Endpoint `/projects/{owner}/{project}/builds/{buildNumber}` ### Parameters #### Path Parameters - **owner** (string) - Required - Length `1 <= length` - **project** (string) - Required - Length `1 <= length` - **buildNumber** (string) - Required - The build number #### Authorization - **projectToken** - Required - Authenticate as a **project** with a project token. Send it as a bearer token in the `Authorization` header: `Authorization: Bearer `. You can find your project token in your Argos project settings. Project tokens are used by CI and the SDK to create builds and deployments. In: `header` ### Request Example ``` curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **id** (string) - Build ID - **number** (integer) - Build number - **head** (object) - Head commit information - **sha** (string) - Commit SHA - **branch** (string) - Branch name - **base** (object) - Base commit information - **sha** (string) - Commit SHA - **branch** (string) - Branch name - **status** (string) - Build status (e.g., "accepted") - **conclusion** (string) - Build conclusion (e.g., "no-changes") - **stats** (object) - Build statistics - **added** (integer) - Number of added screenshots - **removed** (integer) - Number of removed screenshots - **unchanged** (integer) - Number of unchanged screenshots - **changed** (integer) - Number of changed screenshots - **ignored** (integer) - Number of ignored screenshots - **failure** (integer) - Number of failures - **retryFailure** (integer) - Number of retry failures - **total** (integer) - Total number of screenshots - **metadata** (object) - Build metadata - **testReport** (object) - Test report information - **status** (string) - Test report status (e.g., "passed") - **stats** (object) - Test report statistics - **startTime** (string) - Start time - **duration** (integer) - Duration - **url** (string) - Build URL - **notification** (object) - Notification information - **description** (string) - Notification description - **context** (string) - Notification context - **github** (object) - GitHub notification state - **state** (string) - GitHub state (e.g., "pending") - **gitlab** (object) - GitLab notification state - **state** (string) - GitLab state (e.g., "pending") - **url** (string) - Notification URL #### Response Example ``` { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" } } ``` ### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### cURL request to update a build Source: https://snapvisor.io/docs/api-reference/builds/updateBuild Example cURL command to update a build with screenshots. Uses the project token in the Authorization header and sends a JSON body with screenshot key and name. ```bash curl -X PUT "https://api.snapvisor.io/v2/builds/string" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "screenshots": [ { "key": "string", "name": "string" } ] }' ``` -------------------------------- ### GET /projects/{owner}/{project}/builds/{buildNumber}/comments Source: https://snapvisor.io/docs/api-reference/comments/listComments List the comments on a build, with pagination. Requires authentication via a personal access token. ```APIDOC ## GET /projects/{owner}/{project}/builds/{buildNumber}/comments ### Description List the comments on a build, with pagination. ### Method GET ### Endpoint `/projects/{owner}/{project}/builds/{buildNumber}/comments` ### Parameters #### Path Parameters - **owner** (string) - Required - Length `1 <= length` - **project** (string) - Required - Length `1 <= length` - **buildNumber** (string) - Required - The build number #### Authorization - **Authorization** (header) - Required - Bearer token: `Authorization: Bearer ` ### Request Example ``` curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) Returns an array of comment objects. #### Response Example ```json [ { "id": "string", "buildId": "string", "threadId": "string", "body": null, "text": "string", "author": { "id": "string", "slug": "string", "name": "string" }, "screenshotDiffId": "string", "anchor": { "type": "point", "x": 0, "y": 0 }, "pending": true, "resolvedAt": "string", "editedAt": "string", "createdAt": "string", "reactions": [ { "emoji": "string", "count": 0, "users": [ { "id": "string", "slug": "string", "name": "string" } ] } ] } ] ``` ### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### Response body for OIDC exchange Source: https://snapvisor.io/docs/api-reference/authentication/exchangeGitHubActionsOidcToken Example response containing the exchanged token and its expiration timestamp. ```json { "token": "string", "expiresAt": "string" } ``` -------------------------------- ### GET /projects/{owner}/{project}/builds Source: https://snapvisor.io/docs/api-reference/builds/listBuilds List the builds of a project, most recent first. Results are paginated. Use search to match builds by name, branch or commit, and distinctName to return only the latest build per name and commit. ```APIDOC ## GET /projects/{owner}/{project}/builds ### Description List the builds of a project, most recent first. Results are paginated. Use `search` to match builds by name, branch or commit, and `distinctName` to return only the latest build per name and commit. ### Method GET ### Endpoint `/projects/{owner}/{project}/builds` ### Parameters #### Path Parameters - **owner** (string) - Required - Length `1 <= length` - **project** (string) - Required - Length `1 <= length` #### Query Parameters - **perPage** (string) - Optional - Number of items per page (max 100) - **page** (string) - Optional - Page number - **head** (string) - Optional - Length `1 <= length` - **headSha** (string) - Optional - SHA1 hash, Match `^[0-9a-f]{40}$` - **search** (string) - Optional - Search builds by name, branch (substring) or commit (prefix). Length `1 <= length` - **distinctName** (string) - Optional - Only return the latest builds created, unique by name and commit. ### Authorization `projectToken` - Bearer token in the `Authorization` header. Authenticate as a **project** with a project token. ### Request Example ``` curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **pageInfo** (object) - Pagination information - **total** (number) - Total number of items - **page** (number) - Current page number - **perPage** (number) - Items per page - **results** (array) - List of builds - **id** (string) - Build ID - **number** (number) - Build number - **head** (object) - Head commit information - **sha** (string) - SHA of head commit - **branch** (string) - Branch of head commit - **base** (object) - Base commit information - **sha** (string) - SHA of base commit - **branch** (string) - Branch of base commit - **status** (string) - Build status (e.g., accepted) - **conclusion** (string) - Build conclusion (e.g., no-changes) - **stats** (object) - Build statistics - **added** (number) - Number of added items - **removed** (number) - Number of removed items - **unchanged** (number) - Number of unchanged items - **changed** (number) - Number of changed items - **ignored** (number) - Number of ignored items - **failure** (number) - Number of failures - **retryFailure** (number) - Number of retry failures - **total** (number) - Total count - **metadata** (object) - Build metadata - **testReport** (object) - Test report information - **status** (string) - Test report status (e.g., passed) - **stats** (object) - Test report statistics - **startTime** (string) - Start time - **duration** (number) - Duration - **url** (string) - URL to the build - **notification** (object) - Notification settings - **description** (string) - Description - **context** (string) - Context - **github** (object) - GitHub notification state - **state** (string) - State (e.g., pending) - **gitlab** (object) - GitLab notification state - **state** (string) - State (e.g., pending) - **url** (string) - Notification URL #### Response Example ``` { "pageInfo": { "total": 0, "page": 0, "perPage": 0 }, "results": [ { "id": "string", "number": 1, "head": { "sha": "string", "branch": "string" }, "base": { "sha": "string", "branch": "string" }, "status": "accepted", "conclusion": "no-changes", "stats": { "added": 0, "removed": 0, "unchanged": 0, "changed": 0, "ignored": 0, "failure": 0, "retryFailure": 0, "total": 0 }, "metadata": { "testReport": { "status": "passed", "stats": { "startTime": "string", "duration": 0 } } }, "url": "http://example.com", "notification": { "description": "string", "context": "string", "github": { "state": "pending" }, "gitlab": { "state": "pending" }, "url": "http://example.com" } } ] } ``` ### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **500** - Internal Server Error ``` -------------------------------- ### Delete Comment cURL Request Source: https://snapvisor.io/docs/api-reference/comments/deleteComment Example cURL command to delete a specific comment on a build. ```bash curl -X DELETE "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /deployments/resolve/{domain} Source: https://snapvisor.io/docs/api-reference/deployments/resolveDeploymentDomain Resolves a deployment domain or URL to the deployment it currently serves. This endpoint is public and does not require authentication. ```APIDOC ## GET /deployments/resolve/{domain} ### Description Resolve a deployment domain or URL to the deployment it currently serves. This endpoint is public and does not require authentication. ### Method GET ### Endpoint /deployments/resolve/{domain} ### Parameters #### Path Parameters - **domain** (string) - Required - A deployment domain or URL ### Request Example ``` curl -X GET "https://api.snapvisor.io/v2/deployments/resolve/string" ``` ### Response #### Success Response (200) - **deploymentId** (string) - The ID of the deployment - **projectId** (string) - The ID of the project - **environment** (string) - The environment of the deployment (e.g., preview) - **visibility** (string) - The visibility of the deployment (e.g., private) #### Response Example ``` { "deploymentId": "string", "projectId": "string", "environment": "preview", "visibility": "private" } ``` ``` -------------------------------- ### Subscribe to Comment Thread cURL Request Source: https://snapvisor.io/docs/api-reference/comments/subscribeCommentThread Example cURL command to subscribe to a comment thread via a POST request. ```bash curl -X POST "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments/string/subscription" \ -H "Authorization: Bearer " ``` -------------------------------- ### Response body for dismissed review Source: https://snapvisor.io/docs/api-reference/reviews/dismissReview Example JSON response after dismissing a review. Contains review details including state, user, and dismissal information. ```json { "id": "string", "buildId": "string", "state": "approved", "user": { "id": "string", "slug": "string", "name": "string" }, "dismissedAt": "string", "dismissedBy": { "id": "string", "slug": "string", "name": "string" }, "date": "string"} ``` -------------------------------- ### cURL request to get current project Source: https://snapvisor.io/docs/api-reference/projects/getAuthProject Use this cURL command to retrieve the project associated with the project token. Replace the placeholder with your actual token. ```bash curl -X GET "https://api.snapvisor.io/v2/project" \ -H "Authorization: Bearer " ``` -------------------------------- ### Upload screenshots folder with @snapvisor/cli Source: https://snapvisor.io/docs/getting-started Run tests to write screenshots, then upload the folder with the CLI. The first build on the base branch becomes the baseline and is approved automatically. If no screenshots are uploaded, Snapvisor reports that none were uploaded. ```bash # run your tests so they write screenshots, then upload the folder npx @snapvisor/cli upload ./screenshots ``` -------------------------------- ### cURL request to list comments on a build Source: https://snapvisor.io/docs/api-reference/comments/listComments Sends a GET request to the comments endpoint with a bearer token in the Authorization header. The path parameters owner, project, and buildNumber are placeholders (string). ```bash curl -X GET "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments" \ -H "Authorization: Bearer " ``` -------------------------------- ### cURL request to unresolve a comment thread Source: https://snapvisor.io/docs/api-reference/comments/unresolveCommentThread Example cURL command to reopen a resolved comment thread. Replace the placeholder values in the URL and the token. ```bash curl -X POST "https://api.snapvisor.io/v2/projects/string/string/builds/string/comments/string/unresolve" \ -H "Authorization: Bearer " ```