Visual

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

Endpoints

POST
GET

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"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0.1,
"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": {}
}

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"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"classification_reason": "string",
"diff_percentage": 0.1,
"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": {}
}

List all visual review runs tolerated hashes

List known tolerated hashes for a snapshot identifier.

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.1,
"created_at": "2019-08-24T14:15:22Z",
"source_run_id": "51116a97-0041-4601-85fc-eb599c2885fb"
}
]
}

List all visual review runs tolerated hashes

List known tolerated hashes for a snapshot identifier.

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.1,
"created_at": "2019-08-24T14:15:22Z",
"source_run_id": "51116a97-0041-4601-85fc-eb599c2885fb"
}
]
}

Community questions

Questions about this page? or post a community question.