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

# Creates or Updates MeshService entity

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

## Request

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

## Path parameters

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

## Request body

- MeshServiceItem: MeshService represents a service in the mesh with its connectivity and health information. It defines service endpoints by selecting data plane proxies through labels or direct references, configures service ports and protocols, tracks service availability and health status, and provides automatic VIP assignment and hostname generation for service discovery.
  - `type` 'MeshService', 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
  - `snis` object[]: List of SNIs (Server Name Indication) advertised by xDS for this destination, one entry per port, sorted by port ascending. Present for MeshService, MeshMultiZoneService and MeshExternalService.
    - `port` integer, required: The destination port this SNI corresponds to.
    - `sni` string, required: The SNI string advertised by xDS for this port.
  - `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 MeshService resource.
    - `identities` object[]
      - `type` 'ServiceTag' | 'SpiffeID', required
      - `value` string, required
    - `ports` object[]
      - `appProtocol` string: Protocol identifies a protocol supported by a service.
      - `name` string
      - `port` integer, required
      - `targetPort` union
        - integer
        - string
    - `selector` object
      - `dataplaneLabels` object
        - `matchLabels` object
      - `dataplaneRef` object
        - `name` string
      - `dataplaneTags` object
    - `state` 'Available' | 'Unavailable': State of MeshService. Available if there is at least one healthy endpoint. Otherwise, Unavailable. It's used for cross zone communication to check if we should send traffic to it, when MeshService is aggregated into MeshMultiZoneService.
  - `creationTime` string, date-time: Time at which the resource was created
  - `modificationTime` string, date-time: Time at which the resource was updated
  - `status` object: Status is the current status of the Kuma MeshService resource.
    - `addresses` object[]
      - `hostname` string
      - `hostnameGeneratorRef` object
        - `coreName` string, required
      - `origin` string
    - `dataplaneProxies` object: Data plane proxies statistics selected by this MeshService.
      - `connected` integer: Number of data plane proxies connected to the zone control plane
      - `healthy` integer: Number of data plane proxies with all healthy inbounds selected by this MeshService.
      - `total` integer: Total number of data plane proxies.
    - `hostnameGenerators` object[]
      - `conditions` object[]: Conditions is an array of hostname generator conditions.
        - `message` string, required: message is a human readable message indicating details about the transition. This may be an empty string.
        - `reason` string, required: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
        - `status` 'True' | 'False' | 'Unknown', required: status of the condition, one of True, False, Unknown.
        - `type` string, required: type of condition in CamelCase or in foo.example.com/CamelCase.
      - `hostnameGeneratorRef` object, required
        - `coreName` string, required
    - `tls` object
      - `status` 'Ready' | 'NotReady'
    - `vips` object[]
      - `ip` string

## 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

- **2026-02-16** `106b373707f3`: 1 info
  - added the new optional request property `spec/selector/dataplaneLabels`
- **2025-10-02** `ecce2daf9de6`: 1 info
  - added the new `SpiffeID` enum value to the request property `spec/identities/items/type`
- **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/meshservices/: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)
