Visual

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

Endpoints

POST
GET
GET
GET

Create visual review runs complete

Complete a run: detect removals, verify uploads, trigger diff processing.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

POST /api/projects/:project_id/visual_review/runs/:id/complete
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/complete/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"repo_id": "59e69ce7-60be-4408-9333-ec12132fc070",
"status": "string",
"run_type": "string",
"commit_sha": "string",
"branch": "string",
"pr_number": 0,
"approved": true,
"approved_at": "2019-08-24T14:15:22Z",
"summary": {
"total": 0,
"changed": 0,
"new": 0,
"removed": 0,
"unchanged": 0
},
"error_message": "string",
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"is_stale": true,
"metadata": {
"property1": null,
"property2": null
}
}

Create visual review runs complete

Complete a run: detect removals, verify uploads, trigger diff processing.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

POST /api/projects/:project_id/visual_review/runs/:id/complete
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/complete/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"repo_id": "59e69ce7-60be-4408-9333-ec12132fc070",
"status": "string",
"run_type": "string",
"commit_sha": "string",
"branch": "string",
"pr_number": 0,
"approved": true,
"approved_at": "2019-08-24T14:15:22Z",
"summary": {
"total": 0,
"changed": 0,
"new": 0,
"removed": 0,
"unchanged": 0
},
"error_message": "string",
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"is_stale": true,
"metadata": {
"property1": null,
"property2": null
}
}

List all visual review runs snapshot history

Recent change history for a snapshot identifier across runs.

Path parameters

  • id
    string
  • project_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": [
{
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"result": "string",
"branch": "string",
"commit_sha": "string",
"created_at": "2019-08-24T14:15:22Z"
}
]
}

List all visual review runs snapshot history

Recent change history for a snapshot identifier across runs.

Path parameters

  • id
    string
  • project_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": [
{
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"result": "string",
"branch": "string",
"commit_sha": "string",
"created_at": "2019-08-24T14:15:22Z"
}
]
}

List all visual review runs snapshots

Get all snapshots for a run with diff results.

Required API key scopes

visual_review:read

Path parameters

  • id
    string
  • project_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"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"diff_percentage": 0.1,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"metadata": {
"property1": null,
"property2": null
}
}
]
}

List all visual review runs snapshots

Get all snapshots for a run with diff results.

Required API key scopes

visual_review:read

Path parameters

  • id
    string
  • project_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"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"result": "string",
"diff_percentage": 0.1,
"diff_pixel_count": 0,
"review_state": "string",
"reviewed_at": "2019-08-24T14:15:22Z",
"approved_hash": "string",
"metadata": {
"property1": null,
"property2": null
}
}
]
}

Retrieve visual review runs counts

Review state counts for the runs list.

Required API key scopes

visual_review:read

Path parameters

  • project_id
    string

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

Review state counts for the runs list.

Required API key scopes

visual_review:read

Path parameters

  • project_id
    string

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.