Patch Health Check
Patch a configured health check.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Accepted Permissions (at least one required)
Body ParametersJSON
A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.
The number of consecutive fails required from a health check before changing the health to unhealthy.
The number of consecutive successes required from a health check before changing the health to healthy.
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.
Patch Health Check
curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/smart_shield/healthchecks/$HEALTHCHECK_ID \
-X PATCH \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"address": "www.example.com",
"name": "server-1",
"check_regions": [
"WEU",
"ENAM"
],
"description": "Health check for www.example.com",
"type": "HTTPS"
}'{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"address": "www.example.com",
"check_regions": [
"WEU",
"ENAM"
],
"consecutive_fails": 0,
"consecutive_successes": 0,
"created_on": "2014-01-01T05:20:00.12345Z",
"description": "Health check for www.example.com",
"failure_reason": "",
"http_config": {
"allow_insecure": true,
"expected_body": "success",
"expected_codes": [
"2xx",
"302"
],
"follow_redirects": true,
"header": {
"Host": [
"example.com"
],
"X-App-ID": [
"abc123"
]
},
"method": "GET",
"path": "/health",
"port": 0
},
"interval": 0,
"modified_on": "2014-01-01T05:20:00.12345Z",
"name": "server-1",
"retries": 0,
"status": "healthy",
"suspended": true,
"tcp_config": {
"method": "connection_established",
"port": 0
},
"timeout": 0,
"type": "HTTPS"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"address": "www.example.com",
"check_regions": [
"WEU",
"ENAM"
],
"consecutive_fails": 0,
"consecutive_successes": 0,
"created_on": "2014-01-01T05:20:00.12345Z",
"description": "Health check for www.example.com",
"failure_reason": "",
"http_config": {
"allow_insecure": true,
"expected_body": "success",
"expected_codes": [
"2xx",
"302"
],
"follow_redirects": true,
"header": {
"Host": [
"example.com"
],
"X-App-ID": [
"abc123"
]
},
"method": "GET",
"path": "/health",
"port": 0
},
"interval": 0,
"modified_on": "2014-01-01T05:20:00.12345Z",
"name": "server-1",
"retries": 0,
"status": "healthy",
"suspended": true,
"tcp_config": {
"method": "connection_established",
"port": 0
},
"timeout": 0,
"type": "HTTPS"
},
"success": true
}