---
title: "Creates or Updates MeshHTTPRoute entity"
method: PUT
path: "/v3/mesh/control-planes/{cpId}/meshes/{mesh}/meshhttproutes/{name}"
tags: ["MeshHTTPRoute"]
---

# Creates or Updates MeshHTTPRoute entity

`PUT /v3/mesh/control-planes/{cpId}/meshes/{mesh}/meshhttproutes/{name}`

## Request

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

## Path parameters

- `cpId` string, uuid, required
- `mesh` string, required
- `name` string, required

## Request body

- MeshHTTPRouteItem: NOTICE: This policy defines its own `GetDefault` method so that it can have the given structure for deserialization but still use the generic policy merging machinery. // MeshHTTPRoute configures how HTTP requests are routed between services in the mesh. It enables advanced traffic management including path-based routing, header matching, request/response modification, redirects, URL rewrites, traffic mirroring, and weighted load balancing across service endpoints.
  - `type` 'MeshHTTPRoute', 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 MeshHTTPRoute 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' | 'Dataplane', required: Kind of the referenced resource
      - `labels` object: Labels are used to select referenced real resources and to carry legacy service identity when a common TargetRef must still target old service-tag based paths.
      - `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.
    - `to` object[]: To matches destination services of requests and holds configuration.
      - `hostnames` string[]: Hostnames is not currently supported and must not be set.
      - `rules` object[], required: Rules contains the routing rules applies to a combination of top-level targetRef and the targetRef in this entry.
        - `default` object, required: Default holds routing rules that can be merged with rules from other policies.
          - `backendRefs` object[]
            - `filters` object[]
              - …
            - `kind` 'MeshService' | 'MeshExternalService' | 'MeshMultiZoneService', required: Kind of the referenced resource
            - `labels` object: Labels are used to select the referenced real resource.
            - `port` integer: Port is only supported when this ref refers to a real MeshService object
            - `sectionName` string: SectionName is used to target a specific section of the resource. For example, you can target a port from MeshService.ports[] by its name.
            - `weight` integer
          - `filters` object[]
            - `requestHeaderModifier` object: Only one action is supported per header name. Configuration to set or add multiple values for a header must use RFC 7230 header value formatting, separating each value with a comma.
              - …
            - `requestMirror` object
              - …
            - `requestRedirect` object
              - …
            - `responseHeaderModifier` object: Only one action is supported per header name. Configuration to set or add multiple values for a header must use RFC 7230 header value formatting, separating each value with a comma.
              - …
            - `type` 'RequestHeaderModifier' | 'ResponseHeaderModifier' | 'RequestRedirect' | 'URLRewrite' | 'RequestMirror', required
            - `urlRewrite` object
              - …
        - `matches` object[], required: Matches describes how to match HTTP requests this rule should be applied to.
          - `headers` object[]
            - `name` string, required: Name is the name of the HTTP Header to be matched. Name MUST be lower case as they will be handled with case insensitivity (See https://tools.ietf.org/html/rfc7230#section-3.2).
            - `type` 'Exact' | 'Present' | 'RegularExpression' | 'Absent' | 'Prefix': Type specifies how to match against the value of the header.
            - `value` string: Value is the value of HTTP Header to be matched.
          - `method` 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE'
          - `path` object
            - `type` 'Exact' | 'PathPrefix' | 'RegularExpression', required
            - `value` string, required: Exact or prefix matches must be an absolute path. A prefix matches only if separated by a slash or the entire path.
          - `queryParams` object[]: QueryParams matches based on HTTP URL query parameters. Multiple matches are ANDed together such that all listed matches must succeed.
            - `name` string, required
            - `type` 'Exact' | 'RegularExpression', required
            - `value` string, required
      - `targetRef` object, required: TargetRef is a reference to the resource that represents a group of request destinations.
        - `kind` 'Mesh' | 'MeshService' | 'MeshExternalService' | 'MeshMultiZoneService' | 'MeshHTTPRoute', required: Kind of the referenced resource
        - `labels` object: Labels are used to select referenced real resources and to carry legacy service identity when a common TargetRef must still target old service-tag based paths.
        - `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.
  - `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

- **2026-12-03** `9c8d300657bd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-beta/changes/v3/mesh/control-planes/:cpId/meshes/:mesh/meshhttproutes/: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/9c8d300657bd?raw)
