Visual

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

Endpoints

GET
POST
GET
PATCH
GET
GET
POST
POST
GET
GET

List all visual review repos

List all projects for the team.

Required API key scopes

visual_review:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/repos
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/repos/

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",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}
]
}

List all visual review repos

List all projects for the team.

Required API key scopes

visual_review:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/visual_review/repos
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/repos/

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",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Create visual review repos

Create a new repo.

Required API key scopes

visual_review:write

Request parameters

  • repo_full_name
    string
  • repo_external_id
    integer

Response


Example request

POST /api/projects/:project_id/visual_review/repos
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/repos/\
-d repo_full_name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Create visual review repos

Create a new repo.

Required API key scopes

visual_review:write

Request parameters

  • repo_full_name
    string
  • repo_external_id
    integer

Response


Example request

POST /api/projects/:project_id/visual_review/repos
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/repos/\
-d repo_full_name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Retrieve visual review repos

Get a repo by ID.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id
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/repos/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Retrieve visual review repos

Get a repo by ID.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id
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/repos/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Update visual review repos

Update a repo's settings.

Required API key scopes

visual_review:write

Path parameters

  • id
    string

Request parameters

  • baseline_file_paths
    object
  • enable_pr_comments
    boolean

Response


Example request

PATCH /api/projects/:project_id/visual_review/repos/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/repos/:id/\
-d baseline_file_paths="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Update visual review repos

Update a repo's settings.

Required API key scopes

visual_review:write

Path parameters

  • id
    string

Request parameters

  • baseline_file_paths
    object
  • enable_pr_comments
    boolean

Response


Example request

PATCH /api/projects/:project_id/visual_review/repos/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/visual_review/repos/:id/\
-d baseline_file_paths="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"repo_external_id": 0,
"repo_full_name": "string",
"baseline_file_paths": {
"property1": "string",
"property2": "string"
},
"enable_pr_comments": true,
"created_at": "2019-08-24T14:15:22Z"
}

Retrieve visual review repos baselines

Snapshots overview for a repo: every identifier with a current baseline (latest non-superseded master/main run per run_type), plus tolerate counts, active quarantine state, and a 30-day stability sparkline. Capped at 5000 entries — sets truncated and returns the most recently active when exceeded. Filtering / faceting / search are all done client-side; this endpoint takes no filter query params.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id/baselines
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/repos/:id/baselines/

Example response

Status 200
RESPONSE
{
"entries": [
{
"sparkline": [
{
"clean": 0,
"tolerated": 0,
"changed": 0,
"quarantined": 0
}
],
"identifier": "string",
"run_type": "string",
"browser": "string",
"thumbnail_hash": "string",
"width": 0,
"height": 0,
"tolerate_count_30d": 0,
"tolerate_count_90d": 0,
"is_quarantined": true,
"last_run_at": "2019-08-24T14:15:22Z",
"recent_diff_avg": 0.1
}
],
"totals": {
"by_run_type": {
"property1": 0,
"property2": 0
},
"all_snapshots": 0,
"recently_tolerated": 0,
"frequently_tolerated": 0,
"currently_quarantined": 0
},
"truncated": true,
"generated_at": "2019-08-24T14:15:22Z"
}

Retrieve visual review repos baselines

Snapshots overview for a repo: every identifier with a current baseline (latest non-superseded master/main run per run_type), plus tolerate counts, active quarantine state, and a 30-day stability sparkline. Capped at 5000 entries — sets truncated and returns the most recently active when exceeded. Filtering / faceting / search are all done client-side; this endpoint takes no filter query params.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id/baselines
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/repos/:id/baselines/

Example response

Status 200
RESPONSE
{
"entries": [
{
"sparkline": [
{
"clean": 0,
"tolerated": 0,
"changed": 0,
"quarantined": 0
}
],
"identifier": "string",
"run_type": "string",
"browser": "string",
"thumbnail_hash": "string",
"width": 0,
"height": 0,
"tolerate_count_30d": 0,
"tolerate_count_90d": 0,
"is_quarantined": true,
"last_run_at": "2019-08-24T14:15:22Z",
"recent_diff_avg": 0.1
}
],
"totals": {
"by_run_type": {
"property1": 0,
"property2": 0
},
"all_snapshots": 0,
"recently_tolerated": 0,
"frequently_tolerated": 0,
"currently_quarantined": 0
},
"truncated": true,
"generated_at": "2019-08-24T14:15:22Z"
}

List all visual review repos quarantine

