Port Scorecards API

The Scorecards API from Port — 3 operation(s) for scorecards.

OpenAPI Specification

port-scorecards-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Port Action Runs Scorecards API
  version: '1.0'
tags:
- name: Scorecards
paths:
  /v1/blueprints/{blueprint_identifier}/scorecards:
    post:
      summary: Create a scorecard
      tags:
      - Scorecards
      description: This route allows you to create a scorecard for a given blueprint. A scorecard is a set of rules that define the quality of a blueprint.<br/><br/>To learn more about scorecards, check out the [documentation](https://docs.port.io/scorecards/overview).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifier:
                  type: string
                  pattern: ^(?!\.{1,2}$)[\p{L}0-9@_.+:\\/='-]+$
                  maxLength: 100
                  description: A unique identifier for the scorecard.
                title:
                  type: string
                  description: The title of the scorecard.
                filter:
                  type: object
                  properties:
                    combinator:
                      type: string
                      enum:
                      - and
                      - or
                      description: The combinator to use when evaluating the conditions.
                    conditions:
                      type: array
                      minItems: 1
                      description: The conditions to evaluate.
                      items:
                        anyOf:
                        - type: object
                          title: Property between condition
                          properties:
                            property:
                              type: string
                            operator:
                              enum:
                              - between
                              - notBetween
                              - '='
                            value:
                              type: object
                              oneOf:
                              - type: object
                                title: Date range
                                properties:
                                  from:
                                    type: string
                                    format: date-time
                                  to:
                                    type: string
                                    format: date-time
                                required:
                                - from
                                - to
                              - type: object
                                title: Preset date range
                                properties:
                                  preset:
                                    type: string
                                    enum:
                                    - today
                                    - tomorrow
                                    - yesterday
                                    - lastWeek
                                    - last2Weeks
                                    - lastMonth
                                    - last3Months
                                    - last6Months
                                    - last12Months
                                required:
                                - preset
                          required:
                          - property
                          - operator
                          - value
                          additionalProperties: false
                        - type: object
                          title: Property containsAny condition
                          properties:
                            property:
                              type: string
                            operator:
                              type: string
                              enum:
                              - containsAny
                              - in
                            value:
                              type: array
                              items:
                                type: string
                          required:
                          - property
                          - operator
                          - value
                        - type: object
                          title: Relation containsAny condition
                          properties:
                            relation:
                              type: string
                            operator:
                              type: string
                              enum:
                              - containsAny
                              - in
                            value:
                              type: array
                              items:
                                type: string
                          required:
                          - relation
                          - operator
                          - value
                        - type: object
                          title: Property comparison
                          properties:
                            property:
                              type: string
                            operator:
                              type: string
                              enum:
                              - '='
                              - '!='
                              - '>'
                              - <
                              - '>='
                              - <=
                              - contains
                              - doesNotContains
                              - beginsWith
                              - doesNotBeginsWith
                              - endsWith
                              - doesNotEndsWith
                            value:
                              oneOf:
                              - type: string
                                title: string
                              - type: number
                                title: number
                              - type: boolean
                                title: boolean
                              - type: array
                                items:
                                  type: string
                              description: The value to compare against.
                          required:
                          - property
                          - operator
                          - value
                        - type: object
                          title: Relation comparison
                          properties:
                            relation:
                              type: string
                            operator:
                              type: string
                              enum:
                              - '='
                              - '!='
                              - '>'
                              - <
                              - '>='
                              - <=
                              - contains
                              - doesNotContains
                              - beginsWith
                              - doesNotBeginsWith
                              - endsWith
                              - doesNotEndsWith
                            value:
                              oneOf:
                              - type: string
                                title: string
                              - type: number
                                title: number
                              - type: boolean
                                title: boolean
                              - type: array
                                items:
                                  type: string
                              description: The value to compare against.
                          required:
                          - relation
                          - operator
                          - value
                        - type: object
                          title: Property empty condition
                          properties:
                            not:
                              type: boolean
                            property:
                              type: string
                            operator:
                              type: string
                              enum:
                              - isEmpty
                              - isNotEmpty
                          required:
                          - property
                          - operator
                        - type: object
                          title: Relation empty condition
                          properties:
                            not:
                              type: boolean
                            relation:
                              type: string
                            operator:
                              type: string
                              enum:
                              - isEmpty
                              - isNotEmpty
                          required:
                          - relation
                          - operator
                  required:
                  - combinator
                  - conditions
                  description: An optional set of [conditions](https://docs.port.io/scorecards/concepts-and-structure/#conditions) to filter entities that will be evaluated by the scorecard.
                properties:
                  type: object
                  propertyNames:
                    pattern: ^[A-Za-z0-9@_=\\-]+$
                  description: An object containing the additional properties of the scorecard, in `"key":"value"` pairs where the `key` is the property's identifier, and the `value` is its value.
                rules:
                  type: array
                  description: The [rules](https://docs.port.io/scorecards/concepts-and-structure/#rule-elements) that define the scorecard.
                  items:
                    type: object
                    properties:
                      identifier:
                        type: string
                        pattern: ^[A-Za-z0-9@_=\\-]+$
                        maxLength: 100
                        description: The identifier of the rule.
                      title:
                        type: string
                        description: The title of the rule.
                      description:
                        type: string
                        description: A description for the rule.
                      level:
                        type: string
                        description: The level of the rule (Gold, Silver, or Bronze).
                      query:
                        type: object
                        properties:
                          combinator:
                            type: string
                            enum:
                            - and
                            - or
                            description: The combinator to use when evaluating the conditions.
                          conditions:
                            type: array
                            minItems: 1
                            description: The conditions to evaluate.
                            items:
                              anyOf:
                              - type: object
                                title: Property between condition
                                properties:
                                  property:
                                    type: string
                                  operator:
                                    enum:
                                    - between
                                    - notBetween
                                    - '='
                                  value:
                                    type: object
                                    oneOf:
                                    - type: object
                                      title: Date range
                                      properties:
                                        from:
                                          type: string
                                          format: date-time
                                        to:
                                          type: string
                                          format: date-time
                                      required:
                                      - from
                                      - to
                                    - type: object
                                      title: Preset date range
                                      properties:
                                        preset:
                                          type: string
                                          enum:
                                          - today
                                          - tomorrow
                                          - yesterday
                                          - lastWeek
                                          - last2Weeks
                                          - lastMonth
                                          - last3Months
                                          - last6Months
                                          - last12Months
                                      required:
                                      - preset
                                required:
                                - property
                                - operator
                                - value
                                additionalProperties: false
                              - type: object
                                title: Property containsAny condition
                                properties:
                                  property:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - containsAny
                                    - in
                                  value:
                                    type: array
                                    items:
                                      type: string
                                required:
                                - property
                                - operator
                                - value
                              - type: object
                                title: Relation containsAny condition
                                properties:
                                  relation:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - containsAny
                                    - in
                                  value:
                                    type: array
                                    items:
                                      type: string
                                required:
                                - relation
                                - operator
                                - value
                              - type: object
                                title: Property comparison
                                properties:
                                  property:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - '='
                                    - '!='
                                    - '>'
                                    - <
                                    - '>='
                                    - <=
                                    - contains
                                    - doesNotContains
                                    - beginsWith
                                    - doesNotBeginsWith
                                    - endsWith
                                    - doesNotEndsWith
                                  value:
                                    oneOf:
                                    - type: string
                                      title: string
                                    - type: number
                                      title: number
                                    - type: boolean
                                      title: boolean
                                    - type: array
                                      items:
                                        type: string
                                    description: The value to compare against.
                                required:
                                - property
                                - operator
                                - value
                              - type: object
                                title: Relation comparison
                                properties:
                                  relation:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - '='
                                    - '!='
                                    - '>'
                                    - <
                                    - '>='
                                    - <=
                                    - contains
                                    - doesNotContains
                                    - beginsWith
                                    - doesNotBeginsWith
                                    - endsWith
                                    - doesNotEndsWith
                                  value:
                                    oneOf:
                                    - type: string
                                      title: string
                                    - type: number
                                      title: number
                                    - type: boolean
                                      title: boolean
                                    - type: array
                                      items:
                                        type: string
                                    description: The value to compare against.
                                required:
                                - relation
                                - operator
                                - value
                              - type: object
                                title: Property empty condition
                                properties:
                                  not:
                                    type: boolean
                                  property:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - isEmpty
                                    - isNotEmpty
                                required:
                                - property
                                - operator
                              - type: object
                                title: Relation empty condition
                                properties:
                                  not:
                                    type: boolean
                                  relation:
                                    type: string
                                  operator:
                                    type: string
                                    enum:
                                    - isEmpty
                                    - isNotEmpty
                                required:
                                - relation
                                - operator
                        required:
                        - combinator
                        - conditions
                        description: The query that defines the rule.
                    required:
                    - identifier
                    - title
                    - level
                    - query
                levels:
                  type: array
                  description: The available levels of the scorecard, each with its own name and color.
                  items:
                    type: object
                    properties:
                      title:
                        type: string
                        description: The name of the level.
                      color:
                        type: string
                        enum:
                        - blue
                        - turquoise
                        - orange
                        - purple
                        - pink
                        - yellow
                        - green
                        - red
                        - gold
                        - silver
                        - paleBlue
                        - darkGray
                        - lightGray
                        - bronze
                        - lime
                        - olive
                        - brown
                        description: The color associated with the level, for visualization in Port's UI.
                    required:
                    - title
                    - color
              if:
                properties:
                  levels:
                    type: array
                    minItems: 1
              then:
                properties:
                  rules:
                    type: array
                    items:
                      type: object
                      properties:
                        identifier:
                          type: string
                          pattern: ^(?!\.{1,2}$)[\p{L}0-9@_.+:\\/='-]+$
                          maxLength: 100
                        title:
                          type: string
                        description:
                          type: string
                        level:
                          type: string
                        query:
                          type: object
                          properties:
                            combinator:
                              type: string
                              enum:
                              - and
                              - or
                              description: The combinator to use when evaluating the conditions.
                            conditions:
                              type: array
                              minItems: 1
                              description: The conditions to evaluate.
                              items:
                                anyOf:
                                - type: object
                                  title: Property between condition
                                  properties:
                                    property:
                                      type: string
                                    operator:
                                      enum:
                                      - between
                                      - notBetween
                                      - '='
                                    value:
                                      type: object
                                      oneOf:
                                      - type: object
                                        title: Date range
                                        properties:
                                          from:
                                            type: string
                                            format: date-time
                                          to:
                                            type: string
                                            format: date-time
                                        required:
                                        - from
                                        - to
                                      - type: object
                                        title: Preset date range
                                        properties:
                                          preset:
                                            type: string
                                            enum:
                                            - today
                                            - tomorrow
                                            - yesterday
                                            - lastWeek
                                            - last2Weeks
                                            - lastMonth
                                            - last3Months
                                            - last6Months
                                            - last12Months
                                        required:
                                        - preset
                                  required:
                                  - property
                                  - operator
                                  - value
                                  additionalProperties: false
                                - type: object
                                  title: Property containsAny condition
                                  properties:
                                    property:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - containsAny
                                      - in
                                    value:
                                      type: array
                                      items:
                                        type: string
                                  required:
                                  - property
                                  - operator
                                  - value
                                - type: object
                                  title: Relation containsAny condition
                                  properties:
                                    relation:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - containsAny
                                      - in
                                    value:
                                      type: array
                                      items:
                                        type: string
                                  required:
                                  - relation
                                  - operator
                                  - value
                                - type: object
                                  title: Property comparison
                                  properties:
                                    property:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - '='
                                      - '!='
                                      - '>'
                                      - <
                                      - '>='
                                      - <=
                                      - contains
                                      - doesNotContains
                                      - beginsWith
                                      - doesNotBeginsWith
                                      - endsWith
                                      - doesNotEndsWith
                                    value:
                                      oneOf:
                                      - type: string
                                        title: string
                                      - type: number
                                        title: number
                                      - type: boolean
                                        title: boolean
                                      - type: array
                                        items:
                                          type: string
                                      description: The value to compare against.
                                  required:
                                  - property
                                  - operator
                                  - value
                                - type: object
                                  title: Relation comparison
                                  properties:
                                    relation:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - '='
                                      - '!='
                                      - '>'
                                      - <
                                      - '>='
                                      - <=
                                      - contains
                                      - doesNotContains
                                      - beginsWith
                                      - doesNotBeginsWith
                                      - endsWith
                                      - doesNotEndsWith
                                    value:
                                      oneOf:
                                      - type: string
                                        title: string
                                      - type: number
                                        title: number
                                      - type: boolean
                                        title: boolean
                                      - type: array
                                        items:
                                          type: string
                                      description: The value to compare against.
                                  required:
                                  - relation
                                  - operator
                                  - value
                                - type: object
                                  title: Property empty condition
                                  properties:
                                    not:
                                      type: boolean
                                    property:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - isEmpty
                                      - isNotEmpty
                                  required:
                                  - property
                                  - operator
                                - type: object
                                  title: Relation empty condition
                                  properties:
                                    not:
                                      type: boolean
                                    relation:
                                      type: string
                                    operator:
                                      type: string
                                      enum:
                                      - isEmpty
                                      - isNotEmpty
                                  required:
                                  - relation
                                  - operator
                          required:
                          - combinator
                          - conditions
                      required:
                      - identifier
                      - title
                      - query
              else:
                properties:
                  rules:
                    typ

# --- truncated at 32 KB (101 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/port/refs/heads/main/openapi/port-scorecards-api-openapi.yml