Automation request schemas
Closed rule inputs, event types, predicates and action variants.
Closed rule inputs, event types, predicates and action variants.
Use these request bodies with the automation CLI's --body flag. JSON Schema captures shape, bounds and enum values; semantic validation still applies. Conditions use only whitelisted envelope fields or one-level payload.<key> access, not arbitrary expressions. Read automation behavior before enabling a rule.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"trigger": {
"type": "object",
"properties": {
"eventType": {
"type": "string",
"enum": [
"subscription.created",
"subscription.updated",
"subscription.canceled",
"payment.succeeded",
"payment.failed",
"entitlement.changed",
"usage.threshold_reached",
"rate_limit.exceeded",
"usage.recorded",
"usage.archive_checkpoint",
"gateway.request_denied",
"change_set.created",
"change_set.approved",
"change_set.applied",
"change_set.rolled_back",
"change_set.cancelled",
"billing.event_recorded",
"authz.decision",
"repo.changed",
"automation.rule_fired",
"automation.action_succeeded",
"automation.action_failed",
"automation.action_denied",
"automation.notification",
"access_request.created",
"access_request.resolved",
"build.failed",
"product.published",
"workflow.failed",
"pr.review_posted"
]
},
"filter": {
"type": "object",
"properties": {
"subjectType": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"subjectId": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"additionalProperties": false
}
},
"required": [
"eventType"
],
"additionalProperties": false
},
"conditions": {
"default": [],
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"minLength": 1,
"maxLength": 136
},
"operator": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"lt",
"contains",
"path_prefix"
]
},
"value": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
"required": [
"path",
"operator",
"value"
],
"additionalProperties": false
}
},
"actions": {
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "emit_webhook_event"
},
"event": {
"type": "string",
"enum": [
"subscription.created",
"subscription.updated",
"subscription.canceled",
"payment.succeeded",
"payment.failed",
"entitlement.changed",
"usage.threshold_reached"
]
},
"payload": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"kind",
"event",
"payload"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "create_notification"
},
"level": {
"default": "info",
"type": "string",
"enum": [
"info",
"warning",
"critical"
]
},
"message": {
"type": "string",
"minLength": 1,
"maxLength": 2000
}
},
"required": [
"kind",
"level",
"message"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "propose_change_set"
},
"intent": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"roleKey": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"permissions": {
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
}
},
"required": [
"kind",
"intent",
"roleKey",
"permissions"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "notify_audience"
},
"audience": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"class": {
"type": "string",
"enum": [
"product_update",
"transactional"
]
},
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 20000
}
},
"required": [
"kind",
"audience",
"class",
"subject",
"body"
],
"additionalProperties": false
}
]
}
},
"enabled": {
"default": true,
"type": "boolean"
},
"schemaVersion": {
"default": 1,
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"name",
"trigger",
"conditions",
"actions",
"enabled",
"schemaVersion"
],
"additionalProperties": false
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"trigger": {
"type": "object",
"properties": {
"eventType": {
"type": "string",
"enum": [
"subscription.created",
"subscription.updated",
"subscription.canceled",
"payment.succeeded",
"payment.failed",
"entitlement.changed",
"usage.threshold_reached",
"rate_limit.exceeded",
"usage.recorded",
"usage.archive_checkpoint",
"gateway.request_denied",
"change_set.created",
"change_set.approved",
"change_set.applied",
"change_set.rolled_back",
"change_set.cancelled",
"billing.event_recorded",
"authz.decision",
"repo.changed",
"automation.rule_fired",
"automation.action_succeeded",
"automation.action_failed",
"automation.action_denied",
"automation.notification",
"access_request.created",
"access_request.resolved",
"build.failed",
"product.published",
"workflow.failed",
"pr.review_posted"
]
},
"filter": {
"type": "object",
"properties": {
"subjectType": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"subjectId": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"additionalProperties": false
}
},
"required": [
"eventType"
],
"additionalProperties": false
},
"conditions": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"minLength": 1,
"maxLength": 136
},
"operator": {
"type": "string",
"enum": [
"eq",
"neq",
"gt",
"lt",
"contains",
"path_prefix"
]
},
"value": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
"required": [
"path",
"operator",
"value"
],
"additionalProperties": false
}
},
"actions": {
"minItems": 1,
"maxItems": 10,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "emit_webhook_event"
},
"event": {
"type": "string",
"enum": [
"subscription.created",
"subscription.updated",
"subscription.canceled",
"payment.succeeded",
"payment.failed",
"entitlement.changed",
"usage.threshold_reached"
]
},
"payload": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"kind",
"event",
"payload"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "create_notification"
},
"level": {
"default": "info",
"type": "string",
"enum": [
"info",
"warning",
"critical"
]
},
"message": {
"type": "string",
"minLength": 1,
"maxLength": 2000
}
},
"required": [
"kind",
"level",
"message"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "propose_change_set"
},
"intent": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"roleKey": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"permissions": {
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
}
},
"required": [
"kind",
"intent",
"roleKey",
"permissions"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "notify_audience"
},
"audience": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
},
"class": {
"type": "string",
"enum": [
"product_update",
"transactional"
]
},
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 20000
}
},
"required": [
"kind",
"audience",
"class",
"subject",
"body"
],
"additionalProperties": false
}
]
}
},
"enabled": {
"type": "boolean"
}
},
"additionalProperties": false
}