Healthchecks

Healthchecks

Methods

list(, ): <>
get/zones/{zone_id}/healthchecks

List configured health checks.

get(, , ):
get/zones/{zone_id}/healthchecks/{healthcheck_id}

Fetch a single configured health check.

create(, ):
post/zones/{zone_id}/healthchecks

Create a new health check.

update(, , ):
put/zones/{zone_id}/healthchecks/{healthcheck_id}

Update a configured health check.

edit(, , ):
patch/zones/{zone_id}/healthchecks/{healthcheck_id}

Patch a configured health check.

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Accepted Permissions (at least one required)

Health Checks Write

Parameters
healthcheckId: string
(maxLength: 32)

Identifier

zone_id: string
(maxLength: 32)

Path param: Identifier

address: string

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

name: string

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

check_regions?: Array<> | null

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

consecutive_fails?: number

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

consecutive_successes?: number

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

description?: string

Body param: A human-readable description of the health check.

http_config?: | null

Body param: Parameters specific to an HTTP or HTTPS health check.

interval?: number

Body param: 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?: number

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

suspended?: boolean

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

tcp_config?: | null

Body param: Parameters specific to TCP health check.

timeout?: number

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

type?: string

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

Returns
id?: string
(maxLength: 32)

Identifier

address?: string

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

check_regions?: Array<> | null

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

consecutive_fails?: number
(default: 1)

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

consecutive_successes?: number
(default: 1)

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

created_on?: string
(format: date-time)
description?: string

A human-readable description of the health check.

failure_reason?: string

The current failure reason if status is unhealthy.

http_config?: | null

Parameters specific to an HTTP or HTTPS health check.

interval?: number
(default: 60)

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?: string
(format: date-time)
name?: string

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

retries?: number
(default: 2)

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

status?: "unknown" | "healthy" | "unhealthy" | 1 more...

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

suspended?: boolean

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

tcp_config?: | null

Parameters specific to TCP health check.

timeout?: number
(default: 5)

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

type?: string
(default: "HTTP")

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

Request example
200Example
delete(, , ):
delete/zones/{zone_id}/healthchecks/{healthcheck_id}

Delete a health check.

Domain types

CheckRegion = "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).

Healthcheck{…}
HTTPConfiguration{…}

Parameters specific to an HTTP or HTTPS health check.

QueryHealthcheck{…}
TCPConfiguration{…}

Parameters specific to TCP health check.

Healthchecks

Previews

Healthchecks.Previews

Methods

get(, , ):
get/zones/{zone_id}/healthchecks/preview/{healthcheck_id}

Fetch a single configured health check preview.

create(, ):
post/zones/{zone_id}/healthchecks/preview

Create a new preview health check.

delete(, , ):
delete/zones/{zone_id}/healthchecks/preview/{healthcheck_id}

Delete a health check.