---
title: "SuggestionRule"
url: "https://us-prod.jeffyongtaotang.com/apis/konnect-service-catalog-1/versions/cdbef9b7-686c-4189-bbc8-55c727a972e8/schemas/SuggestionRule"
---

> Full API specification: https://us-prod.jeffyongtaotang.com/apis/konnect-service-catalog-1/versions/cdbef9b7-686c-4189-bbc8-55c727a972e8.md

# SuggestionRule

Contains information about the suggestion rule.

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Konnect Service Catalog
  version: 1.3.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:
    SystemSuggestionRule:
      title: SystemSuggestionRule
      description: Contains information about the system defined suggestion rule.
      allOf:
        - type: object
          required:
            - id
            - name
            - description
            - binding
            - active
            - auto_accept
            - action
          properties:
            id:
              type: string
              format: uuid
              example: 22f72bd1-2897-473e-9471-302de3ccf38b
              description: The suggestion rule ID.
              readOnly: true
            name:
              type: string
              description: The display name of the suggestion rule.
              minLength: 1
              maxLength: 120
            description:
              type: string
              nullable: true
              default: null
              minLength: 1
              maxLength: 2048
              description: The description of the suggestion rule
              example: Suggestion rule description
            binding:
              type: string
              description: The integration binding object name
              example: pagerduty_service
            active:
              type: boolean
              description: Determines if this suggestion rule should be evaluated when
                generating suggested actions.
            auto_accept:
              type: boolean
              description: >
                Determines if the suggested action should be applied
                automatically.

                - `true`: Suggested action will be applied automatically

                - `false`: Suggested action will not be automatically applied,
                user input required
            action:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - archive
                    - map
                    - create-or-map
                  description: The type of action this system suggestion rule performs
              description: The action configuration for this system suggestion rule.
    CreatedAt:
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      description: An ISO-8601 timestamp representation of entity creation date.
      readOnly: true
      x-speakeasy-param-suppress-computed-diff: true
    UpdatedAt:
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      description: An ISO-8601 timestamp representation of entity update date.
      readOnly: true
      x-speakeasy-param-suppress-computed-diff: true
    SuggestedRuleAction:
      oneOf:
        - $ref: "#/components/schemas/ArchiveActionPayload"
        - $ref: "#/components/schemas/IgnoreActionPayload"
        - $ref: "#/components/schemas/MapActionPayload"
        - $ref: "#/components/schemas/CreateOrMapAction"
    ArchiveActionPayload:
      title: ArchiveActionPayload
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - archive
    IgnoreActionPayload:
      title: IgnoreAction
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ignore
    MapActionPayload:
      title: MapAction
      description: >
        Must specify **at least one** of the following properties when
        `action_type` is `map`:

        - `id`

        - `name`
      type: object
      additionalProperties: false
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum:
            - map
        data:
          type: object
          additionalProperties: false
          required:
            - service
            - resource
          properties:
            service:
              oneOf:
                - $ref: "#/components/schemas/MapByName"
                - $ref: "#/components/schemas/MapById"
            resource:
              type: object
              additionalProperties: false
              required:
                - labels
              properties:
                labels:
                  $ref: "#/components/schemas/LabelsTemplate"
    CreateOrMapAction:
      title: CreateOrMapAction
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum:
            - create-or-map
        data:
          type: object
          additionalProperties: false
          required:
            - service
            - resource
          properties:
            service:
              type: object
              additionalProperties: false
              required:
                - name
                - display_name
                - description
                - labels
                - metadata
              properties:
                name:
                  description: >
                    The name of the service to create or map to.

                    Supports JQ expression syntax on discovered entity's
                    `integration_record` property.
                  type: string
                  minLength: 1
                display_name:
                  type: string
                  nullable: true
                  description: >
                    The display name of the service on create. This property is
                    ignored on map.

                    Supports JQ expression syntax on discovered entity's
                    `integration_record` property.

                    If value is set to null, display name will be set to name.
                  minLength: 1
                description:
                  type: string
                  description: >
                    The description of the service. This property is ignored on
                    map.

                    Supports JQ expression syntax on discovered entity's
                    `integration_record` property.
                labels:
                  $ref: "#/components/schemas/LabelsTemplate"
                metadata:
                  $ref: "#/components/schemas/MetadataTemplate"
            resource:
              type: object
              additionalProperties: false
              required:
                - labels
              properties:
                labels:
                  $ref: "#/components/schemas/LabelsTemplate"
    MapByName:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          description: >
            Exact match on service name based on suggestion rule scope.

            Supports JQ expression syntax on discovered entity's
            `integration_record` property.
          example: "{{ .gateway_service.name }}-{{ .runtime_group.labels.env }}"
    MapById:
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          type: string
          description: >
            Exact match on service identifier based on suggestion rule scope.

            Supports JQ expression syntax on discovered entity's
            `integration_record` property.
          example: 1ace6cb5-75ca-4488-a05d-9260628a37a8
    LabelsTemplate:
      title: LabelsTemplate
      type: object
      example:
        env: test
      description: >
        Labels to facilitate grouping and tagged search.

        Resolved keys must be of length 1-63 characters, and cannot start with
        ''kong'', ''konnect'', ''mesh'', ''kic'', or ''_''.'

        Label key and value supports JQ expression syntax on discovered entity's
        `integration_record` property.
      additionalProperties:
        type: string
        minLength: 1
    MetadataTemplate:
      type: object
      description: Contains key value pairs information about entity's metadata.
        Supports JQ templates on values which resolves to a string.
      additionalProperties:
        anyOf:
          - type: string
            nullable: true
          - type: number
            nullable: true
          - type: boolean
            nullable: true
          - $ref: "#/components/schemas/UrlMetadataValueTemplate"
    UrlMetadataValueTemplate:
      type: object
      description: Contains the name and link value associated with a URL Metadata
        Field. Supports JQ templates which resolves to a string.
      allOf:
        - $ref: "#/components/schemas/UrlMetadataValueBase"
        - type: object
          required:
            - link
          properties:
            link:
              description: The url link associated with the metadata value.
              type: string
              minLength: 1
              example: "#public-slack-channel"
    UrlMetadataValueBase:
      type: object
      nullable: true
      required:
        - name
      properties:
        name:
          description: The human-readable name for the url metadata value
          type: string
          minLength: 1
          example: "#public-slack-channel"
    SuggestionRule:
      title: SuggestionRule
      description: Contains information about the suggestion rule.
      allOf:
        - $ref: "#/components/schemas/SystemSuggestionRule"
        - type: object
          required:
            - created_at
            - updated_at
            - action
            - discovery_selector
          properties:
            created_at:
              $ref: "#/components/schemas/CreatedAt"
            updated_at:
              $ref: "#/components/schemas/UpdatedAt"
            discovery_selector:
              type: string
              description: >
                A boolean string or JQ expression that must evaluate to a
                boolean value.

                Supports JQ expressions syntax on discovered entity's
                `integration_record` property.
              example: .gateway_service.tags | contains(["_KonnectDeployment:"])
            action:
              $ref: "#/components/schemas/SuggestedRuleAction"
```
