# Preview rule

Checks a rule without saving it, and reports what it would do: its next scheduled wake times, a plain-language summary of its behavior, and how each of its source bindings would be collected.

`POST /v1/users/{userId}/automations/preview`

## Authentication

Both headers are required.

- Header: `X-Api-Key: YOUR_API_KEY`
- Header: `Authorization: Bearer YOUR_USER_TOKEN`

## Path parameters



```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "in": "path",
    "name": "userId",
    "required": true,
    "description": "The user in the path; must equal the token's own account."
  }
]
```


## Request body



```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AutomationRuleInput"
          }
        },
        "required": [
          "rule"
        ],
        "additionalProperties": false
      }
    }
  }
}
```


## Request example

Illustrative request. Replace the host, credentials and resource IDs with your own. If a request file is shown, create it from the schema above. Review the requested action before sending it.

```sh
curl --request POST 'https://api.example.test/v1/users/YOUR_USER_ID/automations/preview' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Authorization: Bearer YOUR_USER_TOKEN' \
  --header 'Content-Type: application/json' \
  --data-binary '@request.json'
```

## Responses

### 200

What the rule would do.



```json
{
  "description": "What the rule would do.",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "nextTimes": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "description": "Up to 5 of this rule's next scheduled wake times, when it has a clock."
          },
          "summary": {
            "type": "string",
            "description": "A plain-language sentence describing when this rule wakes, its condition, and how it fires."
          },
          "sourcePlans": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "binding": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "result": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "The binding is fully planned and ready to collect.",
                          "enum": [
                            "ready"
                          ]
                        },
                        "plan": {
                          "type": "object",
                          "properties": {
                            "operationId": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                              "description": "The collection operation this plan uses."
                            },
                            "operationVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The collection operation's version."
                            },
                            "descriptorFingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$",
                              "description": "A content hash of the source descriptor this plan was built from."
                            },
                            "config": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/AutomationJsonValue"
                              },
                              "description": "Arbitrary JSON data for this event: a manual invocation's or signal's payload, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                            },
                            "requirement": {
                              "type": "object",
                              "properties": {
                                "maxLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 86400,
                                  "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                },
                                "allowDegradedLatency": {
                                  "type": "boolean",
                                  "description": "Whether delivery slower than the target delay is still accepted."
                                },
                                "maxAcceptedLatencySeconds": {
                                  "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2147483
                                }
                              },
                              "required": [
                                "maxLatencySeconds",
                                "maxAgeSeconds",
                                "allowDegradedLatency"
                              ],
                              "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                            },
                            "guarantees": {
                              "type": "object",
                              "properties": {
                                "minCadenceSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "The shortest interval between requests the provider permits, in seconds."
                                },
                                "expectedLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                },
                                "requestsPerMinute": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The provider's own rate limit for this source, when it publishes one."
                                },
                                "observationReuseSeconds": {
                                  "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483
                                },
                                "batchLimit": {
                                  "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 1000
                                }
                              },
                              "required": [
                                "minCadenceSeconds",
                                "expectedLatencySeconds",
                                "maxAgeSeconds",
                                "requestsPerMinute"
                              ],
                              "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                            },
                            "scopeKind": {
                              "type": "string",
                              "enum": [
                                "public",
                                "user"
                              ],
                              "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                            },
                            "explanation": {
                              "type": "string",
                              "maxLength": 2048,
                              "description": "Why this plan was chosen, in the reviewer's own words."
                            },
                            "recipe": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991,
                                  "description": "The recipe description's own version, bumped when its steps change."
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120,
                                  "description": "The recipe's short label, for the reviewed catalog."
                                },
                                "summary": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 600,
                                  "description": "What the recipe does, for the reviewed catalog."
                                },
                                "steps": {
                                  "minItems": 1,
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                        "description": "The step's identifier, unique within its recipe."
                                      },
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "request",
                                          "validate",
                                          "calculate"
                                        ],
                                        "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The step's short label, for the reviewed catalog."
                                      },
                                      "description": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What this step does, for the reviewed catalog."
                                      },
                                      "api": {
                                        "type": "object",
                                        "properties": {
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "GRAPHQL"
                                            ],
                                            "description": "The request's method or protocol."
                                          },
                                          "resource": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 160,
                                            "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                            "description": "The request's path or resource name."
                                          }
                                        },
                                        "required": [
                                          "method",
                                          "resource"
                                        ],
                                        "description": "The request this step makes, when it calls the provider."
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "kind",
                                      "title",
                                      "description"
                                    ]
                                  },
                                  "description": "The recipe's steps, in order."
                                },
                                "limitations": {
                                  "maxItems": 6,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 600
                                  },
                                  "description": "What the recipe does not cover, in the reviewer's own words."
                                },
                                "fingerprint": {
                                  "type": "string",
                                  "pattern": "^[a-f0-9]{64}$",
                                  "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                }
                              },
                              "required": [
                                "version",
                                "title",
                                "summary",
                                "steps",
                                "limitations",
                                "fingerprint"
                              ],
                              "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                            },
                            "degraded": {
                              "type": "boolean",
                              "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                            }
                          },
                          "required": [
                            "operationId",
                            "operationVersion",
                            "descriptorFingerprint",
                            "config",
                            "requirement",
                            "guarantees",
                            "scopeKind",
                            "explanation",
                            "degraded"
                          ],
                          "description": "How one binding will actually be collected: the operation, its guarantees and its configuration."
                        }
                      },
                      "required": [
                        "status",
                        "plan"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "The binding is plannable but needs a connection the owner has not granted yet.",
                          "enum": [
                            "needs_connection"
                          ]
                        },
                        "candidatePlan": {
                          "type": "object",
                          "properties": {
                            "operationId": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                              "description": "The collection operation this plan uses."
                            },
                            "operationVersion": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991,
                              "description": "The collection operation's version."
                            },
                            "descriptorFingerprint": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$",
                              "description": "A content hash of the source descriptor this plan was built from."
                            },
                            "config": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/AutomationJsonValue"
                              },
                              "description": "Arbitrary JSON data for this event: a manual invocation's or signal's payload, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                            },
                            "requirement": {
                              "type": "object",
                              "properties": {
                                "maxLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 86400,
                                  "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                },
                                "allowDegradedLatency": {
                                  "type": "boolean",
                                  "description": "Whether delivery slower than the target delay is still accepted."
                                },
                                "maxAcceptedLatencySeconds": {
                                  "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2147483
                                }
                              },
                              "required": [
                                "maxLatencySeconds",
                                "maxAgeSeconds",
                                "allowDegradedLatency"
                              ],
                              "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                            },
                            "guarantees": {
                              "type": "object",
                              "properties": {
                                "minCadenceSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "The shortest interval between requests the provider permits, in seconds."
                                },
                                "expectedLatencySeconds": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 2147483
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                },
                                "maxAgeSeconds": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483,
                                  "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                },
                                "requestsPerMinute": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The provider's own rate limit for this source, when it publishes one."
                                },
                                "observationReuseSeconds": {
                                  "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 2147483
                                },
                                "batchLimit": {
                                  "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 1000
                                }
                              },
                              "required": [
                                "minCadenceSeconds",
                                "expectedLatencySeconds",
                                "maxAgeSeconds",
                                "requestsPerMinute"
                              ],
                              "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                            },
                            "scopeKind": {
                              "type": "string",
                              "enum": [
                                "public",
                                "user"
                              ],
                              "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                            },
                            "explanation": {
                              "type": "string",
                              "maxLength": 2048,
                              "description": "Why this plan was chosen, in the reviewer's own words."
                            },
                            "recipe": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991,
                                  "description": "The recipe description's own version, bumped when its steps change."
                                },
                                "title": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 120,
                                  "description": "The recipe's short label, for the reviewed catalog."
                                },
                                "summary": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 600,
                                  "description": "What the recipe does, for the reviewed catalog."
                                },
                                "steps": {
                                  "minItems": 1,
                                  "maxItems": 12,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                        "description": "The step's identifier, unique within its recipe."
                                      },
                                      "kind": {
                                        "type": "string",
                                        "enum": [
                                          "request",
                                          "validate",
                                          "calculate"
                                        ],
                                        "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The step's short label, for the reviewed catalog."
                                      },
                                      "description": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What this step does, for the reviewed catalog."
                                      },
                                      "api": {
                                        "type": "object",
                                        "properties": {
                                          "method": {
                                            "type": "string",
                                            "enum": [
                                              "GET",
                                              "POST",
                                              "GRAPHQL"
                                            ],
                                            "description": "The request's method or protocol."
                                          },
                                          "resource": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 160,
                                            "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                            "description": "The request's path or resource name."
                                          }
                                        },
                                        "required": [
                                          "method",
                                          "resource"
                                        ],
                                        "description": "The request this step makes, when it calls the provider."
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "kind",
                                      "title",
                                      "description"
                                    ]
                                  },
                                  "description": "The recipe's steps, in order."
                                },
                                "limitations": {
                                  "maxItems": 6,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 600
                                  },
                                  "description": "What the recipe does not cover, in the reviewer's own words."
                                },
                                "fingerprint": {
                                  "type": "string",
                                  "pattern": "^[a-f0-9]{64}$",
                                  "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                }
                              },
                              "required": [
                                "version",
                                "title",
                                "summary",
                                "steps",
                                "limitations",
                                "fingerprint"
                              ],
                              "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                            },
                            "degraded": {
                              "type": "boolean",
                              "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                            }
                          },
                          "required": [
                            "operationId",
                            "operationVersion",
                            "descriptorFingerprint",
                            "config",
                            "requirement",
                            "guarantees",
                            "scopeKind",
                            "explanation",
                            "degraded"
                          ],
                          "description": "The plan that would apply once the missing connection is granted."
                        },
                        "reasons": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80,
                                "description": "A machine-readable reason code."
                              },
                              "path": {
                                "description": "The field this reason is about, when it is about one.",
                                "type": "string",
                                "maxLength": 256
                              },
                              "message": {
                                "type": "string",
                                "maxLength": 2048,
                                "description": "The reason, in the reviewer's own words."
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ]
                          },
                          "description": "Why this binding could not be planned as asked."
                        }
                      },
                      "required": [
                        "status",
                        "candidatePlan",
                        "reasons"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "The binding cannot be planned at all, as asked.",
                          "enum": [
                            "unsupported"
                          ]
                        },
                        "reasons": {
                          "minItems": 1,
                          "maxItems": 32,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80,
                                "description": "A machine-readable reason code."
                              },
                              "path": {
                                "description": "The field this reason is about, when it is about one.",
                                "type": "string",
                                "maxLength": 256
                              },
                              "message": {
                                "type": "string",
                                "maxLength": 2048,
                                "description": "The reason, in the reviewer's own words."
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ]
                          },
                          "description": "Why this binding could not be planned as asked."
                        }
                      },
                      "required": [
                        "status",
                        "reasons"
                      ]
                    }
                  ],
                  "description": "Whether this binding is ready, needs a connection, or is unsupported, and why."
                }
              },
              "required": [
                "binding",
                "result"
              ]
            },
            "description": "How each of the rule's bindings would be collected, were this rule saved."
          }
        },
        "required": [
          "nextTimes",
          "summary",
          "sourcePlans"
        ]
      }
    }
  }
}
```


