Skip to content
Start here

Healthchecks

List Health Checks
healthchecks.list(HealthcheckListParams**kwargs) -> SyncV4PagePaginationArray[Healthcheck]
GET/zones/{zone_id}/healthchecks
Health Check Details
healthchecks.get(strhealthcheck_id, HealthcheckGetParams**kwargs) -> Healthcheck
GET/zones/{zone_id}/healthchecks/{healthcheck_id}
Create Health Check
healthchecks.create(HealthcheckCreateParams**kwargs) -> Healthcheck
POST/zones/{zone_id}/healthchecks
Update Health Check
healthchecks.update(strhealthcheck_id, HealthcheckUpdateParams**kwargs) -> Healthcheck
PUT/zones/{zone_id}/healthchecks/{healthcheck_id}
Patch Health Check
healthchecks.edit(strhealthcheck_id, HealthcheckEditParams**kwargs) -> Healthcheck
PATCH/zones/{zone_id}/healthchecks/{healthcheck_id}
Delete Health Check
healthchecks.delete(strhealthcheck_id, HealthcheckDeleteParams**kwargs) -> HealthcheckDeleteResponse
DELETE/zones/{zone_id}/healthchecks/{healthcheck_id}
ModelsExpand Collapse
Literal["WNAM", "ENAM", "WEU", 11 more]

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

One of the following:
"WNAM"
"ENAM"
"WEU"
"EEU"
"NSAM"
"SSAM"
"OC"
"ME"
"NAF"
"SAF"
"IN"
"SEAS"
"NEAS"
"ALL_REGIONS"
class Healthcheck:
id: Optional[str]

Identifier

maxLength32
address: Optional[str]

The hostname or IP address of the origin server to run health checks on.

check_regions: Optional[List[CheckRegion]]

A list of regions from which to run health checks. Null means Cloudflare will pick a default region.

One of the following:
"WNAM"
"ENAM"
"WEU"
"EEU"
"NSAM"
"SSAM"
"OC"
"ME"
"NAF"
"SAF"
"IN"
"SEAS"
"NEAS"
"ALL_REGIONS"
consecutive_fails: Optional[int]

The number of consecutive fails required from a health check before changing the health to unhealthy.

consecutive_successes: Optional[int]

The number of consecutive successes required from a health check before changing the health to healthy.

created_on: Optional[datetime]
formatdate-time
description: Optional[str]

A human-readable description of the health check.

failure_reason: Optional[str]

The current failure reason if status is unhealthy.

http_config: Optional[HTTPConfiguration]

Parameters specific to an HTTP or HTTPS health check.

interval: Optional[int]

The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.

modified_on: Optional[datetime]
formatdate-time
name: Optional[str]

A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.

retries: Optional[int]

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

status: Optional[Literal["unknown", "healthy", "unhealthy", "suspended"]]

The current status of the origin server according to the health check.

One of the following:
"unknown"
"healthy"
"unhealthy"
"suspended"
suspended: Optional[bool]

If suspended, no health checks are sent to the origin.

tcp_config: Optional[TCPConfiguration]

Parameters specific to TCP health check.

timeout: Optional[int]

The timeout (in seconds) before marking the health check as failed.

type: Optional[str]

The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.

class HTTPConfiguration:

Parameters specific to an HTTP or HTTPS health check.

allow_insecure: Optional[bool]

Do not validate the certificate when the health check uses HTTPS.

expected_body: Optional[str]

A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.

expected_codes: Optional[List[str]]

The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.

follow_redirects: Optional[bool]

Follow redirects if the origin returns a 3xx status code.

header: Optional[Dict[str, List[str]]]

The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden.

method: Optional[Literal["GET", "HEAD"]]

The HTTP method to use for the health check.

One of the following:
"GET"
"HEAD"
path: Optional[str]

The endpoint path to health check against.

port: Optional[int]

Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.

class QueryHealthcheck:
address: str

The hostname or IP address of the origin server to run health checks on.

name: str

A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.

check_regions: Optional[List[CheckRegion]]

A list of regions from which to run health checks. Null means Cloudflare will pick a default region.

One of the following:
"WNAM"
"ENAM"
"WEU"
"EEU"
"NSAM"
"SSAM"
"OC"
"ME"
"NAF"
"SAF"
"IN"
"SEAS"
"NEAS"
"ALL_REGIONS"
consecutive_fails: Optional[int]

The number of consecutive fails required from a health check before changing the health to unhealthy.

consecutive_successes: Optional[int]

The number of consecutive successes required from a health check before changing the health to healthy.

description: Optional[str]

A human-readable description of the health check.

http_config: Optional[HTTPConfiguration]

Parameters specific to an HTTP or HTTPS health check.

interval: Optional[int]

The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.

retries: Optional[int]

The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.

suspended: Optional[bool]

If suspended, no health checks are sent to the origin.

tcp_config: Optional[TCPConfiguration]

Parameters specific to TCP health check.

timeout: Optional[int]

The timeout (in seconds) before marking the health check as failed.

type: Optional[str]

The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.

class TCPConfiguration:

Parameters specific to TCP health check.

method: Optional[Literal["connection_established"]]

The TCP connection method to use for the health check.

port: Optional[int]

Port number to connect to for the health check. Defaults to 80.

class HealthcheckDeleteResponse:
id: Optional[str]

Identifier

maxLength32

HealthchecksPreviews

Health Check Preview Details
healthchecks.previews.get(strhealthcheck_id, PreviewGetParams**kwargs) -> Healthcheck
GET/zones/{zone_id}/healthchecks/preview/{healthcheck_id}
Create Preview Health Check
healthchecks.previews.create(PreviewCreateParams**kwargs) -> Healthcheck
POST/zones/{zone_id}/healthchecks/preview
Delete Preview Health Check
healthchecks.previews.delete(strhealthcheck_id, PreviewDeleteParams**kwargs) -> PreviewDeleteResponse
DELETE/zones/{zone_id}/healthchecks/preview/{healthcheck_id}
ModelsExpand Collapse
class PreviewDeleteResponse:
id: Optional[str]

Identifier

maxLength32