---
title: "ScorecardWithCriteria"
url: "https://dev-portal.dehaven.org/apis/konnect-service-catalog-1-2-0/versions/5f6559bf-d7ba-429c-95c4-cbf2371e663f/schemas/ScorecardWithCriteria"
---

> Full API specification: https://dev-portal.dehaven.org/apis/konnect-service-catalog-1-2-0/versions/5f6559bf-d7ba-429c-95c4-cbf2371e663f.md

# ScorecardWithCriteria

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Konnect Service Catalog
  version: 1.2.0
servers:
  - url: https://us.api.konghq.com/v1
    description: US Region Base URL
  - url: https://eu.api.konghq.com/v1
    description: EU Region Base URL
  - url: https://au.api.konghq.com/v1
    description: AU Region Base URL
  - url: https://me.api.konghq.com/v1
    description: ME Region Base URL
  - url: https://in.api.konghq.com/v1
    description: IN Region Base URL
components:
  schemas:
    Scorecard:
      type: object
      description: Representation of a scorecard.
      required:
        - id
        - name
        - description
        - score
        - entity_selector
        - scorecard_template
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          example: f3704e4c-104d-4f21-998a-20d4364c893f
        name:
          type: string
          description: The human-readable name of the scorecard.
          example: Incident Response
        description:
          type: string
          nullable: true
          example: Governs key metrics pertaining to teams' incident response practices.
        score:
          $ref: "#/components/schemas/ScorecardScore"
        entity_selector:
          $ref: "#/components/schemas/ScorecardEntitySelector"
        scorecard_template:
          x-flatten-allOf: true
          allOf:
            - $ref: "#/components/schemas/ScorecardTemplateName"
            - nullable: true
              example: null
              description: |
                The name of the scorecard template used to create the scorecard.
                Otherwise, `null`.
    ScorecardCriteria:
      type: object
      required:
        - id
        - scorecard_id
        - integration
        - enabled
        - template_name
        - template_parameters
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          example: 5c1121f9-3f3a-47c7-9bb6-c81a51128714
        scorecard_id:
          type: string
          format: uuid
          example: f3704e4c-104d-4f21-998a-20d4364c893f
        integration:
          type: string
          nullable: true
          description: The integration `name` when it provides the criteria template.
            Otherwise `null`.
          example: null
        enabled:
          type: boolean
          description: Whether the criteria is enabled for the given scorecard.
          example: true
        template_name:
          $ref: "#/components/schemas/CriteriaTemplateName"
        template_parameters:
          $ref: "#/components/schemas/CriteriaParameters"
    ScorecardScore:
      type: object
      description: >
        The current score for the given Scorecard.

        A `null` value indicates the scorecard has not yet been evaluated and
        therefore no score has been computed.
      nullable: true
      required:
        - value
        - raw_value
      properties:
        value:
          type: string
          description: The human-readable score value coverted to the Scorecard's assigned
            grading system.
          example: 88%
        raw_value:
          type: number
          description: >
            The raw, numeric score calculated during evaluation of the
            scorecard.

            Rounded to 3 decimal places.
          minimum: 0
          maximum: 100
          example: 87.5
    ScorecardEntitySelector:
      x-flatten-allOf: true
      allOf:
        - $ref: "#/components/schemas/EntitySelector"
        - title: ScorecardEntitySelector
          nullable: true
          description: |
            Selector used to dynamically target catalog entities that will be
            included in the given scorecard's evaluated score.
    ScorecardTemplateName:
      type: string
      description: Well-known name of the template. Uniquely identifies the template.
      enum:
        - kong_best_practices
        - service_documentation
        - service_maturity
        - security_and_compliance
      example: kong_best_practices
    CriteriaTemplateName:
      type: string
      description: Reference to the unique `name` of the criteria template.
      example: time_to_restore_service
    CriteriaParameters:
      type: object
      description: Input parameters for the given criteria template.
      nullable: true
      additionalProperties: true
      example:
        measure: median
        threshold:
          unit: hours
          value: 6
        window:
          unit: months
          value: 3
    EntitySelector:
      title: EntitySelector
      description: Selector used to dynamically target a set of entities within the catalog.
      oneOf:
        - $ref: "#/components/schemas/ServiceSelector"
      example:
        type: label
        parameters:
          label_key: product_area
          operator: equals
          value: cloud_platform
    ServiceSelector:
      oneOf:
        - $ref: "#/components/schemas/AllEntitiesSelector"
        - $ref: "#/components/schemas/ByIDsSelector"
        - $ref: "#/components/schemas/ByNameSelector"
        - $ref: "#/components/schemas/ByDisplayNameSelector"
        - $ref: "#/components/schemas/ByCustomFieldSelector"
        - $ref: "#/components/schemas/ByLabelSelector"
        - $ref: "#/components/schemas/HasLabelKeySelector"
        - $ref: "#/components/schemas/HasDocsSelector"
        - $ref: "#/components/schemas/HasApisSelector"
        - $ref: "#/components/schemas/HasResourcesSelector"
    AllEntitiesSelector:
      type: object
      description: Entity selector that includes all entities of the given type within
        the catalog.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - all
        parameters:
          type: string
          enum:
            - null
          nullable: true
    ByIDsSelector:
      type: object
      description: Entity selector that includes entities contained within a list of IDs.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - ids
        parameters:
          type: object
          required:
            - ids
          properties:
            ids:
              type: array
              items:
                type: string
                format: uuid
    ByNameSelector:
      type: object
      description: Entity selector that includes entities by `name`.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - name
        parameters:
          $ref: "#/components/schemas/StringFieldSelectorParams"
    ByDisplayNameSelector:
      type: object
      description: Entity selector that includes entities by `display_name`.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - display_name
        parameters:
          $ref: "#/components/schemas/StringFieldSelectorParams"
    ByCustomFieldSelector:
      type: object
      description: Entity selector that include entities by a custom field.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - custom_field
        parameters:
          oneOf:
            - type: object
              title: StringCustomFieldSelectorParams
              required:
                - field
                - value
                - operator
              properties:
                field:
                  type: string
                  description: Name of the custom field.
                value:
                  type: string
                operator:
                  $ref: "#/components/schemas/StringSelectorOperator"
            - type: object
              title: NumberCustomFieldSelectorParams
              required:
                - field
                - value
                - operator
              properties:
                field:
                  type: string
                  description: Name of the custom field.
                value:
                  type: number
                operator:
                  $ref: "#/components/schemas/NumberSelectorOperator"
            - type: object
              title: BooleanCustomFieldSelectorParams
              required:
                - field
                - value
                - operator
              properties:
                field:
                  type: string
                  description: Name of the custom field.
                value:
                  type: boolean
                operator:
                  $ref: "#/components/schemas/BooleanSelectorOperator"
            - type: object
              title: UrlCustomFieldSelectorParams
              required:
                - field
                - subfield
                - value
                - operator
              properties:
                field:
                  type: string
                  description: Name of the custom field.
                subfield:
                  type: string
                  enum:
                    - name
                    - link
                  description: Specify which subfield of the `url` custom field value to use for
                    selection.
                value:
                  type: string
                operator:
                  $ref: "#/components/schemas/StringSelectorOperator"
    ByLabelSelector:
      type: object
      description: Entity selector that includes entities by `label` value.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - label
        parameters:
          x-flatten-allOf: true
          allOf:
            - $ref: "#/components/schemas/StringFieldSelectorParams"
            - type: object
              title: LabelSelectorParams
              required:
                - label_key
              properties:
                label_key:
                  type: string
    HasLabelKeySelector:
      type: object
      description: Entity selector that includes entities by inclusion of a `label` key.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - has_label_key
        parameters:
          type: object
          title: HasLabelKeySelectorParams
          required:
            - label_key
          properties:
            label_key:
              type: string
    HasDocsSelector:
      type: object
      description: Entity selector to include entities by attached documentation.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - has_docs
        parameters:
          type: string
          enum:
            - null
          nullable: true
    HasApisSelector:
      type: object
      description: Entity selector that includes services by attached APIs.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - has_apis
        parameters:
          $ref: "#/components/schemas/HasSelectorParams"
    HasResourcesSelector:
      type: object
      description: Entity selector that includes services by mapped resources.
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum:
            - has_resources
        parameters:
          x-flatten-allOf: true
          allOf:
            - $ref: "#/components/schemas/HasSelectorParams"
            - type: object
              title: HasResourcesSelectorParams
              required:
                - resource_type
                - integration
              properties:
                resource_type:
                  $ref: "#/components/schemas/CatalogResourceType"
                integration:
                  type: string
                  description: The machine name of the integration that uniquely identifies it
                    within the catalog.
                  example: gateway-manager
    StringFieldSelectorParams:
      type: object
      required:
        - operator
        - value
      properties:
        operator:
          $ref: "#/components/schemas/StringSelectorOperator"
        value:
          type: string
    StringSelectorOperator:
      type: string
      enum:
        - equals
        - contains
    NumberSelectorOperator:
      type: string
      enum:
        - equals
        - less_than
        - greater_than
    BooleanSelectorOperator:
      type: string
      enum:
        - equals
    HasSelectorParams:
      type: object
      required:
        - operator
        - value
      properties:
        operator:
          $ref: "#/components/schemas/HasRelationshipSelectorOperator"
        value:
          type: number
    CatalogResourceType:
      type: string
      description: >
        The resource type. Available resource types are compiled from the
        integrations installed within the catalog.
      minLength: 1
      maxLength: 120
      example: gateway_svc
    HasRelationshipSelectorOperator:
      type: string
      enum:
        - exactly
        - at_least
        - at_most
    ScorecardWithCriteria:
      x-flatten-allOf: true
      allOf:
        - $ref: "#/components/schemas/Scorecard"
        - type: object
          required:
            - criteria
          properties:
            criteria:
              type: array
              items:
                $ref: "#/components/schemas/ScorecardCriteria"
```
