Create a scorecard group from an existing scorecard
POST/v1/scorecard-groups/from-scorecard/:scorecard_identifier
This route converts an existing standalone scorecard into a scorecard group. The body has the same shape as creating a scorecard group: either a per-blueprint scorecards map or shared blueprints + rules, and it must include the blueprint of the source scorecard. The source scorecard keeps its identifier and rule results and is updated with its blueprint's rules and filter; related scorecards for the other blueprints are created as {blueprint}_{groupIdentifier}.
Pass groupProperties to set additional properties on the scorecard group entity (_scorecard_group blueprint), and scorecardProperties to set additional properties on every related scorecard (_scorecard blueprint). Property keys must match custom properties you added to the corresponding blueprint. Pass groupRelations and scorecardRelations to set additional relations on the same entities; relation keys must match custom relations you added to the corresponding blueprint. On PUT, omitted relation keys are cleared; you can also pass null to clear a specific relation. To learn more, see extend the default scorecards.
This is a closed beta feature. To learn more about scorecards, check out the documentation.
Request
Parameters (JSON)
{
"parameters": [
{
"schema": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
},
"in": "path",
"name": "scorecard_identifier",
"required": true,
"description": "The identifier of the standalone scorecard to convert into a scorecard group."
}
]
}Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "object",
"properties": {
"identifier": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$",
"description": "A unique identifier for the scorecard group (logical id)."
},
"title": {
"type": "string",
"description": "The title of the scorecard group (applied to all member scorecards)."
},
"levels": {
"type": "array",
"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"
],
"additionalProperties": false
},
"description": "The available levels of the scorecard group, shared by all members."
},
"groupProperties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_scorecard_group` blueprint properties applied to the scorecard group entity. Property keys must match custom properties you added to the `_scorecard_group` blueprint. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"scorecardProperties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_scorecard` blueprint properties applied to every member scorecard in the group. Property keys must match custom properties you added to the `_scorecard` blueprint. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"groupRelations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_scorecard_group` blueprint relations applied to the scorecard group entity. Relation keys must match custom relations you added to the `_scorecard_group` blueprint, or the `$team` owning-teams meta relation when ownership is configured. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"scorecardRelations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_scorecard` blueprint relations applied to every member scorecard in the group. Relation keys must match custom relations you added to the `_scorecard` blueprint, or the `$team` owning-teams meta relation when ownership is configured. The `group` relation is managed by Port and cannot be set here. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"scorecards": {
"type": "object",
"propertyNames": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
},
"additionalProperties": {
"type": "object",
"properties": {
"filter": {
"description": "An optional set of [conditions](https://docs.port.io/governance/standards-and-compliance/concepts-and-structure/#filter-elements) to filter entities that will be evaluated by this member scorecard.",
"anyOf": [
{
"type": "object",
"properties": {
"combinator": {
"type": "string",
"enum": [
"and",
"or"
],
"description": "The combinator to use when evaluating the conditions."
},
"conditions": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"anyOf": [
{
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"from",
"to"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months"
]
}
},
"required": [
"preset"
],
"additionalProperties": false
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"property",
"operator"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"relation",
"operator"
],
"additionalProperties": false
}
]
},
"description": "The conditions to evaluate."
}
},
"required": [
"combinator",
"conditions"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9@_=\\\\-]+$",
"description": "The identifier of the rule."
},
"title": {
"type": "string",
"description": "The title of the rule."
},
"description": {
"description": "A description for the rule.",
"type": "string"
},
"level": {
"type": "string",
"description": "The level of the rule."
},
"query": {
"type": "object",
"properties": {
"combinator": {
"type": "string",
"enum": [
"and",
"or"
],
"description": "The combinator to use when evaluating the conditions."
},
"conditions": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"anyOf": [
{
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"from",
"to"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months"
]
}
},
"required": [
"preset"
],
"additionalProperties": false
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"property",
"operator"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"relation",
"operator"
],
"additionalProperties": false
}
]
},
"description": "The conditions to evaluate."
}
},
"required": [
"combinator",
"conditions"
],
"additionalProperties": false,
"description": "The query that defines the rule."
},
"properties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_rule` blueprint properties applied to this rule. Property keys must match custom properties you added to the `_rule` blueprint. On PUT, omitted keys are cleared; omit the field or pass `{}` to clear all additional properties. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"relations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_rule` blueprint relations applied to this rule. Relation keys must match custom relations you added to the `_rule` blueprint, or the `$team` owning-teams meta relation when ownership is configured. The `scorecard` relation is managed by Port and cannot be set here. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
}
},
"required": [
"identifier",
"title",
"level",
"query"
],
"additionalProperties": false
},
"description": "The [rules](https://docs.port.io/governance/standards-and-compliance/concepts-and-structure/#rule-elements) that define this member scorecard."
}
},
"required": [
"rules"
],
"additionalProperties": false
},
"description": "Map of blueprint identifier → member scorecard filter/rules. Requires at least 1 blueprint."
}
},
"required": [
"identifier",
"title",
"scorecards"
],
"additionalProperties": false,
"title": "Per-blueprint scorecards"
},
{
"type": "object",
"properties": {
"identifier": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$",
"description": "A unique identifier for the scorecard group (logical id)."
},
"title": {
"type": "string",
"description": "The title of the scorecard group (applied to all member scorecards)."
},
"levels": {
"type": "array",
"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"
],
"additionalProperties": false
},
"description": "The available levels of the scorecard group, shared by all members."
},
"groupProperties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_scorecard_group` blueprint properties applied to the scorecard group entity. Property keys must match custom properties you added to the `_scorecard_group` blueprint. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"scorecardProperties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_scorecard` blueprint properties applied to every member scorecard in the group. Property keys must match custom properties you added to the `_scorecard` blueprint. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"groupRelations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_scorecard_group` blueprint relations applied to the scorecard group entity. Relation keys must match custom relations you added to the `_scorecard_group` blueprint, or the `$team` owning-teams meta relation when ownership is configured. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"scorecardRelations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_scorecard` blueprint relations applied to every member scorecard in the group. Relation keys must match custom relations you added to the `_scorecard` blueprint, or the `$team` owning-teams meta relation when ownership is configured. The `group` relation is managed by Port and cannot be set here. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"blueprints": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
},
"description": "Blueprint identifiers that share the same rules. Requires at least 1."
},
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9@_=\\\\-]+$",
"description": "The identifier of the rule."
},
"title": {
"type": "string",
"description": "The title of the rule."
},
"description": {
"description": "A description for the rule.",
"type": "string"
},
"level": {
"type": "string",
"description": "The level of the rule."
},
"query": {
"type": "object",
"properties": {
"combinator": {
"type": "string",
"enum": [
"and",
"or"
],
"description": "The combinator to use when evaluating the conditions."
},
"conditions": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"anyOf": [
{
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"from",
"to"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months"
]
}
},
"required": [
"preset"
],
"additionalProperties": false
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"property",
"operator"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"relation",
"operator"
],
"additionalProperties": false
}
]
},
"description": "The conditions to evaluate."
}
},
"required": [
"combinator",
"conditions"
],
"additionalProperties": false,
"description": "The query that defines the rule."
},
"properties": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
"additionalProperties": {},
"description": "Additional `_rule` blueprint properties applied to this rule. Property keys must match custom properties you added to the `_rule` blueprint. On PUT, omitted keys are cleared; omit the field or pass `{}` to clear all additional properties. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
},
"relations": {
"type": "object",
"propertyNames": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$"
},
{
"type": "string",
"enum": [
"$team"
]
}
]
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"description": "Additional `_rule` blueprint relations applied to this rule. Relation keys must match custom relations you added to the `_rule` blueprint, or the `$team` owning-teams meta relation when ownership is configured. The `scorecard` relation is managed by Port and cannot be set here. Pass `null` to clear a relation, or omit a key to clear it on PUT. To learn more, see [extend the default scorecards](https://docs.port.io/governance/standards-and-compliance/examples/extend-data-model/)."
}
},
"required": [
"identifier",
"title",
"level",
"query"
],
"additionalProperties": false
},
"description": "The [rules](https://docs.port.io/governance/standards-and-compliance/concepts-and-structure/#rule-elements) applied to every member scorecard."
},
"filters": {
"description": "Optional per-blueprint [conditions](https://docs.port.io/governance/standards-and-compliance/concepts-and-structure/#filter-elements). Keys must be blueprint identifiers listed in `blueprints`.",
"type": "object",
"propertyNames": {
"type": "string",
"maxLength": 100,
"pattern": "^(?!\\.{1,2}$)[\\p{L}0-9@_.+:\\\\/='-]+$"
},
"additionalProperties": {
"anyOf": [
{
"type": "object",
"properties": {
"combinator": {
"type": "string",
"enum": [
"and",
"or"
],
"description": "The combinator to use when evaluating the conditions."
},
"conditions": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"between",
"notBetween",
"="
]
},
"value": {
"anyOf": [
{
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"from",
"to"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": [
"today",
"tomorrow",
"yesterday",
"lastWeek",
"last2Weeks",
"lastMonth",
"last3Months",
"last6Months",
"last12Months"
]
}
},
"required": [
"preset"
],
"additionalProperties": false
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"containsAny",
"in"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"property",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"=",
"!=",
">",
"<",
">=",
"<=",
"contains",
"doesNotContains",
"beginsWith",
"doesNotBeginsWith",
"endsWith",
"doesNotEndsWith"
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"relation",
"operator",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"property": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"property",
"operator"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"not": {
"type": "boolean"
},
"relation": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"isEmpty",
"isNotEmpty"
]
}
},
"required": [
"relation",
"operator"
],
"additionalProperties": false
}
]
},
"description": "The conditions to evaluate."
}
},
"required": [
"combinator",
"conditions"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
}
},
"required": [
"identifier",
"title",
"blueprints",
"rules"
],
"additionalProperties": false,
"title": "Shared rules"
}
]
}
}
}
}
}Responses
- 401
- 404
- 413
- 422
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}