Visual

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
POST
GET
GET

List all visual review runs snapshot history

Also available via the PostHog MCP server:

  • visual-review-runs-snapshot-history-listSnapshot change history

Recent change history for a snapshot identifier across runs.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/snapshot-history
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/snapshot-history/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"snapshot_id": "163831af-8c1b-4992-a9cf-88c6306604c0",
"result": "string",
"branch": "string",
"commit_sha": "string",
"created_at": "2019-08-24T14:15:22Z",
"pr_number": 0,
"diff_percentage": 0,
"review_state": "string",
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}
]
}

List all visual review runs snapshot history

Also available via the PostHog MCP server:

  • visual-review-runs-snapshot-history-listSnapshot change history

Recent change history for a snapshot identifier across runs.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/snapshot-history
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/snapshot-history/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"snapshot_id": "163831af-8c1b-4992-a9cf-88c6306604c0",
"result": "string",
"branch": "string",
"commit_sha": "string",
"created_at": "2019-08-24T14:15:22Z",
"pr_number": 0,
"diff_percentage": 0,
"review_state": "string",
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}
]
}

List all visual review runs snapshots

Also available via the PostHog MCP server:

  • visual-review-runs-snapshots-listList run snapshots

Get all snapshots for a run with diff results.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/snapshots
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/snapshots/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"baseline_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"diff_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"cluster_summary": {
"items": [
{
"x": 0,
"y": 0,
"width": 0,
"height": 0,
"pixel_count": 0,
"centroid_x": 0.1,
"centroid_y": 0.1
}
],
"total": 0,
"truncated": true
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"tolerated_hash_id": "7019d9c2-0d1d-41e9-a8a2-90206607b139",
"is_quarantined": true,
"metadata": {},
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}
]
}

List all visual review runs snapshots

Also available via the PostHog MCP server:

  • visual-review-runs-snapshots-listList run snapshots

Get all snapshots for a run with diff results.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/snapshots
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/snapshots/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"baseline_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"diff_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"cluster_summary": {
"items": [
{
"x": 0,
"y": 0,
"width": 0,
"height": 0,
"pixel_count": 0,
"centroid_x": 0.1,
"centroid_y": 0.1
}
],
"total": 0,
"truncated": true
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"tolerated_hash_id": "7019d9c2-0d1d-41e9-a8a2-90206607b139",
"is_quarantined": true,
"metadata": {},
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}
]
}

Create visual review runs tolerate

Mark a changed snapshot as a known tolerated alternate.

Path parameters

  • id
    string

Request parameters

  • snapshot_id
    string

Response


Example request

POST /api/projects/:project_id/visual_review/runs/:id/tolerate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/tolerate/\
-d snapshot_id="string"

Example response

Status 200
RESPONSE
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"baseline_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"diff_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"cluster_summary": {
"items": [
{
"x": 0,
"y": 0,
"width": 0,
"height": 0,
"pixel_count": 0,
"centroid_x": 0.1,
"centroid_y": 0.1
}
],
"total": 0,
"truncated": true
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"tolerated_hash_id": "7019d9c2-0d1d-41e9-a8a2-90206607b139",
"is_quarantined": true,
"metadata": {},
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}

Create visual review runs tolerate

Mark a changed snapshot as a known tolerated alternate.

Path parameters

  • id
    string

Request parameters

  • snapshot_id
    string

Response


Example request

POST /api/projects/:project_id/visual_review/runs/:id/tolerate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/tolerate/\
-d snapshot_id="string"

Example response

Status 200
RESPONSE
{
"current_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"baseline_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"diff_artifact": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"content_hash": "string",
"width": 0,
"height": 0,
"download_url": "string"
},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"cluster_summary": {
"items": [
{
"x": 0,
"y": 0,
"width": 0,
"height": 0,
"pixel_count": 0,
"centroid_x": 0.1,
"centroid_y": 0.1
}
],
"total": 0,
"truncated": true
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"tolerated_hash_id": "7019d9c2-0d1d-41e9-a8a2-90206607b139",
"is_quarantined": true,
"metadata": {},
"ssim_score": 0,
"change_kind": "string",
"size_mismatch": true
}

List all visual review runs tolerated hashes

Also available via the PostHog MCP server:

  • visual-review-runs-tolerated-hashes-listList tolerated hashes

List known tolerated hashes for a snapshot identifier.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/tolerated-hashes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/tolerated-hashes/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"alternate_hash": "string",
"baseline_hash": "string",
"reason": "string",
"diff_percentage": 0,
"created_at": "2019-08-24T14:15:22Z",
"source_run_id": "51116a97-0041-4601-85fc-eb599c2885fb"
}
]
}

List all visual review runs tolerated hashes

Also available via the PostHog MCP server:

  • visual-review-runs-tolerated-hashes-listList tolerated hashes

List known tolerated hashes for a snapshot identifier.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/runs/:id/tolerated-hashes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/:id/tolerated-hashes/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"alternate_hash": "string",
"baseline_hash": "string",
"reason": "string",
"diff_percentage": 0,
"created_at": "2019-08-24T14:15:22Z",
"source_run_id": "51116a97-0041-4601-85fc-eb599c2885fb"
}
]
}

Retrieve visual review runs counts

Also available via the PostHog MCP server:

  • visual-review-runs-counts-retrieveVisual review run counts

Review state counts for the runs list.

Required API key scopes

visual_review:read

Response


Example request

GET /api/projects/:project_id/visual_review/runs/counts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/counts/

Example response

Status 200
RESPONSE
{
"needs_review": 0,
"clean": 0,
"processing": 0,
"stale": 0
}

Retrieve visual review runs counts

Also available via the PostHog MCP server:

  • visual-review-runs-counts-retrieveVisual review run counts

Review state counts for the runs list.

Required API key scopes

visual_review:read

Response


Example request

GET /api/projects/:project_id/visual_review/runs/counts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/runs/counts/

Example response

Status 200
RESPONSE
{
"needs_review": 0,
"clean": 0,
"processing": 0,
"stale": 0
}

Community questions

Questions about this page? or post a community question.