List quarantined identifiers. Without filter: active only. With identifier: full history.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer
  • run_type
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id/quarantine
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/repos/:id/quarantine/

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": [
{
"created_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"run_type": "string",
"reason": "string",
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

List all visual review repos quarantine

List quarantined identifiers. Without filter: active only. With identifier: full history.

Required API key scopes

visual_review:read

Path parameters

  • id
    string

Query parameters

  • identifier
    string
  • limit
    integer
  • offset
    integer
  • run_type
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:id/quarantine
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/repos/:id/quarantine/

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": [
{
"created_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"run_type": "string",
"reason": "string",
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create visual review repos quarantine

Quarantine a snapshot identifier for a specific run type.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • run_type
    string

Request parameters

  • identifier
    string
  • reason
    string
  • expires_at
    string

Response


Example request

POST /api/projects/:project_id/visual_review/repos/:id/quarantine/:run_type
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/repos/:id/quarantine/:run_type/\
-d identifier="string",\
-d reason="string"

Example response

Status 201
RESPONSE
{
"created_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"run_type": "string",
"reason": "string",
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create visual review repos quarantine

Quarantine a snapshot identifier for a specific run type.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • run_type
    string

Request parameters

  • identifier
    string
  • reason
    string
  • expires_at
    string

Response


Example request

POST /api/projects/:project_id/visual_review/repos/:id/quarantine/:run_type
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/repos/:id/quarantine/:run_type/\
-d identifier="string",\
-d reason="string"

Example response

Status 201
RESPONSE
{
"created_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"identifier": "string",
"run_type": "string",
"reason": "string",
"expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create visual review repos quarantine expire

Expire all active quarantine entries for an identifier.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • run_type
    string

Request parameters

  • identifier
    string
  • reason
    string
  • expires_at
    string

Example request

POST /api/projects/:project_id/visual_review/repos/:id/quarantine/:run_type/expire
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/repos/:id/quarantine/:run_type/expire/\
-d identifier="string",\
-d reason="string"

Example response

Status 204 No response body

Create visual review repos quarantine expire

Expire all active quarantine entries for an identifier.

Required API key scopes

visual_review:write

Path parameters

  • id
    string
  • run_type
    string

Request parameters

  • identifier
    string
  • reason
    string
  • expires_at
    string

Example request

POST /api/projects/:project_id/visual_review/repos/:id/quarantine/:run_type/expire
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/repos/:id/quarantine/:run_type/expire/\
-d identifier="string",\
-d reason="string"

Example response

Status 204 No response body

Retrieve visual review repos thumbnails

Serve a snapshot thumbnail by identifier. Returns WebP with ETag caching.

Required API key scopes

visual_review:read

Path parameters

  • id
    string
  • identifier
    string

Example request

GET /api/projects/:project_id/visual_review/repos/:id/thumbnails/:identifier
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/repos/:id/thumbnails/:identifier/

Example response

Status 200 WebP thumbnail image

Retrieve visual review repos thumbnails

Serve a snapshot thumbnail by identifier. Returns WebP with ETag caching.

Required API key scopes

visual_review:read

Path parameters

  • id
    string
  • identifier
    string

Example request

GET /api/projects/:project_id/visual_review/repos/:id/thumbnails/:identifier
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/repos/:id/thumbnails/:identifier/

Example response

Status 200 WebP thumbnail image

List all visual review repos runs

List runs in this repo, optionally filtered by review state.

Required API key scopes

visual_review:read

Path parameters

  • repo_id
    string

Query parameters

  • limit
    integer
  • offset
    integer
  • review_state
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:repo_id/runs
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/repos/:repo_id/runs/

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": [
{
"approved_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"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,
"unresolved": 0,
"tolerated_matched": 0
},
"error_message": "string",
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"is_stale": true,
"superseded_by_id": "6b86439a-ba84-4137-9924-cffddd52399a",
"metadata": {}
}
]
}

List all visual review repos runs

List runs in this repo, optionally filtered by review state.

Required API key scopes

visual_review:read

Path parameters

  • repo_id
    string

Query parameters

  • limit
    integer
  • offset
    integer
  • review_state
    string

Response


Example request

GET /api/projects/:project_id/visual_review/repos/:repo_id/runs
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/repos/:repo_id/runs/

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": [
{
"approved_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"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,
"unresolved": 0,
"tolerated_matched": 0
},
"error_message": "string",
"created_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z",
"is_stale": true,
"superseded_by_id": "6b86439a-ba84-4137-9924-cffddd52399a",
"metadata": {}
}
]
}

Community questions

Questions about this page? or post a community question.