---
title: "EventGatewayConsumePolicyCreate"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-for-event-gateways-1/versions/f4366232-3186-4be9-93bd-be3e4b16fb19/schemas/EventGatewayConsumePolicyCreate"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-for-event-gateways-1/versions/f4366232-3186-4be9-93bd-be3e4b16fb19.md

# EventGatewayConsumePolicyCreate

The typed schema of the consume policy to modify it.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Control Planes Configuration for Event Gateways
  version: 1.0.0
servers:
  - url: https://us.api.konghq.com/v1
    description: United-States Production region
  - url: https://eu.api.konghq.com/v1
    description: Europe Production region
  - url: https://au.api.konghq.com/v1
    description: Australia Production region
  - url: https://me.api.konghq.com/v1
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v1
    description: India Production region
  - url: https://sg.api.konghq.com/v1
    description: Singapore Production region
components:
  schemas:
    EventGatewayConsumeSchemaValidationPolicy:
      description: A policy that validates consume messages against a schema registry.
      type: object
      properties:
        type:
          description: The type name of the policy.
          type: string
          enum:
            - schema_validation
          maxLength: 255
          minLength: 1
          x-terraform-transform-const: true
        name:
          description: A unique user-defined name of the policy.
          type: string
          maxLength: 255
          x-unicode-pattern: ^[\p{L}\p{N}][\p{L}\p{N} _\-\.:/+']*[\p{L}\p{N}]$
        description:
          description: A human-readable description of the policy.
          type: string
          default: ""
          maxLength: 512
        enabled:
          description: Whether the policy is enabled.
          type: boolean
          default: true
        labels:
          $ref: "#/components/schemas/Labels"
        config:
          description: The configuration of the schema validation policy.
          type: object
          properties:
            type:
              $ref: "#/components/schemas/SchemaValidationType"
            schema_registry:
              $ref: "#/components/schemas/SchemaRegistryReference"
            key_validation_action:
              $ref: "#/components/schemas/ConsumeKeyValidationAction"
            value_validation_action:
              $ref: "#/components/schemas/ConsumeValueValidationAction"
          required:
            - type
        condition:
          description: A string containing the boolean expression that determines whether
            the policy is applied.
          type: string
          example: context.topic.name.endsWith("my_suffix") && record.headers["x-flag"] ==
            "a-value"
          default: ""
          maxLength: 1000
          x-expression:
            type: boolean
            fields:
              - name: context.auth.principal.name
                type: string
                description: Name of authenticated principal. Username in case of PLAIN/SCRAM,
                  `sub` claim in case of OAUTHBEARER.
              - name: context.auth.type
                type: string
                description: >
                  The matched authentication type from a virtual cluster:
                  anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512,
                  sasl_oauth_bearer.
              - name: context.topic.name
                type: string
                description: The name of the topic.
              - name: record.headers
                type: object
                description: An associative array of header key value pairs.
      required:
        - type
        - config
      title: Schema Validation
    EventGatewayModifyHeadersPolicyCreate:
      description: A policy that modifies headers for requests.
      type: object
      properties:
        type:
          description: The type name of the policy.
          type: string
          enum:
            - modify_headers
          maxLength: 255
          minLength: 1
          x-terraform-transform-const: true
        name:
          description: A unique user-defined name of the policy.
          type: string
          maxLength: 255
          x-unicode-pattern: ^[\p{L}\p{N}][\p{L}\p{N} _\-\.:/+']*[\p{L}\p{N}]$
        description:
          description: A human-readable description of the policy.
          type: string
          default: ""
          maxLength: 512
        enabled:
          description: Whether the policy is enabled.
          type: boolean
          default: true
        labels:
          $ref: "#/components/schemas/Labels"
        config:
          description: The configuration of the modify headers policy.
          type: object
          properties:
            actions:
              description: Actions are run in sequential order and act on individual headers.
              type: array
              items:
                $ref: "#/components/schemas/EventGatewayModifyHeaderAction"
              minItems: 1
        condition:
          description: >
            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.
          type: string
          example: record.value.content.foo.bar == "a-value"
          default: ""
          maxLength: 1000
          x-expression:
            type: boolean
            fields:
              - name: context.auth.principal.name
                type: string
                description: Name of authenticated principal. Username in case of PLAIN/SCRAM,
                  `sub` claim in case of OAUTHBEARER.
              - name: context.auth.type
                type: string
                description: >
                  The matched authentication type from a virtual cluster:
                  anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512,
                  sasl_oauth_bearer.
              - name: context.topic.name
                type: string
                description: The name of the topic.
              - name: record.headers
                type: object
                description: An associative array of header key value pairs.
              - name: record.value.validated
                type: boolean
                description: Indicates whether the record value was successfully validated.
              - name: record.value.content
                type: object
                description: The content of the record value.
        parent_policy_id:
          description: The unique identifier of the parent schema validation policy, if any.
          type: string
          format: uuid
      required:
        - type
        - config
      title: Modify headers
    EventGatewaySkipRecordPolicyCreate:
      description: A policy that skips processing of a record.
      type: object
      properties:
        type:
          description: The type name of the policy.
          type: string
          enum:
            - skip_record
          maxLength: 255
          minLength: 1
          x-terraform-transform-const: true
        name:
          description: A unique user-defined name of the policy.
          type: string
          maxLength: 255
          x-unicode-pattern: ^[\p{L}\p{N}][\p{L}\p{N} _\-\.:/+']*[\p{L}\p{N}]$
        description:
          description: A human-readable description of the policy.
          type: string
          default: ""
          maxLength: 512
        enabled:
          description: Whether the policy is enabled.
          type: boolean
          default: true
        labels:
          $ref: "#/components/schemas/Labels"
        condition:
          description: >
            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.
          type: string
          example: record.value.content.foo.bar == "a-value"
          default: ""
          maxLength: 1000
          x-expression:
            type: boolean
            fields:
              - name: context.auth.principal.name
                type: string
                description: Name of authenticated principal. Username in case of PLAIN/SCRAM,
                  `sub` claim in case of OAUTHBEARER.
              - name: context.auth.type
                type: string
                description: >
                  The matched authentication type from a virtual cluster:
                  anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512,
                  sasl_oauth_bearer.
              - name: context.topic.name
                type: string
                description: The name of the topic.
              - name: record.headers
                type: object
                description: An associative array of header key value pairs.
              - name: record.value.validated
                type: boolean
                description: Indicates whether the record value was successfully validated.
              - name: record.value.content
                type: object
                description: The content of the record value.
        parent_policy_id:
          description: The unique identifier of the parent schema validation policy, if any.
          type: string
          format: uuid
      required:
        - type
      title: Skip Record
    EventGatewayDecryptPolicy:
      description: Decrypts Kafka records or keys using AES_256_GCM. Keys are
        therefore 256 bits long.
      type: object
      properties:
        type:
          description: The type name of the policy.
          type: string
          enum:
            - decrypt
          maxLength: 255
          minLength: 1
          x-terraform-transform-const: true
        name:
          description: A unique user-defined name of the policy.
          type: string
          maxLength: 255
          x-unicode-pattern: ^[\p{L}\p{N}][\p{L}\p{N} _\-\.:/+']*[\p{L}\p{N}]$
        description:
          description: A human-readable description of the policy.
          type: string
          default: ""
          maxLength: 512
        enabled:
          description: Whether the policy is enabled.
          type: boolean
          default: true
        labels:
          $ref: "#/components/schemas/Labels"
        config:
          description: The configuration of the policy.
          type: object
          $ref: "#/components/schemas/EventGatewayDecryptPolicyConfig"
        condition:
          description: A string containing the boolean expression that determines whether
            the policy is applied.
          type: string
          example: context.topic.name.endsWith("my_suffix") && record.headers["x-flag"] ==
            "a-value"
          default: ""
          maxLength: 1000
          x-expression:
            type: boolean
            fields:
              - name: context.auth.principal.name
                type: string
                description: Name of authenticated principal. Username in case of PLAIN/SCRAM,
                  `sub` claim in case of OAUTHBEARER.
              - name: context.auth.type
                type: string
                description: >
                  The matched authentication type from a virtual cluster:
                  anonymous, sasl_plain, sasl_scram_sha256, sasl_scram_sha512,
                  sasl_oauth_bearer.
              - name: context.topic.name
                type: string
                description: The name of the topic.
              - name: record.headers
                type: object
                description: An associative array of header key value pairs.
      required:
        - type
        - config
      title: Decrypt
    Labels:
      description: >
        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 "_".
      type: object
      example:
        env: test
      additionalProperties:
        type: string
        pattern: ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$
        minLength: 1
        maxLength: 63
      maxProperties: 50
      title: Labels
    SchemaValidationType:
      description: >
        How to validate the schema and parse the record.

        * confluent_schema_registry - validates against confluent schema
        registry.

        * json - simple JSON parsing without the schema.
      type: string
      enum:
        - confluent_schema_registry
        - json
    SchemaRegistryReference:
      description: A reference to a schema Registry.
      oneOf:
        - $ref: "#/components/schemas/SchemaRegistryReferenceById"
        - $ref: "#/components/schemas/SchemaRegistryReferenceByName"
      x-terraform-preferred: "#/components/schemas/SchemaRegistryReferenceById"
    ConsumeKeyValidationAction:
      description: |
        Defines a behavior when record key is not valid.
        * mark - marks a record with kong/server header and client ID value
          to help to identify the clients violating schema.
        * skip - skips delivering a record.
      type: string
      enum:
        - mark
        - skip
    ConsumeValueValidationAction:
      description: |
        Defines a behavior when record value is not valid.
        * mark - marks a record with kong/server header and client ID value
          to help to identify the clients violating schema.
        * skip - skips delivering a record.
      type: string
      enum:
        - mark
        - skip
    EventGatewayModifyHeaderAction:
      description: An action that modifies a header.
      discriminator:
        propertyName: op
        mapping:
          remove: "#/components/schemas/EventGatewayModifyHeaderRemoveAction"
          set: "#/components/schemas/EventGatewayModifyHeaderSetAction"
      oneOf:
        - $ref: "#/components/schemas/EventGatewayModifyHeaderRemoveAction"
        - $ref: "#/components/schemas/EventGatewayModifyHeaderSetAction"
    EventGatewayDecryptPolicyConfig:
      description: The configuration of the decrypt policy.
      type: object
      properties:
        failure_mode:
          $ref: "#/components/schemas/EncryptionFailureMode"
        key_sources:
          description: Describes how to find a symmetric key for decryption.
          type: array
          items:
            $ref: "#/components/schemas/EventGatewayKeySource"
          minItems: 1
        part_of_record:
          description: Describes the parts of a record to decrypt.
          type: array
          items:
            $ref: "#/components/schemas/DecryptionRecordPart"
          minItems: 1
      required:
        - failure_mode
        - key_sources
        - part_of_record
    SchemaRegistryReferenceById:
      type: object
      properties:
        id:
          description: The unique identifier of the schema registry.
          type: string
          format: uuid
          minLength: 1
      required:
        - id
    SchemaRegistryReferenceByName:
      description: Reference a schema registry by its unique name.
      type: object
      properties:
        name:
          description: The unique name of the schema registry.
          type: string
          maxLength: 255
          minLength: 1
      required:
        - name
    EventGatewayModifyHeaderRemoveAction:
      description: An action that removes a header by key.
      type: object
      properties:
        op:
          type: string
          enum:
            - remove
          x-terraform-transform-const: true
        key:
          description: The key of the header to remove.
          type: string
      required:
        - op
        - key
    EventGatewayModifyHeaderSetAction:
      description: An action that sets a header key and value.
      type: object
      properties:
        op:
          type: string
          enum:
            - set
          x-terraform-transform-const: true
        key:
          description: The key of the header to set.
          type: string
        value:
          description: The value of the header to set.
          type: string
      required:
        - op
        - key
        - value
    EncryptionFailureMode:
      description: >
        Describes how to handle failing encryption or decryption.

        Use `error` if the record should be rejected if encryption or decryption
        fails.

        Use `passthrough` to ignore encryption or decryption failure and
        continue proxying the record.
      type: string
      enum:
        - error
        - passthrough
    EventGatewayKeySource:
      description: >
        A key source that describes how to find a symmetric key for encryption
        or decryption.

        It can be an AWS KMS key source that uses a KMS to find a symmetric key,

        or a static key source that uses a static symmetric key provided as
        secrets.
      discriminator:
        propertyName: type
        mapping:
          aws: "#/components/schemas/EventGatewayAWSKeySource"
          static: "#/components/schemas/EventGatewayStaticKeySource"
      oneOf:
        - $ref: "#/components/schemas/EventGatewayAWSKeySource"
        - $ref: "#/components/schemas/EventGatewayStaticKeySource"
    DecryptionRecordPart:
      description: |
        * key - decrypt the record key
        * value - decrypt the record value
      type: string
      enum:
        - key
        - value
    EventGatewayAWSKeySource:
      description: |
        A key source that uses an AWS KMS to find a symmetric key. Load KMS credentials from the environment.

        See [aws docs](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credproviders.html#credproviders-default-credentials-provider-chain)
        for more information about how credential retrieval.
      type: object
      properties:
        type:
          type: string
          enum:
            - aws
          x-terraform-transform-const: true
      additionalProperties: false
      required:
        - type
    EventGatewayStaticKeySource:
      description: |
        A key source that uses static symmetric keys.
      type: object
      properties:
        type:
          type: string
          enum:
            - static
          x-terraform-transform-const: true
      additionalProperties: false
      required:
        - type
    EventGatewayConsumePolicyCreate:
      description: The typed schema of the consume policy to modify it.
      discriminator:
        propertyName: type
        mapping:
          modify_headers: "#/components/schemas/EventGatewayModifyHeadersPolicyCreate"
          schema_validation: "#/components/schemas/EventGatewayConsumeSchemaValidationPolicy"
          decrypt: "#/components/schemas/EventGatewayDecryptPolicy"
          skip_record: "#/components/schemas/EventGatewaySkipRecordPolicyCreate"
      oneOf:
        - $ref: "#/components/schemas/EventGatewayConsumeSchemaValidationPolicy"
        - $ref: "#/components/schemas/EventGatewayModifyHeadersPolicyCreate"
        - $ref: "#/components/schemas/EventGatewaySkipRecordPolicyCreate"
        - $ref: "#/components/schemas/EventGatewayDecryptPolicy"
```
