{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pendingyou-com/json-schema/pendingyou-com-answer-request-schema.json",
  "title": "AnswerRequest",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/pendingyou-com-v1-openapi.json#/components/schemas/AnswerRequest",
  "type": "object",
  "properties": {
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "choiceIds": {
      "minItems": 1,
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "approved": {
      "type": "boolean"
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "note": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4000
        },
        "via": {
          "default": "text",
          "type": "string",
          "enum": [
            "text",
            "voice"
          ]
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "theyDecide": {
      "type": "boolean",
      "const": true
    },
    "answers": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{1,40}$"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "choiceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "approved": {
            "type": "boolean"
          },
          "text": {
            "type": "string",
            "maxLength": 4000
          },
          "note": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 4000
              },
              "via": {
                "type": "string",
                "enum": [
                  "voice",
                  "text"
                ]
              },
              "audioSeconds": {
                "type": "number"
              }
            },
            "required": [
              "text",
              "via"
            ],
            "additionalProperties": false
          },
          "theyDecide": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "failed": {
      "type": "boolean",
      "const": true
    },
    "failedStep": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "done": {
      "type": "boolean"
    },
    "askId": {
      "type": "string",
      "pattern": "^ask_[A-Za-z0-9-]+$"
    },
    "handled": {
      "type": "string",
      "enum": [
        "self",
        "leave"
      ]
    },
    "notSent": {
      "type": "boolean",
      "const": true
    },
    "notNeeded": {
      "type": "boolean",
      "const": true
    },
    "holdSeconds": {
      "type": "integer",
      "minimum": 5,
      "maximum": 20
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}