beta
Documentation

Diff Tasks

A diff task is one page of a diff batch: the two captures it compares, the score, the verdict, and the diff image.

Read a diff task

endpoint
GET /api/v1/projects/{project_id}/diff-tasks/{diff_task_id}

One diff_task. Minimum key role: Participant. Its id is in the batch's tasks.

The diff_task object

diff_task
{
  "object": "diff_task",
  "id": "00000000-0000-0000-0000-000000000008",
  "diff_batch_id": "00000000-0000-0000-0000-000000000004",
  "page": {
    "id": "00000000-0000-0000-0000-000000000007",
    "path": "/pricing",
    "title": "Pricing"
  },
  "status": "DONE",
  "verdict": "FAIL",
  "cancellation_reason": null,
  "error": null,
  "reference_capture_task_id": "00000000-0000-0000-0000-000000000006",
  "candidate_capture_task_id": "00000000-0000-0000-0000-000000000005",
  "compared_by": "pixels",
  "score": {
    "diff_pct": 12.6,
    "match_pct": 87.4,
    "diff_pixels": 503212,
    "tolerated_pixels": 0,
    "pixel_delta_max": 255
  },
  "config": {
    "comparison_tolerance": 0,
    "diff_threshold_pct": 10,
    "max_diff_pixel_count": 100
  },
  "config_sources": {
    "comparison_tolerance": "project",
    "diff_threshold_pct": "page",
    "max_diff_pixel_count": "project"
  },
  "sizes": {
    "reference": {
      "width": 1280,
      "height": 3120
    },
    "candidate": {
      "width": 1280,
      "height": 3160
    },
    "diff": {
      "width": 3840,
      "height": 3164
    }
  },
  "pixel_delta_histogram": {
    "255": 503212
  },
  "diff_image": {
    "url": "https://…",
    "expires_at": "2026-11-06T12:00:00.000Z",
    "bytes": 912004
  },
  "created_at": "2026-11-06T10:02:11.7+00:00",
  "updated_at": "2026-11-06T10:03:40+00:00"
}

Identity and outcome

FieldTypeValue
diff_batch_iduuid stringIts batch.
pageobject | nullid of the page while it exists, path and title as when the diff was made.
statusstringPENDING, RUNNING, DONE, CANCELLED or ERROR.
verdictstring | nullnull while it runs. A page compared is PASS or FAIL; a page not compared, or whose comparison failed, gets the verdict the environment's verdict config gives its case: PASS, WARN, FAIL or SKIPPED.
cancellation_reasonstring | nullWhen CANCELLED, why — see below. null otherwise.
errorobject | nullWhen the comparison failed: code and message — see when a page comparison fails. null otherwise.
reference_capture_task_iduuid string | nullThe reference capture task; null when that side has none.
candidate_capture_task_iduuid string | nullThe candidate capture task; null when that side has none.

cancellation_reason

A page is not compared when the two sides do not both have a good capture of it. Its verdict comes from the environment's verdict config — see page comparisons.

ValueMeaning
NEW_PAGEThe page is in the candidate only.
REMOVED_PAGEThe page is in the reference only.
REFERENCE_ERRORThe reference capture of the page failed.
CANDIDATE_ERRORThe candidate capture of the page failed.
BOTH_ERRORBoth captures of the page failed.
UNIDENTIFIED_PAGEA capture's page was deleted, so it cannot be matched across the two sides. Always SKIPPED.

The comparison

These are filled in once the comparison has run, and null before, or when it failed or did not run.

FieldTypeValue
compared_bystring | nullpixels when the screenshots were compared pixel by pixel; hash when they were the same file, byte for byte — 100% match, no diff image.
score.diff_pctnumberThe share of pixels that differ, from 0 to 100.
score.match_pctnumber100 - diff_pct, the figure the dashboard shows.
score.diff_pixelsnumber | nullHow many pixels differ.
score.tolerated_pixelsnumber | nullPixels that differed within the tolerance, so were not counted.
score.pixel_delta_maxnumber | nullThe largest colour difference of a pixel, from 0 to 255.
config.comparison_tolerancenumber | nullThe colour difference, 0 to 255, up to which a pixel counts as unchanged.
config.diff_threshold_pctnumber | nullAbove this diff_pct, the page fails. null: no such limit.
config.max_diff_pixel_countnumber | nullAbove this diff_pixels, the page fails. null: no such limit.
config_sourcesobject | nullFor each of the three settings, where its value came from: project (the project's diff config) or page (the page's override).
sizes.reference, sizes.candidateobjectwidth and height of each screenshot, in pixels.
sizes.diffobject | nullwidth and height of the diff image; null without one.
pixel_delta_histogramobject | nullFor each colour difference from "1" to "255", how many pixels differed by that much. Differences that did not occur are left out: {} means no pixel differed.

config is as it was when the page was compared: changing the diff config later does not change it.

The diff image

FieldTypeValue
diff_imageobject | nullThe diff image; null when there is none, as for a hash comparison.
diff_image.urlstring | nullA signed address to download it from, valid until expires_at.
diff_image.expires_attimestamp | nullWhen url stops working: up to two hours after the call. Trust this date, not a fixed delay.
diff_image.bytesnumber | nullIts size, approximately.

As for screenshots, download it while url is valid, or read the task again for a fresh one.