---
title: "Create a Percy comparison between a reference image and a tab capture"
method: POST
path: "/api/v1/visual-compare/comparisons"
tags: ["Visual Compare"]
---

# Create a Percy comparison between a reference image and a tab capture

`POST /api/v1/visual-compare/comparisons`

## Request

- Base URL: `https://toolkit.browserstack.com`
- URL: `https://toolkit.browserstack.com/api/v1/visual-compare/comparisons`
- Auth: API key in cookie `_wdt_rails_session`

Uploads a reference image (Figma frame or user upload) and a tab capture, uploads the reference as a Percy build and waits for it to finish, then uploads the capture on the same branch and starts the comparison. Both images must arrive pre-normalized to identical CSS-pixel dimensions (LV-3590).

## Request body `multipart/form-data`

- object
  - `reference` string, binary, required: Reference image (the baseline)
  - `capture` string, binary, required: Tab capture (the head image)
  - `width` integer, required
  - `height` integer, required

## Response `201`

Comparison started

- object
  - `data` object
    - `comparison_id` string
    - `build_id` string
    - `baseline_build_id` string

## Other responses

- `422`: Comparison rejected

---

[API](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api.md) - [All operations](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/llms.txt) - [OpenAPI document](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/revisions/cbd06b547b6a?raw)
