{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pushary-com/json-schema/pushary-com-decision-result-schema.json",
  "title": "DecisionResult",
  "description": "What creating a decision returns.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pushary-com-openapi.json#/components/schemas/DecisionResult",
  "type": "object",
  "required": [
    "decisionId",
    "status",
    "answered"
  ],
  "properties": {
    "decisionId": {
      "type": "string",
      "description": "Identifier to poll, answer or cancel."
    },
    "status": {
      "type": "string",
      "description": "Lifecycle state. stopped means the workspace kill switch refused creation; no decision was opened.",
      "enum": [
        "pending",
        "answered",
        "expired",
        "cancelled",
        "stopped"
      ]
    },
    "answered": {
      "type": "boolean",
      "description": "True once a person has answered."
    },
    "value": {
      "type": [
        "string",
        "null"
      ],
      "description": "The person's answer, once answered."
    },
    "type": {
      "type": "string",
      "description": "How the person answers.",
      "enum": [
        "confirm",
        "select",
        "input"
      ]
    },
    "question": {
      "type": "string",
      "description": "What the person was asked."
    },
    "pollUrl": {
      "type": "string",
      "description": "Where to poll for the answer.",
      "format": "uri"
    },
    "decisionPageUrl": {
      "type": "string",
      "description": "The hosted page the person answers on.",
      "format": "uri"
    },
    "approvalUrl": {
      "type": "string",
      "description": "Recipient-bound bearer link, returned only when requested on a fresh create with externalId.",
      "format": "uri"
    },
    "deliverability": {
      "type": "string",
      "description": "Whether Pushary has a confirmed push channel, needs caller delivery, or has no named recipient.",
      "enum": [
        "push",
        "fallback",
        "unreachable"
      ]
    },
    "expiresInSeconds": {
      "type": "integer",
      "description": "How long the decision stays answerable."
    },
    "idempotent": {
      "type": "boolean",
      "description": "True when an idempotency key replayed an earlier decision."
    },
    "hint": {
      "type": "string",
      "description": "Advice when the decision may not reach anyone."
    },
    "reachable": {
      "type": "boolean",
      "description": "Whether the addressed end-user can be reached at create time."
    },
    "reachableChannels": {
      "type": "integer",
      "description": "How many channels can reach them."
    },
    "deviceCount": {
      "type": "integer",
      "description": "How many devices are enrolled for them."
    }
  }
}