Search + K

Command Palette

Search for a command to run...

Sign In

Patch Monitor

PATCH /accounts/{account_id}/load_balancers/monitors/{monitor_id}
Copy endpoint
https://api.cloudflare.com/client/v4

Apply changes to an existing monitor, overwriting the supplied properties.

Parameters

path Path Parameters

Name Type
monitor_id required
type LoadBalancingIdentifier = string
account_id required
type LoadBalancingComponentsSchemasIdentifier = string

Request Body

application/json required
interface LoadBalancingMonitorEditable {
allow_insecure?: LoadBalancingAllowInsecure

Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.

type LoadBalancingAllowInsecure = boolean
;
consecutive_down?: LoadBalancingConsecutiveDown

To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.

type LoadBalancingConsecutiveDown = number
;
consecutive_up?: LoadBalancingConsecutiveUp

To be marked healthy the monitored origin must pass this healthcheck N consecutive times.

type LoadBalancingConsecutiveUp = number
;
description?: LoadBalancingDescription

Object description.

type LoadBalancingDescription = string
;
expected_body?: LoadBalancingExpectedBody

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. This parameter is only valid for HTTP and HTTPS monitors.

type LoadBalancingExpectedBody = string
;
expected_codes?: LoadBalancingExpectedCodes

The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.

type LoadBalancingExpectedCodes = string
;
follow_redirects?: LoadBalancingFollowRedirects

Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.

type LoadBalancingFollowRedirects = boolean
;
header?: LoadBalancingHeader

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. This parameter is only valid for HTTP and HTTPS monitors.

interface LoadBalancingHeader {
[key: string]: string[];
}
;
interval?: LoadBalancingInterval

The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.

type LoadBalancingInterval = number
;
method?: LoadBalancingMethod

The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.

type LoadBalancingMethod = string
;
path?: LoadBalancingPath

The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.

type LoadBalancingPath = string
;
port?: LoadBalancingPort

The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).

type LoadBalancingPort = number
;
probe_zone?: LoadBalancingProbeZone

Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.

type LoadBalancingProbeZone = string
;
retries?: LoadBalancingRetries

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

type LoadBalancingRetries = number
;
timeout?: LoadBalancingTimeout

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

type LoadBalancingTimeout = number
;
type?: LoadBalancingType

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

type LoadBalancingType = "http" | "https" | "tcp" | "udp_icmp" | "icmp_ping" | "smtp"
;
}

Responses

200 application/json

Patch Monitor response.

type LoadBalancingMonitorResponseSingle = type LoadBalancingApiResponseSingle = never & { result?: LoadBalancingMonitor
type LoadBalancingMonitor = LoadBalancingMonitorEditable & { created_on?: LoadBalancingTimestamp;id?: LoadBalancingIdentifier;modified_on?: LoadBalancingTimestamp; }
; }

Client Errors

4XX application/json

Patch Monitor response failure.

type LoadBalancingMonitorResponseSingle = type LoadBalancingApiResponseSingle = never & { result?: LoadBalancingMonitor
type LoadBalancingMonitor = LoadBalancingMonitorEditable & { created_on?: LoadBalancingTimestamp;id?: LoadBalancingIdentifier;modified_on?: LoadBalancingTimestamp; }
; }
& interface LoadBalancingApiResponseCommonFailure {
errors: LoadBalancingMessages
type LoadBalancingMessages = { code: number;message: string; }[]
;
messages: LoadBalancingMessages
type LoadBalancingMessages = { code: number;message: string; }[]
;
result: null;
success: false;
}