{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pingwa-dev/json-schema/pingwa-dev-policy-in-schema.json",
  "title": "PolicyIn",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pingwa-dev-openapi.json#/components/schemas/PolicyIn",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
      "description": "1-40 chars: letters, digits, . _ -, starting with a letter or digit; stored lowercase"
    },
    "steps": {
      "items": {
        "properties": {
          "to": {
            "anyOf": [
              {
                "type": "string",
                "description": "\"me\" or \"team\""
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "description": "member ids or names, and/or \"me\""
              }
            ]
          },
          "after_s": {
            "type": "integer",
            "maximum": 21600.0,
            "minimum": 60.0,
            "description": "seconds after the original send; each step at least 60 s after the previous one"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "to",
          "after_s"
        ]
      },
      "type": "array",
      "maxItems": 3,
      "minItems": 1,
      "title": "Steps",
      "description": "teams-04: escalate while nobody answers: steps [{\"to\", \"after_s\"}] (1-3) or a policy name. Responses add `escalation` [{step, state, due_at, reason}]; state: pending | sent | cancelled | stopped."
    }
  },
  "type": "object"
}