### 400

The request could not be read as this operation expects.

- `invalid_input` — the body or query failed validation; `issues` names each field
- `invalid_cursor` — the `cursor` is not one this list minted



```json
{
  "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 401

A credential is missing, invalid or expired.

- `partner_key_required` — no `X-Api-Key` header was sent
- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked
- `credential_expired` — the user token has expired; obtain a fresh one



```json
{
  "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 403

The credentials are valid but may not do this.

- `subject_mismatch` — the `{userId}` in the path is not the token's user
- `account_disabled` — an operator disabled the account
- `origin_rejected` — a browser `Origin` other than the configured web origin



```json
{
  "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 404

The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.



```json
{
  "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 409

The operation lost to the current state.

- `automation_invalid` — the automation's definition cannot run as written



```json
{
  "description": "The operation lost to the current state.\n\n- `automation_invalid` — the automation's definition cannot run as written",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 412

The identity is verified but has no account yet.

- `account_not_provisioned` — the identity is verified but has no account yet; call `users.ensure` first



```json
{
  "description": "The identity is verified but has no account yet.\n\n- `account_not_provisioned` — the identity is verified but has no account yet; call `users.ensure` first",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 413

The body exceeds the size this deployment accepts.



```json
{
  "description": "The body exceeds the size this deployment accepts.",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 429

A limiter refused the request; honour `Retry-After`.

- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`



```json
{
  "description": "A limiter refused the request; honour `Retry-After`.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 500

A fault on our side; quote `requestId` when reporting it.

- `internal` — a fault on our side; quote `requestId` when reporting it



```json
{
  "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


### 503

The replica is draining or a dependency did not answer; `retryable` says whether to try again.

- `internal` — a fault on our side; quote `requestId` when reporting it



```json
{
  "description": "The replica is draining or a dependency did not answer; `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
  "content": {
    "application/problem+json": {
      "schema": {
        "$ref": "#/components/schemas/ProblemDetails"
      }
    }
  }
}
```


## Complete OpenAPI definition

The exact operation and all referenced components, including recursive schemas.



```json
{
  "operation": {
    "operationId": "automations.preview",
    "summary": "Preview rule",
    "tags": [
      "automations"
    ],
    "description": "Checks a rule without saving it, and reports what it would do: its next scheduled wake times, a plain-language summary of its behavior, and how each of its source bindings would be collected.",
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "rule": {
                "$ref": "#/components/schemas/AutomationRuleInput"
              }
            },
            "required": [
              "rule"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "parameters": [
      {
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "in": "path",
        "name": "userId",
        "required": true,
        "description": "The user in the path; must equal the token's own account."
      }
    ],
    "security": [
      {
        "apiKey": [],
        "userToken": []
      }
    ],
    "responses": {
      "200": {
        "description": "What the rule would do.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "nextTimes": {
                  "maxItems": 5,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "description": "Up to 5 of this rule's next scheduled wake times, when it has a clock."
                },
                "summary": {
                  "type": "string",
                  "description": "A plain-language sentence describing when this rule wakes, its condition, and how it fires."
                },
                "sourcePlans": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "binding": {
                        "type": "string",
                        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                        "description": "The binding name a rule or a plan gives one configured source."
                      },
                      "result": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "description": "The binding is fully planned and ready to collect.",
                                "enum": [
                                  "ready"
                                ]
                              },
                              "plan": {
                                "type": "object",
                                "properties": {
                                  "operationId": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                                    "description": "The collection operation this plan uses."
                                  },
                                  "operationVersion": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991,
                                    "description": "The collection operation's version."
                                  },
                                  "descriptorFingerprint": {
                                    "type": "string",
                                    "pattern": "^[a-f0-9]{64}$",
                                    "description": "A content hash of the source descriptor this plan was built from."
                                  },
                                  "config": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/AutomationJsonValue"
                                    },
                                    "description": "Arbitrary JSON data for this event: a manual invocation's or signal's payload, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                                  },
                                  "requirement": {
                                    "type": "object",
                                    "properties": {
                                      "maxLatencySeconds": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 2147483
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                      },
                                      "maxAgeSeconds": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 86400,
                                        "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                      },
                                      "allowDegradedLatency": {
                                        "type": "boolean",
                                        "description": "Whether delivery slower than the target delay is still accepted."
                                      },
                                      "maxAcceptedLatencySeconds": {
                                        "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 2147483
                                      }
                                    },
                                    "required": [
                                      "maxLatencySeconds",
                                      "maxAgeSeconds",
                                      "allowDegradedLatency"
                                    ],
                                    "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                                  },
                                  "guarantees": {
                                    "type": "object",
                                    "properties": {
                                      "minCadenceSeconds": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483,
                                        "description": "The shortest interval between requests the provider permits, in seconds."
                                      },
                                      "expectedLatencySeconds": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 2147483
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                      },
                                      "maxAgeSeconds": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483,
                                        "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                      },
                                      "requestsPerMinute": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "The provider's own rate limit for this source, when it publishes one."
                                      },
                                      "observationReuseSeconds": {
                                        "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483
                                      },
                                      "batchLimit": {
                                        "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 1000
                                      }
                                    },
                                    "required": [
                                      "minCadenceSeconds",
                                      "expectedLatencySeconds",
                                      "maxAgeSeconds",
                                      "requestsPerMinute"
                                    ],
                                    "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                                  },
                                  "scopeKind": {
                                    "type": "string",
                                    "enum": [
                                      "public",
                                      "user"
                                    ],
                                    "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                                  },
                                  "explanation": {
                                    "type": "string",
                                    "maxLength": 2048,
                                    "description": "Why this plan was chosen, in the reviewer's own words."
                                  },
                                  "recipe": {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991,
                                        "description": "The recipe description's own version, bumped when its steps change."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The recipe's short label, for the reviewed catalog."
                                      },
                                      "summary": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What the recipe does, for the reviewed catalog."
                                      },
                                      "steps": {
                                        "minItems": 1,
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                              "description": "The step's identifier, unique within its recipe."
                                            },
                                            "kind": {
                                              "type": "string",
                                              "enum": [
                                                "request",
                                                "validate",
                                                "calculate"
                                              ],
                                              "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 120,
                                              "description": "The step's short label, for the reviewed catalog."
                                            },
                                            "description": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 600,
                                              "description": "What this step does, for the reviewed catalog."
                                            },
                                            "api": {
                                              "type": "object",
                                              "properties": {
                                                "method": {
                                                  "type": "string",
                                                  "enum": [
                                                    "GET",
                                                    "POST",
                                                    "GRAPHQL"
                                                  ],
                                                  "description": "The request's method or protocol."
                                                },
                                                "resource": {
                                                  "type": "string",
                                                  "minLength": 1,
                                                  "maxLength": 160,
                                                  "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                                  "description": "The request's path or resource name."
                                                }
                                              },
                                              "required": [
                                                "method",
                                                "resource"
                                              ],
                                              "description": "The request this step makes, when it calls the provider."
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "kind",
                                            "title",
                                            "description"
                                          ]
                                        },
                                        "description": "The recipe's steps, in order."
                                      },
                                      "limitations": {
                                        "maxItems": 6,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 600
                                        },
                                        "description": "What the recipe does not cover, in the reviewer's own words."
                                      },
                                      "fingerprint": {
                                        "type": "string",
                                        "pattern": "^[a-f0-9]{64}$",
                                        "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "title",
                                      "summary",
                                      "steps",
                                      "limitations",
                                      "fingerprint"
                                    ],
                                    "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                                  },
                                  "degraded": {
                                    "type": "boolean",
                                    "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                                  }
                                },
                                "required": [
                                  "operationId",
                                  "operationVersion",
                                  "descriptorFingerprint",
                                  "config",
                                  "requirement",
                                  "guarantees",
                                  "scopeKind",
                                  "explanation",
                                  "degraded"
                                ],
                                "description": "How one binding will actually be collected: the operation, its guarantees and its configuration."
                              }
                            },
                            "required": [
                              "status",
                              "plan"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "description": "The binding is plannable but needs a connection the owner has not granted yet.",
                                "enum": [
                                  "needs_connection"
                                ]
                              },
                              "candidatePlan": {
                                "type": "object",
                                "properties": {
                                  "operationId": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                                    "description": "The collection operation this plan uses."
                                  },
                                  "operationVersion": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991,
                                    "description": "The collection operation's version."
                                  },
                                  "descriptorFingerprint": {
                                    "type": "string",
                                    "pattern": "^[a-f0-9]{64}$",
                                    "description": "A content hash of the source descriptor this plan was built from."
                                  },
                                  "config": {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string"
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/AutomationJsonValue"
                                    },
                                    "description": "Arbitrary JSON data for this event: a manual invocation's or signal's payload, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                                  },
                                  "requirement": {
                                    "type": "object",
                                    "properties": {
                                      "maxLatencySeconds": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 2147483
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                                      },
                                      "maxAgeSeconds": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 86400,
                                        "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                                      },
                                      "allowDegradedLatency": {
                                        "type": "boolean",
                                        "description": "Whether delivery slower than the target delay is still accepted."
                                      },
                                      "maxAcceptedLatencySeconds": {
                                        "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 2147483
                                      }
                                    },
                                    "required": [
                                      "maxLatencySeconds",
                                      "maxAgeSeconds",
                                      "allowDegradedLatency"
                                    ],
                                    "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                                  },
                                  "guarantees": {
                                    "type": "object",
                                    "properties": {
                                      "minCadenceSeconds": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483,
                                        "description": "The shortest interval between requests the provider permits, in seconds."
                                      },
                                      "expectedLatencySeconds": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 2147483
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "How stale the provider's own value may be when it answers, in seconds; null when the provider establishes no bound. A reader with a delivery deadline cannot use a source that promises nothing here."
                                      },
                                      "maxAgeSeconds": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483,
                                        "description": "Maximum snapshot observation age accepted at collection. This acquisition guarantee does not shorten a reader's separately declared evaluation-age window."
                                      },
                                      "requestsPerMinute": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "exclusiveMinimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ],
                                        "description": "The provider's own rate limit for this source, when it publishes one."
                                      },
                                      "observationReuseSeconds": {
                                        "description": "How long one provider observation may serve every reader watching the same subject under the same connection, in seconds. Absent or 0 means each reader causes its own request. A reused observation keeps the provider's own `sourceTime`, so declared freshness still governs; what reuse changes is how often the provider is asked, not how old an accepted observation may be. Keep it at or below the cadence readers are expected to poll at.",
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 2147483
                                      },
                                      "batchLimit": {
                                        "description": "How many distinct subjects the provider can serve in one request. Absent or 1 means no batching. Only providers implementing `readBatch` may declare more: the framework cannot infer that an API accepts several subjects.",
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 1000
                                      }
                                    },
                                    "required": [
                                      "minCadenceSeconds",
                                      "expectedLatencySeconds",
                                      "maxAgeSeconds",
                                      "requestsPerMinute"
                                    ],
                                    "description": "What an operation promises about the snapshots it serves: cadence, freshness and how many subjects it can batch. Describes sampled state; nothing here promises that a change between two polls was seen."
                                  },
                                  "scopeKind": {
                                    "type": "string",
                                    "enum": [
                                      "public",
                                      "user"
                                    ],
                                    "description": "Who this binding is scoped to: `public` data anyone can read, `user` data read under the owner's own connection."
                                  },
                                  "explanation": {
                                    "type": "string",
                                    "maxLength": 2048,
                                    "description": "Why this plan was chosen, in the reviewer's own words."
                                  },
                                  "recipe": {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "integer",
                                        "exclusiveMinimum": 0,
                                        "maximum": 9007199254740991,
                                        "description": "The recipe description's own version, bumped when its steps change."
                                      },
                                      "title": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120,
                                        "description": "The recipe's short label, for the reviewed catalog."
                                      },
                                      "summary": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 600,
                                        "description": "What the recipe does, for the reviewed catalog."
                                      },
                                      "steps": {
                                        "minItems": 1,
                                        "maxItems": 12,
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string",
                                              "pattern": "^[a-z][a-z0-9_-]{0,47}$",
                                              "description": "The step's identifier, unique within its recipe."
                                            },
                                            "kind": {
                                              "type": "string",
                                              "enum": [
                                                "request",
                                                "validate",
                                                "calculate"
                                              ],
                                              "description": "What this step does: `request` calls the provider, `validate` checks what it returned, `calculate` derives a value from earlier steps."
                                            },
                                            "title": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 120,
                                              "description": "The step's short label, for the reviewed catalog."
                                            },
                                            "description": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 600,
                                              "description": "What this step does, for the reviewed catalog."
                                            },
                                            "api": {
                                              "type": "object",
                                              "properties": {
                                                "method": {
                                                  "type": "string",
                                                  "enum": [
                                                    "GET",
                                                    "POST",
                                                    "GRAPHQL"
                                                  ],
                                                  "description": "The request's method or protocol."
                                                },
                                                "resource": {
                                                  "type": "string",
                                                  "minLength": 1,
                                                  "maxLength": 160,
                                                  "pattern": "^\\/?[A-Za-z0-9_{}][A-Za-z0-9_./{} -]*$",
                                                  "description": "The request's path or resource name."
                                                }
                                              },
                                              "required": [
                                                "method",
                                                "resource"
                                              ],
                                              "description": "The request this step makes, when it calls the provider."
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "kind",
                                            "title",
                                            "description"
                                          ]
                                        },
                                        "description": "The recipe's steps, in order."
                                      },
                                      "limitations": {
                                        "maxItems": 6,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 600
                                        },
                                        "description": "What the recipe does not cover, in the reviewer's own words."
                                      },
                                      "fingerprint": {
                                        "type": "string",
                                        "pattern": "^[a-f0-9]{64}$",
                                        "description": "A content hash identifying this exact recipe, independent of execution or connection identity."
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "title",
                                      "summary",
                                      "steps",
                                      "limitations",
                                      "fingerprint"
                                    ],
                                    "description": "A reviewed, public description of how a source is collected: the steps a reviewer confirmed, never an executable request or a resolved private endpoint."
                                  },
                                  "degraded": {
                                    "type": "boolean",
                                    "description": "Whether this plan settled for weaker guarantees than the rule asked for."
                                  }
                                },
                                "required": [
                                  "operationId",
                                  "operationVersion",
                                  "descriptorFingerprint",
                                  "config",
                                  "requirement",
                                  "guarantees",
                                  "scopeKind",
                                  "explanation",
                                  "degraded"
                                ],
                                "description": "The plan that would apply once the missing connection is granted."
                              },
                              "reasons": {
                                "minItems": 1,
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80,
                                      "description": "A machine-readable reason code."
                                    },
                                    "path": {
                                      "description": "The field this reason is about, when it is about one.",
                                      "type": "string",
                                      "maxLength": 256
                                    },
                                    "message": {
                                      "type": "string",
                                      "maxLength": 2048,
                                      "description": "The reason, in the reviewer's own words."
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message"
                                  ]
                                },
                                "description": "Why this binding could not be planned as asked."
                              }
                            },
                            "required": [
                              "status",
                              "candidatePlan",
                              "reasons"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "description": "The binding cannot be planned at all, as asked.",
                                "enum": [
                                  "unsupported"
                                ]
                              },
                              "reasons": {
                                "minItems": 1,
                                "maxItems": 32,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80,
                                      "description": "A machine-readable reason code."
                                    },
                                    "path": {
                                      "description": "The field this reason is about, when it is about one.",
                                      "type": "string",
                                      "maxLength": 256
                                    },
                                    "message": {
                                      "type": "string",
                                      "maxLength": 2048,
                                      "description": "The reason, in the reviewer's own words."
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "message"
                                  ]
                                },
                                "description": "Why this binding could not be planned as asked."
                              }
                            },
                            "required": [
                              "status",
                              "reasons"
                            ]
                          }
                        ],
                        "description": "Whether this binding is ready, needs a connection, or is unsupported, and why."
                      }
                    },
                    "required": [
                      "binding",
                      "result"
                    ]
                  },
                  "description": "How each of the rule's bindings would be collected, were this rule saved."
                }
              },
              "required": [
                "nextTimes",
                "summary",
                "sourcePlans"
              ]
            }
          }
        }
      },
      "400": {
        "$ref": "#/components/responses/InvalidInput"
      },
      "401": {
        "$ref": "#/components/responses/Unauthorized"
      },
      "403": {
        "$ref": "#/components/responses/Forbidden"
      },
      "404": {
        "$ref": "#/components/responses/NotFound"
      },
      "409": {
        "description": "The operation lost to the current state.\n\n- `automation_invalid` — the automation's definition cannot run as written",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "412": {
        "$ref": "#/components/responses/AccountNotProvisioned"
      },
      "413": {
        "$ref": "#/components/responses/PayloadTooLarge"
      },
      "429": {
        "$ref": "#/components/responses/TooManyRequests"
      },
      "500": {
        "$ref": "#/components/responses/Internal"
      },
      "503": {
        "$ref": "#/components/responses/Unavailable"
      }
    }
  },
  "components": {
    "schemas": {
      "AutomationRuleInput": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 1,
            "description": "The rule schema's version; always `1`."
          },
          "delivery": {
            "default": {
              "overlap": "queue",
              "maxPendingOccurrences": 100
            },
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "queue",
                    "description": "Queue a new occurrence and run it once the active one finishes."
                  },
                  "maxPendingOccurrences": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "How many occurrences may wait in the queue, not counting the one currently active, including one whose run is itself waiting on an approval."
                  }
                },
                "required": [
                  "overlap",
                  "maxPendingOccurrences"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "coalesce",
                    "description": "Close the occurrence already pending as `coalesced` and record the new match as a fresh occurrence, rather than queuing a second."
                  }
                },
                "required": [
                  "overlap"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "overlap": {
                    "type": "string",
                    "const": "skip",
                    "description": "Drop a new match while an occurrence is already active."
                  }
                },
                "required": [
                  "overlap"
                ],
                "additionalProperties": false
              }
            ],
            "description": "What happens when a new occurrence is ready before the previous one has finished."
          },
          "maxDeliveryLatenessSeconds": {
            "default": 86400,
            "description": "How long a new occurrence may wait to be delivered before its deadline passes and it is refused, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 86400
          },
          "maxEvaluationGapSeconds": {
            "default": 600,
            "description": "The longest gap allowed between evaluations before `firing.mode: rising_edge` treats its history as broken and waits for a fresh baseline, in seconds.",
            "type": "integer",
            "minimum": 1,
            "maximum": 2678400
          },
          "wakes": {
            "minItems": 1,
            "maxItems": 7,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "at",
                      "description": "A one-time wake at an exact moment; exhausted after that check, even if its condition is false."
                    },
                    "runAt": {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                      "description": "The exact moment this wake fires, as an ISO 8601 timestamp with an offset."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "runAt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "interval",
                      "description": "A wake that repeats on a fixed elapsed interval."
                    },
                    "intervalMinutes": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 44640,
                      "description": "How often this wake repeats, in minutes."
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "intervalMinutes"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "calendar",
                      "description": "A wake on a recurring calendar schedule: local times, weekdays, months and days of the month."
                    },
                    "timeZone": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80,
                      "description": "The IANA time zone a calendar wake's local times are interpreted in."
                    },
                    "localTimes": {
                      "minItems": 1,
                      "maxItems": 24,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      "description": "The times of day this wake fires, each in 24-hour `HH:MM` form, in `timeZone`."
                    },
                    "weekdays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "description": "Which ISO weekdays this wake fires on, 1 (Monday) through 7 (Sunday). Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 7,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 7
                      }
                    },
                    "months": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12
                      ],
                      "description": "Which months this wake fires in, 1 (January) through 12 (December). Defaults to every month.",
                      "minItems": 1,
                      "maxItems": 12,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      }
                    },
                    "monthDays": {
                      "default": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26,
                        27,
                        28,
                        29,
                        30,
                        31
                      ],
                      "description": "Which days of the month this wake fires on, 1 through 31. Defaults to every day.",
                      "minItems": 1,
                      "maxItems": 31,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "misfire": {
                      "default": {
                        "mode": "latest",
                        "maxLatenessSeconds": null
                      },
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "skip",
                              "description": "Drop a wake the engine could not evaluate in time; wait for the next one."
                            },
                            "graceSeconds": {
                              "default": 5,
                              "description": "How late this wake may still run before it counts as missed, in seconds.",
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "latest",
                              "description": "Run once for the most recently missed wake, dropping any earlier ones."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "all",
                              "description": "Run once for every missed wake, oldest first."
                            },
                            "maxLatenessSeconds": {
                              "default": null,
                              "description": "How late a missed wake may still run, in seconds; null for no limit.",
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 2678400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "description": "What happens when the engine could not evaluate this wake on time."
                    },
                    "evaluationTime": {
                      "default": "detection_time",
                      "description": "Which moment this wake is evaluated as of: `scheduled_time` the time it was due, `detection_time` when the engine actually ran it.",
                      "type": "string",
                      "enum": [
                        "scheduled_time",
                        "detection_time"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "timeZone",
                    "localTimes"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "event",
                      "description": "A wake evaluated each time a matching custom webhook event arrives."
                    },
                    "eventType": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_.:-]{0,79}$",
                      "description": "The event `type` this wake matches; a live webhook delivery of a different type is ignored before it reaches the condition."
                    },
                    "fields": {
                      "maxItems": 32,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "minItems": 1,
                            "maxItems": 8,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
                            },
                            "description": "The keys to walk, in order, from an observation's top level down to this field."
                          },
                          "valueType": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "boolean",
                                    "description": "A true/false value."
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "string",
                                    "description": "A text value."
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "integer",
                                    "description": "A whole-number value, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "decimal",
                                    "description": "An exact decimal value, as text, compared exactly."
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64,
                                    "description": "The unit an integer or decimal value is measured in, as the source or literal declares it."
                                  }
                                },
                                "required": [
                                  "type",
                                  "unit"
                                ],
                                "additionalProperties": false
                              }
                            ],
                            "description": "What type this field's value has, and the unit it carries when it has one."
                          },
                          "optional": {
                            "description": "Whether the provider may genuinely not observe this field, rather than fail to read it. When true, a missing value resolves a condition over it to `missing_field` and the rule's verdict to `unknown`, rather than zero, null or false.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "path",
                          "valueType"
                        ],
                        "additionalProperties": false,
                        "description": "One data field an event or a source's observation carries: where it lives, and its type."
                      },
                      "description": "The data fields an event of this type is declared to carry."
                    }
                  },
                  "required": [
                    "kind",
                    "eventType",
                    "fields"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "reader_update",
                      "description": "A wake evaluated each time the named reader delivers a fresh observation."
                    },
                    "binding": {
                      "type": "string",
                      "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                      "description": "The binding name a rule or a plan gives one configured source."
                    }
                  },
                  "required": [
                    "kind",
                    "binding"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "manual",
                      "description": "A wake fired only by `automations.invoke` or `automations.signal`, never on its own."
                    }
                  },
                  "required": [
                    "kind"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "description": "Occasions to evaluate the rule's condition: alternatives, not an AND of conditions. At most one clock, one event stream and one manual wake."
          },
          "readers": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,31}$",
                  "description": "The binding name a rule or a plan gives one configured source."
                },
                "readerId": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.-]{0,79}$",
                  "description": "The installed source operation's id, as returned by `automationSources.list`."
                },
                "config": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "$ref": "#/components/schemas/AutomationJsonValueInput"
                  },
                  "description": "Arbitrary JSON data for this event: a manual invocation's or signal's payload, a reader's configuration, or a source plan's configuration. Bounded to 16 KiB, 8 levels of nesting and 256 entries."
                },
                "pollIntervalSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 2147483,
                  "description": "How often this reader polls its source, in seconds."
                },
                "maxAgeSeconds": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 86400,
                  "description": "Maximum retained input age at evaluation, matching requirement.maxAgeSeconds when present. Snapshots use observation time; events use trusted receipt time. Collection separately enforces the provider's acquisition-age guarantee."
                },
                "requirement": {
                  "type": "object",
                  "properties": {
                    "maxLatencySeconds": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 2147483
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The target delay between an observation and its delivery, in seconds; null when delivery has no target deadline."
                    },
                    "maxAgeSeconds": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 86400,
                      "description": "Maximum acceptable input age at evaluation, matching the reader's maxAgeSeconds, measured from the provider's own observation time. The selected provider's acquisition guarantee must fit within this limit and does not reduce this evaluation window."
                    },
                    "allowDegradedLatency": {
                      "type": "boolean",
                      "description": "Whether delivery slower than the target delay is still accepted."
                    },
                    "maxAcceptedLatencySeconds": {
                      "description": "The slowest delivery still accepted, in seconds, when `allowDegradedLatency` is set.",
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 2147483
                    }
                  },
                  "required": [
                    "maxLatencySeconds",
                    "maxAgeSeconds",
                    "allowDegradedLatency"
                  ],
                  "additionalProperties": false,
                  "description": "What a reader needs from its source: how fresh an answer must be, and whether a slower one is still acceptable."
                }
              },
              "required": [
                "name",
                "readerId",
                "config",
                "pollIntervalSeconds",
                "maxAgeSeconds"
              ],
              "additionalProperties": false
            },
            "description": "The named source bindings this rule reads from, referenced by `condition` and by each `reader_update` wake's `binding`."
          },
          "condition": {
            "description": "The rule's condition tree, up to 8 levels deep and 128 nodes total, built from five node kinds: `{op:\"bool\", value}` a fixed true/false leaf; `{op:\"compare\", comparator, left, right}` one of `eq`/`ne`/`lt`/`lte`/`gt`/`gte` between two operands — `lt`/`lte`/`gt`/`gte` require both operands to be `integer` or `decimal`, and both sides must share the same type and, for `integer`/`decimal`, the same unit; `{op:\"all\", args}` / `{op:\"any\", args}` AND/OR over one or more child nodes; `{op:\"not\", arg}` negates one child node. An operand is either `{kind:\"field\", binding, path}` — a bound reader's name and the key path into its data — or `{kind:\"literal\", type, value, unit?}` with `type` one of `boolean`/`string`/`integer`/`decimal` (`integer`/`decimal` values are exact decimal strings and carry `unit`). `automations.testCondition` evaluates the tree against a given event without firing."
          },
          "firing": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "each_match",
                  "rising_edge"
                ],
                "description": "When a qualifying evaluation fires: `each_match` fires on every qualifying evaluation, including the first; `rising_edge` fires only on a known false-to-true transition."
              },
              "repeat": {
                "type": "string",
                "enum": [
                  "once",
                  "repeating"
                ],
                "description": "Whether this rule fires at most once, or keeps watching after it fires."
              },
              "maxRuns": {
                "description": "Maximum deliverable runs recorded for this automation across pauses and resumes. Missed or refused deliveries do not count; recorded runs count even if later canceled, coalesced or failed. Omit for no finite limit beyond repeat=once.",
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000
              },
              "initial": {
                "type": "string",
                "enum": [
                  "baseline",
                  "fire_if_true"
                ],
                "description": "How `rising_edge` treats the first known state: `baseline` records it without firing, `fire_if_true` fires immediately if it is already true."
              },
              "cooldownSeconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2678400,
                "description": "The minimum time between firings, in seconds; it does not require the condition to stay true that whole time. For `rising_edge`, a false-to-true edge that lands inside cooldown is discarded, not queued: it is not replayed once cooldown ends, so the rule needs an entirely fresh edge after cooldown lapses before it fires again — simply remaining true past the cooldown boundary does not trigger a firing."
              }
            },
            "required": [
              "mode",
              "repeat",
              "initial",
              "cooldownSeconds"
            ],
            "additionalProperties": false,
            "description": "How this rule turns a qualifying evaluation into a firing: which ones count, how often, and how many."
          },
          "maxSnapshotSkewSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "description": "The most that bound readers' observation times may disagree before evaluation reports `snapshot_skew`, in seconds."
          }
        },
        "required": [
          "schemaVersion",
          "wakes",
          "readers",
          "condition",
          "firing",
          "maxSnapshotSkewSeconds"
        ],
        "additionalProperties": false,
        "description": "One automation's rule: when it wakes, what condition it evaluates, and how it fires."
      },
      "AutomationJsonValueInput": {
        "description": "Any JSON value: a string, number, boolean, null, array or object, nested to any depth.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationJsonValueInput"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AutomationJsonValueInput"
            }
          }
        ]
      },
      "AutomationJsonValue": {
        "description": "Any JSON value: a string, number, boolean, null, array or object, nested to any depth.",
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationJsonValue"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AutomationJsonValue"
            }
          }
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The kind of problem as a URN, `urn:fin:error:<kind>`; stable, compare against it"
          },
          "title": {
            "type": "string",
            "description": "The kind's human title, for logs; never parse it"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "description": "The HTTP status, repeated in the body"
          },
          "reason": {
            "description": "The machine-readable why. One of:\n\n- `run_active` (409) — a run already holds this conversation\n- `budget_exhausted` (409) — the user's spend headroom is gone, or an operator froze it\n- `approval_not_pending` (409) — the approval was already decided or has expired, or its id does not exist or belongs to a different conversation\n- `execution_capacity` (409) — no execution capacity is free right now; `retryable` says whether to try again\n- `execution_unavailable` (409) — the execution engine could not take the work\n- `stop_pending` (409) — a stop is already in progress and its cleanup is not yet confirmed\n- `automation_changed` (409) — the `revision` sent is stale; reload the automation\n- `automation_held` (409) — an operator holds the automation; it fires again when released\n- `automation_invalid` (409) — the automation's definition cannot run as written\n- `automation_completed` (409) — the automation has finished for good and cannot fire again\n- `automation_limit` (409) — the user already has as many automations as the deployment allows\n- `profile_unknown_tool` (409) — the run profile names a tool this deployment does not have\n- `deployment_paused` (409) — an operator paused a deployment control; nothing was admitted or fired\n- `run_not_active` (409) — the run named in the path is not the conversation's live run\n- `withdrawal_changed` (409) — the withdrawal cannot be prepared or confirmed as asked: the balance no longer covers it, its terms changed or expired, or it is already in progress\n- `credential_expired` (401) — the user token has expired; obtain a fresh one\n- `account_disabled` (403) — an operator disabled the account\n- `account_not_provisioned` (412) — the identity is verified but has no account yet; call `users.ensure` first\n- `provider_unavailable` (503) — an external provider the call depends on did not answer\n- `engine_unavailable` (503) — the execution engine did not answer\n- `invalid_input` (400) — the body or query failed validation; `issues` names each field\n- `internal` (500) — a fault on our side; quote `requestId` when reporting it\n- `partner_key_required` (401) — no `X-Api-Key` header was sent\n- `partner_key_invalid` (401) — the `X-Api-Key` is unknown or revoked\n- `subject_mismatch` (403) — the `{userId}` in the path is not the token's user\n- `origin_rejected` (403) — a browser `Origin` other than the configured web origin\n- `permission_required` (403) — the operator credential lacks the scope this call needs\n- `rate_limited` (429) — the per-key or per-user limit is spent; honour `Retry-After`\n- `stream_capacity` (429) — no stream socket is free on this replica or for this user; honour `Retry-After`\n- `invalid_cursor` (400) — the `cursor` is not one this list minted",
            "type": "string",
            "enum": [
              "run_active",
              "budget_exhausted",
              "approval_not_pending",
              "execution_capacity",
              "execution_unavailable",
              "stop_pending",
              "automation_changed",
              "automation_held",
              "automation_invalid",
              "automation_completed",
              "automation_limit",
              "profile_unknown_tool",
              "deployment_paused",
              "run_not_active",
              "withdrawal_changed",
              "credential_expired",
              "account_disabled",
              "account_not_provisioned",
              "provider_unavailable",
              "engine_unavailable",
              "invalid_input",
              "internal",
              "partner_key_required",
              "partner_key_invalid",
              "subject_mismatch",
              "origin_rejected",
              "permission_required",
              "rate_limited",
              "stream_capacity",
              "invalid_cursor"
            ]
          },
          "requestId": {
            "type": "string",
            "description": "The id Fin used for this request; quote it when reporting a problem"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether repeating the same request later can succeed without changing it"
          },
          "detail": {
            "description": "Only on `invalid_input`: which part of the request failed validation",
            "type": "string"
          },
          "issues": {
            "description": "Only on `invalid_input`: one entry per failing field",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The JSON pointer of the failing field; empty for the root object"
                },
                "message": {
                  "type": "string",
                  "description": "Why the field failed"
                }
              },
              "required": [
                "path",
                "message"
              ]
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "requestId",
          "retryable"
        ],
        "description": "RFC 9457 problem details: what every error response carries. Never a provider's message, a query or a stack."
      }
    },
    "responses": {
      "InvalidInput": {
        "description": "The request could not be read as this operation expects.\n\n- `invalid_input` — the body or query failed validation; `issues` names each field\n- `invalid_cursor` — the `cursor` is not one this list minted",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "A credential is missing, invalid or expired.\n\n- `partner_key_required` — no `X-Api-Key` header was sent\n- `partner_key_invalid` — the `X-Api-Key` is unknown or revoked\n- `credential_expired` — the user token has expired; obtain a fresh one",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credentials are valid but may not do this.\n\n- `subject_mismatch` — the `{userId}` in the path is not the token's user\n- `account_disabled` — an operator disabled the account\n- `origin_rejected` — a browser `Origin` other than the configured web origin",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource is missing, belongs to someone else, or its id is malformed: all three answer alike.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "AccountNotProvisioned": {
        "description": "The identity is verified but has no account yet.\n\n- `account_not_provisioned` — the identity is verified but has no account yet; call `users.ensure` first",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The body exceeds the size this deployment accepts.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "A limiter refused the request; honour `Retry-After`.\n\n- `rate_limited` — the per-key or per-user limit is spent; honour `Retry-After`",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Internal": {
        "description": "A fault on our side; quote `requestId` when reporting it.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Unavailable": {
        "description": "The replica is draining or a dependency did not answer; `retryable` says whether to try again.\n\n- `internal` — a fault on our side; quote `requestId` when reporting it",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "userToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```

