---
title: "Update Produce Policy for Virtual Cluster"
method: PUT
path: "/v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/produce-policies/{policyId}#Transcode"
tags: ["Event Gateway Virtual Cluster Produce Policies"]
---

# Update Produce Policy for Virtual Cluster

`PUT /v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/produce-policies/{policyId}#Transcode`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/produce-policies/{policyId}#Transcode`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Updates an existing produce policy associated with the specified Event Gateway virtual cluster.

## Path parameters

- `gatewayId` string, uuid, required
- `virtualClusterId` string, uuid, required
- `policyId` string, uuid, required

## Request body

- EventGatewayParsedRecordTranscodeProducePolicy: Converts an already schema-validated record value into a different serialization format before it is produced to the backend cluster. Note this policy can only be used as a child of a `EventGatewayProduceSchemaValidationPolicy` policy. **Requires a minimum runtime version of `1.3`**.
  - `type` 'transcode', required: The type name of the policy.
  - `name` string: A unique user-defined name of the policy.
  - `description` string: A human-readable description of the policy.
  - `enabled` boolean: Whether the policy is enabled.
  - `labels` Labels: Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `config` EventGatewayParsedRecordTranscodeProduceConfig, required: The configuration of the policy.
    - `failure_mode` 'reject' | 'passthrough' | 'mark', required: Describes how to handle a failure in a policy applied to produced records. * `reject` - rejects the record batch. * `passthrough` - passes the record silently to the backend cluster even though policy execution failed. * `mark` - passes the record to the backend cluster but marks it with a `kong/policy-failure-<id>` header whose value is the reason for the policy failure (truncated to 512 characters). The header is stored with the record in the backend cluster, so every consumer of the topic sees it, including systems that never pass through the Event Gateway. The failure reason can contain runtime-specific configuration details, such as schema IDs, registry URLs, field paths, KMS ARNs and key IDs, KMS error text, JWT issuer and audience data, or expression snippets, and a producer with access to the topic can trigger policy failures on purpose to expose it. If you don't want to share this information, remove the header with a Modify Headers produce policy, or use a different failure mode. **Requires a minimum runtime version of `1.2`**.
    - `on_unknown_field` 'fail' | 'drop': Describes how to handle JSON fields that are not defined in the target schema. * `fail` - the transcoding fails. The policy `failure_mode` determines how the failure is handled. * `drop` - the unknown fields are removed from the transcoded value. **Requires a minimum runtime version of `1.3`**.
    - `schema_source` union, required: Determines how to look up the schema to use for the transcoded output data. Leave this unset if the output data schema isn't needed.
      - EventGatewayParsedRecordTranscodeSchemaSourceReference: References a schema registered in a schema registry, computing the subject and version to use.
        - `type` 'reference', required
        - `schema_registry` SchemaRegistryReference, required: A reference to a schema Registry.
          - `id` string, uuid, required: The unique identifier of the schema registry.
        - `subject` string, required: An expression that computes the schema registry subject of the output data's schema.
        - `version` string, required: An expression that computes the schema registry version of the output data's schema.
        - `schema_ref_destination` union, required: Defines how to record the schema id for the transcoded output data. See the [Confluent docs](https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/index.html#wire-format) for more about the wire format.
          - EventGatewayParsedRecordTranscodeSchemaRefDestinationConfluentFormat: Prefixes the structured data bytes with a reference to the schema.
            - `type` 'confluent_format', required
          - EventGatewayParsedRecordTranscodeSchemaRefDestinationRecordHeader: Puts the schema reference in a record header.
            - `type` 'record_header', required
            - `name` string: The name is compatible with Confluent's serializer by default but can be changed.
          - EventGatewayParsedRecordTranscodeSchemaRefDestinationNone: Do not persist the schema anywhere.
            - `type` 'none', required
      - EventGatewayParsedRecordTranscodeSchemaSourceInline: A schema embedded directly in the policy configuration.
        - `type` 'inline', required
        - `inline` string, required: The raw schema text (e.g. an Avro JSON schema) to use for the transcoded output data.
    - `output_format` 'avro', required: The serialization format to convert the record value into.
  - `condition` string: A string containing the boolean expression that determines whether the policy is applied. When the policy is applied as a child policy of schema_validation, the expression can also reference `record.value` fields.

## Response `200`

Updated produce policy object.

- EventGatewayProducePolicyTranscodeTFOnly: A policy associated with an Event Gateway.
  - `type` string, required: The type name of the policy.
  - `name` string: A unique user-defined name of the policy.
  - `description` string: A human-readable description of the policy.
  - `enabled` boolean: Whether the policy is enabled.
  - `labels` Labels: Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `id` string, uuid, required: The unique identifier of the policy.
  - `config` object, required: The configuration of the policy.
  - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
  - `parent_policy_id` string, uuid, nullable: The unique identifier of the parent policy, if any.
  - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.
  - `condition` string: A string containing the boolean expression that determines whether the policy is applied.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden

## Changes

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

[Operation history](https://skmtc.dev/kong/apis/konnect-api-beta/changes/v1/event-gateways/:gatewayId/virtual-clusters/:virtualClusterId/produce-policies/:policyId%23Transcode/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)
