Create Preview Health Check

Create a new preview health check.

/zones/{zone_identifier}/healthchecks/preview

post

Health Checks

health-checks-create-preview-health-check

Debug "planAvailability"

{
  "business": true,
  "enterprise": true,
  "free": false,
  "pro": true
}

Debug "tokenPermissions"

null

Debug "parameters"

[
  {
    "in": "path",
    "name": "zone_identifier",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "properties": {
          "address": {
            "description": "The hostname or IP address of the origin server to run health checks on.",
            "example": "www.example.com",
            "type": "string"
          },
          "check_regions": {
            "description": "A list of regions from which to run health checks. Null means Cloudflare will pick a default region.",
            "example": [
              "WEU",
              "ENAM"
            ],
            "items": {
              "description": "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).",
              "enum": [
                "WNAM",
                "ENAM",
                "WEU",
                "EEU",
                "NSAM",
                "SSAM",
                "OC",
                "ME",
                "NAF",
                "SAF",
                "IN",
                "SEAS",
                "NEAS",
                "ALL_REGIONS"
              ],
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "consecutive_fails": {
            "default": 1,
            "description": "The number of consecutive fails required from a health check before changing the health to unhealthy.",
            "type": "integer"
          },
          "consecutive_successes": {
            "default": 1,
            "description": "The number of consecutive successes required from a health check before changing the health to healthy.",
            "type": "integer"
          },
          "description": {
            "description": "A human-readable description of the health check.",
            "example": "Health check for www.example.com",
            "type": "string"
          },
          "http_config": {
            "description": "Parameters specific to an HTTP or HTTPS health check.",
            "nullable": true,
            "properties": {
              "allow_insecure": {
                "default": false,
                "description": "Do not validate the certificate when the health check uses HTTPS.",
                "type": "boolean"
              },
              "expected_body": {
                "description": "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.",
                "example": "success",
                "type": "string"
              },
              "expected_codes": {
                "default": "200",
                "description": "The expected HTTP response codes (e.g. \"200\") or code ranges (e.g. \"2xx\" for all codes starting with 2) of the health check.",
                "example": [
                  "2xx",
                  "302"
                ],
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              },
              "follow_redirects": {
                "default": false,
                "description": "Follow redirects if the origin returns a 3xx status code.",
                "type": "boolean"
              },
              "header": {
                "description": "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.",
                "example": {
                  "Host": [
                    "example.com"
                  ],
                  "X-App-ID": [
                    "abc123"
                  ]
                },
                "nullable": true,
                "type": "object"
              },
              "method": {
                "default": "GET",
                "description": "The HTTP method to use for the health check.",
                "enum": [
                  "GET",
                  "HEAD"
                ],
                "type": "string"
              },
              "path": {
                "default": "/",
                "description": "The endpoint path to health check against.",
                "example": "/health",
                "type": "string"
              },
              "port": {
                "default": 80,
                "description": "Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "interval": {
            "default": 60,
            "description": "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.",
            "type": "integer"
          },
          "name": {
            "description": "A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.",
            "example": "server-1",
            "type": "string"
          },
          "retries": {
            "default": 2,
            "description": "The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.",
            "type": "integer"
          },
          "suspended": {
            "default": false,
            "description": "If suspended, no health checks are sent to the origin.",
            "type": "boolean"
          },
          "tcp_config": {
            "description": "Parameters specific to TCP health check.",
            "nullable": true,
            "properties": {
              "method": {
                "default": "connection_established",
                "description": "The TCP connection method to use for the health check.",
                "enum": [
                  "connection_established"
                ],
                "type": "string"
              },
              "port": {
                "default": 80,
                "description": "Port number to connect to for the health check. Defaults to 80.",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "timeout": {
            "default": 5,
            "description": "The timeout (in seconds) before marking the health check as failed.",
            "type": "integer"
          },
          "type": {
            "default": "HTTP",
            "description": "The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.",
            "example": "HTTPS",
            "type": "string"
          }
        },
        "required": [
          "name",
          "address"
        ],
        "type": "object"
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "items": {},
                          "type": "array"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "oneOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "properties": {
                    "address": {
                      "description": "The hostname or IP address of the origin server to run health checks on.",
                      "example": "www.example.com",
                      "type": "string"
                    },
                    "check_regions": {
                      "description": "A list of regions from which to run health checks. Null means Cloudflare will pick a default region.",
                      "example": [
                        "WEU",
                        "ENAM"
                      ],
                      "items": {
                        "description": "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).",
                        "enum": [
                          "WNAM",
                          "ENAM",
                          "WEU",
                          "EEU",
                          "NSAM",
                          "SSAM",
                          "OC",
                          "ME",
                          "NAF",
                          "SAF",
                          "IN",
                          "SEAS",
                          "NEAS",
                          "ALL_REGIONS"
                        ],
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    },
                    "consecutive_fails": {
                      "default": 1,
                      "description": "The number of consecutive fails required from a health check before changing the health to unhealthy.",
                      "type": "integer"
                    },
                    "consecutive_successes": {
                      "default": 1,
                      "description": "The number of consecutive successes required from a health check before changing the health to healthy.",
                      "type": "integer"
                    },
                    "created_on": {
                      "example": "2014-01-01T05:20:00.12345Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "description": {
                      "description": "A human-readable description of the health check.",
                      "example": "Health check for www.example.com",
                      "type": "string"
                    },
                    "failure_reason": {
                      "description": "The current failure reason if status is unhealthy.",
                      "example": "",
                      "readOnly": true,
                      "type": "string"
                    },
                    "http_config": {
                      "description": "Parameters specific to an HTTP or HTTPS health check.",
                      "nullable": true,
                      "properties": {
                        "allow_insecure": {
                          "default": false,
                          "description": "Do not validate the certificate when the health check uses HTTPS.",
                          "type": "boolean"
                        },
                        "expected_body": {
                          "description": "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.",
                          "example": "success",
                          "type": "string"
                        },
                        "expected_codes": {
                          "default": "200",
                          "description": "The expected HTTP response codes (e.g. \"200\") or code ranges (e.g. \"2xx\" for all codes starting with 2) of the health check.",
                          "example": [
                            "2xx",
                            "302"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "nullable": true,
                          "type": "array"
                        },
                        "follow_redirects": {
                          "default": false,
                          "description": "Follow redirects if the origin returns a 3xx status code.",
                          "type": "boolean"
                        },
                        "header": {
                          "description": "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.",
                          "example": {
                            "Host": [
                              "example.com"
                            ],
                            "X-App-ID": [
                              "abc123"
                            ]
                          },
                          "nullable": true,
                          "type": "object"
                        },
                        "method": {
                          "default": "GET",
                          "description": "The HTTP method to use for the health check.",
                          "enum": [
                            "GET",
                            "HEAD"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "default": "/",
                          "description": "The endpoint path to health check against.",
                          "example": "/health",
                          "type": "string"
                        },
                        "port": {
                          "default": 80,
                          "description": "Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "id": {
                      "description": "Identifier",
                      "example": "023e105f4ecef8ad9ca31a8372d0c353",
                      "maxLength": 32,
                      "readOnly": true,
                      "type": "string"
                    },
                    "interval": {
                      "default": 60,
                      "description": "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.",
                      "type": "integer"
                    },
                    "modified_on": {
                      "example": "2014-01-01T05:20:00.12345Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "name": {
                      "description": "A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.",
                      "example": "server-1",
                      "type": "string"
                    },
                    "retries": {
                      "default": 2,
                      "description": "The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.",
                      "type": "integer"
                    },
                    "status": {
                      "description": "The current status of the origin server according to the health check.",
                      "enum": [
                        "unknown",
                        "healthy",
                        "unhealthy",
                        "suspended"
                      ],
                      "example": "healthy",
                      "readOnly": true,
                      "type": "string"
                    },
                    "suspended": {
                      "default": false,
                      "description": "If suspended, no health checks are sent to the origin.",
                      "type": "boolean"
                    },
                    "tcp_config": {
                      "description": "Parameters specific to TCP health check.",
                      "nullable": true,
                      "properties": {
                        "method": {
                          "default": "connection_established",
                          "description": "The TCP connection method to use for the health check.",
                          "enum": [
                            "connection_established"
                          ],
                          "type": "string"
                        },
                        "port": {
                          "default": 80,
                          "description": "Port number to connect to for the health check. Defaults to 80.",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "timeout": {
                      "default": 5,
                      "description": "The timeout (in seconds) before marking the health check as failed.",
                      "type": "integer"
                    },
                    "type": {
                      "default": "HTTP",
                      "description": "The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.",
                      "example": "HTTPS",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            }
          ]
        }
      }
    },
    "description": "Create Preview Health Check response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "allOf": [
                    {
                      "properties": {
                        "errors": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "messages": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "items": {},
                              "type": "array"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "success": {
                          "description": "Whether the API call was successful",
                          "enum": [
                            true
                          ],
                          "example": true,
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "success",
                        "errors",
                        "messages",
                        "result"
                      ],
                      "type": "object"
                    },
                    {
                      "properties": {
                        "result": {
                          "oneOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "properties": {
                        "address": {
                          "description": "The hostname or IP address of the origin server to run health checks on.",
                          "example": "www.example.com",
                          "type": "string"
                        },
                        "check_regions": {
                          "description": "A list of regions from which to run health checks. Null means Cloudflare will pick a default region.",
                          "example": [
                            "WEU",
                            "ENAM"
                          ],
                          "items": {
                            "description": "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).",
                            "enum": [
                              "WNAM",
                              "ENAM",
                              "WEU",
                              "EEU",
                              "NSAM",
                              "SSAM",
                              "OC",
                              "ME",
                              "NAF",
                              "SAF",
                              "IN",
                              "SEAS",
                              "NEAS",
                              "ALL_REGIONS"
                            ],
                            "type": "string"
                          },
                          "nullable": true,
                          "type": "array"
                        },
                        "consecutive_fails": {
                          "default": 1,
                          "description": "The number of consecutive fails required from a health check before changing the health to unhealthy.",
                          "type": "integer"
                        },
                        "consecutive_successes": {
                          "default": 1,
                          "description": "The number of consecutive successes required from a health check before changing the health to healthy.",
                          "type": "integer"
                        },
                        "created_on": {
                          "example": "2014-01-01T05:20:00.12345Z",
                          "format": "date-time",
                          "readOnly": true,
                          "type": "string"
                        },
                        "description": {
                          "description": "A human-readable description of the health check.",
                          "example": "Health check for www.example.com",
                          "type": "string"
                        },
                        "failure_reason": {
                          "description": "The current failure reason if status is unhealthy.",
                          "example": "",
                          "readOnly": true,
                          "type": "string"
                        },
                        "http_config": {
                          "description": "Parameters specific to an HTTP or HTTPS health check.",
                          "nullable": true,
                          "properties": {
                            "allow_insecure": {
                              "default": false,
                              "description": "Do not validate the certificate when the health check uses HTTPS.",
                              "type": "boolean"
                            },
                            "expected_body": {
                              "description": "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.",
                              "example": "success",
                              "type": "string"
                            },
                            "expected_codes": {
                              "default": "200",
                              "description": "The expected HTTP response codes (e.g. \"200\") or code ranges (e.g. \"2xx\" for all codes starting with 2) of the health check.",
                              "example": [
                                "2xx",
                                "302"
                              ],
                              "items": {
                                "type": "string"
                              },
                              "nullable": true,
                              "type": "array"
                            },
                            "follow_redirects": {
                              "default": false,
                              "description": "Follow redirects if the origin returns a 3xx status code.",
                              "type": "boolean"
                            },
                            "header": {
                              "description": "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.",
                              "example": {
                                "Host": [
                                  "example.com"
                                ],
                                "X-App-ID": [
                                  "abc123"
                                ]
                              },
                              "nullable": true,
                              "type": "object"
                            },
                            "method": {
                              "default": "GET",
                              "description": "The HTTP method to use for the health check.",
                              "enum": [
                                "GET",
                                "HEAD"
                              ],
                              "type": "string"
                            },
                            "path": {
                              "default": "/",
                              "description": "The endpoint path to health check against.",
                              "example": "/health",
                              "type": "string"
                            },
                            "port": {
                              "default": 80,
                              "description": "Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.",
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "id": {
                          "description": "Identifier",
                          "example": "023e105f4ecef8ad9ca31a8372d0c353",
                          "maxLength": 32,
                          "readOnly": true,
                          "type": "string"
                        },
                        "interval": {
                          "default": 60,
                          "description": "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.",
                          "type": "integer"
                        },
                        "modified_on": {
                          "example": "2014-01-01T05:20:00.12345Z",
                          "format": "date-time",
                          "readOnly": true,
                          "type": "string"
                        },
                        "name": {
                          "description": "A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.",
                          "example": "server-1",
                          "type": "string"
                        },
                        "retries": {
                          "default": 2,
                          "description": "The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.",
                          "type": "integer"
                        },
                        "status": {
                          "description": "The current status of the origin server according to the health check.",
                          "enum": [
                            "unknown",
                            "healthy",
                            "unhealthy",
                            "suspended"
                          ],
                          "example": "healthy",
                          "readOnly": true,
                          "type": "string"
                        },
                        "suspended": {
                          "default": false,
                          "description": "If suspended, no health checks are sent to the origin.",
                          "type": "boolean"
                        },
                        "tcp_config": {
                          "description": "Parameters specific to TCP health check.",
                          "nullable": true,
                          "properties": {
                            "method": {
                              "default": "connection_established",
                              "description": "The TCP connection method to use for the health check.",
                              "enum": [
                                "connection_established"
                              ],
                              "type": "string"
                            },
                            "port": {
                              "default": 80,
                              "description": "Port number to connect to for the health check. Defaults to 80.",
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "timeout": {
                          "default": 5,
                          "description": "The timeout (in seconds) before marking the health check as failed.",
                          "type": "integer"
                        },
                        "type": {
                          "default": "HTTP",
                          "description": "The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.",
                          "example": "HTTPS",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              ]
            },
            {
              "properties": {
                "errors": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": [
                    {
                      "code": 7003,
                      "message": "No route for the URI"
                    }
                  ],
                  "minLength": 1
                },
                "messages": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": []
                },
                "result": {
                  "enum": [
                    null
                  ],
                  "nullable": true,
                  "type": "object"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    false
                  ],
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Create Preview Health Check response failure"
  }
}

Debug "security"

[
  {
    "api_token": []
  },
  {
    "api_email": [],
    "api_key": []
  }
]