---
title: "Creates or Updates MeshHealthCheck entity"
method: PUT
path: "/v1/mesh/control-planes/{cpId}/api/meshes/{mesh}/meshhealthchecks/{name}"
tags: ["MeshHealthCheck"]
---

# Creates or Updates MeshHealthCheck entity

`PUT /v1/mesh/control-planes/{cpId}/api/meshes/{mesh}/meshhealthchecks/{name}`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v1/mesh/control-planes/{cpId}/api/meshes/{mesh}/meshhealthchecks/{name}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

## Path parameters

- `mesh` string, required
- `name` string, required

## Request body

- MeshHealthCheckItem: MeshHealthCheck enables active health checking of services in the mesh. It periodically probes service endpoints using TCP, HTTP, or gRPC health checks to detect and remove unhealthy instances from the load balancing pool, improving overall service reliability.
  - `type` 'MeshHealthCheck', required: the type of the resource
  - `mesh` string: Mesh is the name of the Kuma mesh this resource belongs to. It may be omitted for cluster-scoped resources.
  - `kri` string: A unique identifier for this resource instance used by internal tooling and integrations. Typically derived from resource attributes and may be used for cross-references or indexing
  - `name` string, required: Name of the Kuma resource
  - `labels` object: The labels to help identity resources
  - `spec` object, required: Spec is the specification of the Kuma MeshHealthCheck resource.
    - `targetRef` object: TargetRef is a reference to the resource the policy takes an effect on. The resource could be either a real store object or virtual resource defined inplace.
      - `kind` 'Mesh' | 'MeshSubset' | 'MeshGateway' | 'MeshService' | 'MeshExternalService' | 'MeshMultiZoneService' | 'MeshServiceSubset' | 'MeshHTTPRoute' | 'Dataplane', required: Kind of the referenced resource
      - `labels` object: Labels are used to select group of MeshServices that match labels. Either Labels or Name and Namespace can be used.
      - `mesh` string: Mesh is reserved for future use to identify cross mesh resources.
      - `name` string: Name of the referenced resource. Can only be used with kinds: `MeshService`, `MeshServiceSubset` and `MeshGatewayRoute`
      - `namespace` string: Namespace specifies the namespace of target resource. If empty only resources in policy namespace will be targeted.
      - `proxyTypes` string[]: ProxyTypes specifies the data plane types that are subject to the policy. When not specified, all data plane types are targeted by the policy.
      - `sectionName` string: SectionName is used to target specific section of resource. For example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.
      - `tags` object: Tags used to select a subset of proxies by tags. Can only be used with kinds `MeshSubset` and `MeshServiceSubset`
    - `to` object[]: To list makes a match between the consumed services and corresponding configurations
      - `default` object: Default is a configuration specific to the group of destinations referenced in 'targetRef'
        - `alwaysLogHealthCheckFailures` boolean: If set to true, health check failure events will always be logged. If set to false, only the initial health check failure event will be logged. The default value is false.
        - `eventLogPath` string: Specifies the path to the file where Envoy can log health check events. If empty, no event log will be written.
        - `failTrafficOnPanic` boolean: If set to true, Envoy will not consider any hosts when the cluster is in 'panic mode'. Instead, the cluster will fail all requests as if all hosts are unhealthy. This can help avoid potentially overwhelming a failing service.
        - `grpc` object: GrpcHealthCheck defines gRPC configuration which will instruct the service the health check will be made for is a gRPC service.
          - `authority` string: The value of the :authority header in the gRPC health check request, by default name of the cluster this health check is associated with
          - `disabled` boolean: If true the GrpcHealthCheck is disabled
          - `serviceName` string: Service name parameter which will be sent to gRPC service
        - `healthyPanicThreshold` union: Allows to configure panic threshold for Envoy cluster. If not specified, the default is 50%. To disable panic mode, set to 0%. Either int or decimal represented as string. Deprecated: the setting has been moved to MeshCircuitBreaker policy, please use MeshCircuitBreaker policy instead.
          - integer
          - string
        - `healthyThreshold` integer: Number of consecutive healthy checks before considering a host healthy. If not specified then the default value is 1
        - `http` object: HttpHealthCheck defines HTTP configuration which will instruct the service the health check will be made for is an HTTP service.
          - `disabled` boolean: If true the HttpHealthCheck is disabled
          - `expectedStatuses` integer[]: List of HTTP response statuses which are considered healthy
          - `path` string: The HTTP path which will be requested during the health check (ie. /health) If not specified then the default value is "/"
          - `requestHeadersToAdd` object: The list of HTTP headers which should be added to each health check request
            - `add` object[]
              - …
            - `set` object[]
              - …
        - `initialJitter` string: If specified, Envoy will start health checking after a random time in ms between 0 and initialJitter. This only applies to the first health check.
        - `interval` string: Interval between consecutive health checks. If not specified then the default value is 1m
        - `intervalJitter` string: If specified, during every interval Envoy will add IntervalJitter to the wait time.
        - `intervalJitterPercent` integer: If specified, during every interval Envoy will add IntervalJitter * IntervalJitterPercent / 100 to the wait time. If IntervalJitter and IntervalJitterPercent are both set, both of them will be used to increase the wait time.
        - `noTrafficInterval` string: The "no traffic interval" is a special health check interval that is used when a cluster has never had traffic routed to it. This lower interval allows cluster information to be kept up to date, without sending a potentially large amount of active health checking traffic for no reason. Once a cluster has been used for traffic routing, Envoy will shift back to using the standard health check interval that is defined. Note that this interval takes precedence over any other. The default value for "no traffic interval" is 60 seconds.
        - `reuseConnection` boolean: Reuse health check connection between health checks. Default is true.
        - `tcp` object: TcpHealthCheck defines configuration for specifying bytes to send and expected response during the health check
          - `disabled` boolean: If true the TcpHealthCheck is disabled
          - `receive` string[]: List of Base64 encoded blocks of strings expected as a response. When checking the response, "fuzzy" matching is performed such that each block must be found, and in the order specified, but not necessarily contiguous. If not provided or empty, checks will be performed as "connect only" and be marked as successful when TCP connection is successfully established.
          - `send` string: Base64 encoded content of the message which will be sent during the health check to the target
        - `timeout` string: Maximum time to wait for a health check response. If not specified then the default value is 15s
        - `unhealthyThreshold` integer: Number of consecutive unhealthy checks before considering a host unhealthy. If not specified then the default value is 5
      - `targetRef` object, required: TargetRef is a reference to the resource that represents a group of destinations.
        - `kind` 'Mesh' | 'MeshSubset' | 'MeshGateway' | 'MeshService' | 'MeshExternalService' | 'MeshMultiZoneService' | 'MeshServiceSubset' | 'MeshHTTPRoute' | 'Dataplane', required: Kind of the referenced resource
        - `labels` object: Labels are used to select group of MeshServices that match labels. Either Labels or Name and Namespace can be used.
        - `mesh` string: Mesh is reserved for future use to identify cross mesh resources.
        - `name` string: Name of the referenced resource. Can only be used with kinds: `MeshService`, `MeshServiceSubset` and `MeshGatewayRoute`
        - `namespace` string: Namespace specifies the namespace of target resource. If empty only resources in policy namespace will be targeted.
        - `proxyTypes` string[]: ProxyTypes specifies the data plane types that are subject to the policy. When not specified, all data plane types are targeted by the policy.
        - `sectionName` string: SectionName is used to target specific section of resource. For example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.
        - `tags` object: Tags used to select a subset of proxies by tags. Can only be used with kinds `MeshSubset` and `MeshServiceSubset`
  - `creationTime` string, date-time: Time at which the resource was created
  - `modificationTime` string, date-time: Time at which the resource was updated

## Response `200`

Successful response

- object
  - `warnings` string[]: warnings is a list of warning messages to return to the requesting Kuma API clients. Warning messages describe a problem the client making the API request should correct or be aware of.

## Other responses

- `201`: Successful response

## Changes

- **2025-08-12** `b2800570b3e2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-beta/changes/v1/mesh/control-planes/:cpId/api/meshes/:mesh/meshhealthchecks/:name/put.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-beta.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-beta/revisions/cef0f947e9c9?raw)
