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

# Creates or Updates MeshFaultInjection entity

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

## Path parameters

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

## Request body

- MeshFaultInjectionItem — MeshFaultInjection allows you to test the resiliency of your services by injecting faults like delays, connection aborts, and response bandwidth limits into the traffic. This is useful for chaos testing and validating that your applications handle failures gracefully.
  - `type` 'MeshFaultInjection', 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 MeshFaultInjection resource.
    - `from` object[] — From list makes a match between clients and corresponding configurations
      - `default` object — Default is a configuration specific to the group of destinations referenced in 'targetRef'
        - `http` object[] — Http allows to define list of Http faults between dataplanes.
          - `abort` object — Abort defines a configuration of not delivering requests to destination service and replacing the responses from destination dataplane by predefined status code
            - `httpStatus` integer, required — HTTP status code which will be returned to source side
            - `percentage` union, required — Percentage of requests on which abort will be injected, has to be either int or decimal represented as string.
              - …
          - `delay` object — Delay defines configuration of delaying a response from a destination
            - `percentage` union, required — Percentage of requests on which delay will be injected, has to be either int or decimal represented as string.
              - …
            - `value` string, required — The duration during which the response will be delayed
          - `responseBandwidth` object — ResponseBandwidth defines a configuration to limit the speed of responding to the requests
            - `limit` string, required — Limit is represented by value measure in Gbps, Mbps, kbps, e.g. 10kbps
            - `percentage` union, required — Percentage of requests on which response bandwidth limit will be either int or decimal represented as string.
              - …
      - `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`
    - `rules` object[] — Rules defines inbound fault injection configuration
      - `default` object, required — Default defines fault configuration
        - `http` object[] — Http allows to define list of Http faults between dataplanes.
          - `abort` object — Abort defines a configuration of not delivering requests to destination service and replacing the responses from destination dataplane by predefined status code
            - `httpStatus` integer, required — HTTP status code which will be returned to source side
            - `percentage` union, required — Percentage of requests on which abort will be injected, has to be either int or decimal represented as string.
              - …
          - `delay` object — Delay defines configuration of delaying a response from a destination
            - `percentage` union, required — Percentage of requests on which delay will be injected, has to be either int or decimal represented as string.
              - …
            - `value` string, required — The duration during which the response will be delayed
          - `responseBandwidth` object — ResponseBandwidth defines a configuration to limit the speed of responding to the requests
            - `limit` string, required — Limit is represented by value measure in Gbps, Mbps, kbps, e.g. 10kbps
            - `percentage` union, required — Percentage of requests on which response bandwidth limit will be either int or decimal represented as string.
              - …
      - `matches` object[] — Matches defines list of matches for which fault injection will be applied
        - `spiffeID` object — SpiffeID defines a matcher configuration for SpiffeID matching
          - `type` 'Exact' | 'Prefix', required — Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.
          - `value` string, required — Value is SpiffeId of a client that needs to match for the configuration to be applied
    - `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 clients and corresponding configurations
      - `default` object — Default is a configuration specific to the group of destinations referenced in 'targetRef'
        - `http` object[] — Http allows to define list of Http faults between dataplanes.
          - `abort` object — Abort defines a configuration of not delivering requests to destination service and replacing the responses from destination dataplane by predefined status code
            - `httpStatus` integer, required — HTTP status code which will be returned to source side
            - `percentage` union, required — Percentage of requests on which abort will be injected, has to be either int or decimal represented as string.
              - …
          - `delay` object — Delay defines configuration of delaying a response from a destination
            - `percentage` union, required — Percentage of requests on which delay will be injected, has to be either int or decimal represented as string.
              - …
            - `value` string, required — The duration during which the response will be delayed
          - `responseBandwidth` object — ResponseBandwidth defines a configuration to limit the speed of responding to the requests
            - `limit` string, required — Limit is represented by value measure in Gbps, Mbps, kbps, e.g. 10kbps
            - `percentage` union, required — Percentage of requests on which response bandwidth limit will be either int or decimal represented as string.
              - …
      - `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

---

[API](https://skmtc.net/kong/apis/konnect-api-beta.md) · [All operations](https://skmtc.net/kong/apis/konnect-api-beta/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api-beta/versions/73b05fbfd2ef/schema)
