Health

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

Endpoints

GET
GET
PATCH
POST
POST
GET
GET
GET
PATCH
POST
POST
GET

List all environments health issues

Lists health issues detected across all of this project's PostHog health checks (outdated SDKs, data warehouse sync failures, missing web analytics events, ingestion warnings, and more). Filter by status, severity, kind, or dismissed state.

Required API key scopes

health_issue:read

Query parameters

  • dismissed
    boolean
  • kind
    string
  • limit
    integer
  • offset
    integer
  • severity
    string
  • status
    string

Response


Example request

GET /api/environments/:environment_id/health_issues
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/health_issues/

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",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve environments health issues

Fetches a single health issue, enriched with the owning check's rendered explanation: a title, a one-line summary of what's wrong, a deep link to the relevant page, and remediation guidance for how to fix it.

Required API key scopes

health_issue:read

Path parameters

  • id
    string

Response


Example request

GET /api/environments/:environment_id/health_issues/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/health_issues/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z",
"title": "string",
"summary": "string",
"link": "string",
"remediation": {
"human": "string",
"agent": "string"
}
}

Update environments health issues

Required API key scopes

health_issue:write

Path parameters

  • id
    string

Request parameters

  • dismissed
    boolean

Response


Example request

PATCH /api/environments/:environment_id/health_issues/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/health_issues/:id/\
-d kind="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}

Create environments health issues resolve

Path parameters

  • id
    string

Request parameters

  • dismissed
    boolean

Response


Example request

POST /api/environments/:environment_id/health_issues/:id/resolve
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/environments/:environment_id/health_issues/:id/resolve/\
-d kind="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}

Create environments health issues refresh

Required API key scopes

health_issue:write

Example request

POST /api/environments/:environment_id/health_issues/refresh
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/environments/:environment_id/health_issues/refresh/

Example response

Status 202 Health check refresh jobs scheduled for the team.
Status 429 Refresh was triggered recently; try again later.

Retrieve environments health issues summary

Returns aggregated counts of active, non-dismissed health issues for the project, broken down by severity and by kind. Use for a quick overview of overall project health before drilling in with the list endpoint.

Required API key scopes

health_issue:read

Response


Example request

GET /api/environments/:environment_id/health_issues/summary
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/health_issues/summary/

Example response

Status 200
RESPONSE
{
"total": 0,
"by_severity": {
"property1": 0,
"property2": 0
},
"by_kind": {
"property1": 0,
"property2": 0
}
}

List all health issues

Lists health issues detected across all of this project's PostHog health checks (outdated SDKs, data warehouse sync failures, missing web analytics events, ingestion warnings, and more). Filter by status, severity, kind, or dismissed state.

Required API key scopes

health_issue:read

Query parameters

  • dismissed
    boolean
  • kind
    string
  • limit
    integer
  • offset
    integer
  • severity
    string
  • status
    string

Response


Example request

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

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",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve health issues

Fetches a single health issue, enriched with the owning check's rendered explanation: a title, a one-line summary of what's wrong, a deep link to the relevant page, and remediation guidance for how to fix it.

Required API key scopes

health_issue:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z",
"title": "string",
"summary": "string",
"link": "string",
"remediation": {
"human": "string",
"agent": "string"
}
}

Update health issues

Required API key scopes

health_issue:write

Path parameters

  • id
    string

Request parameters

  • dismissed
    boolean

Response


Example request

PATCH /api/projects/:project_id/health_issues/: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/health_issues/:id/\
-d kind="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}

Create health issues resolve

Path parameters

  • id
    string

Request parameters

  • dismissed
    boolean

Response


Example request

POST /api/projects/:project_id/health_issues/:id/resolve
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/health_issues/:id/resolve/\
-d kind="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "string",
"severity": "critical",
"status": "active",
"dismissed": true,
"payload": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"resolved_at": "2019-08-24T14:15:22Z"
}

Create health issues refresh

Required API key scopes

health_issue:write

Example request

POST /api/projects/:project_id/health_issues/refresh
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/health_issues/refresh/

Example response

Status 202 Health check refresh jobs scheduled for the team.
Status 429 Refresh was triggered recently; try again later.

Retrieve health issues summary

Returns aggregated counts of active, non-dismissed health issues for the project, broken down by severity and by kind. Use for a quick overview of overall project health before drilling in with the list endpoint.

Required API key scopes

health_issue:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"total": 0,
"by_severity": {
"property1": 0,
"property2": 0
},
"by_kind": {
"property1": 0,
"property2": 0
}
}

Community questions

Questions about this page? or post a community question.