{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ringkit-com/json-schema/ringkit-com-onboarding-status-schema.json",
  "title": "OnboardingStatus",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ringkit-com-openapi.json#/components/schemas/OnboardingStatus",
  "type": "object",
  "properties": {
    "step": {
      "type": "string",
      "enum": [
        "number",
        "done"
      ]
    },
    "completedAt": {
      "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)))$"
    },
    "hasNumber": {
      "type": "boolean"
    },
    "knowledgeReady": {
      "type": "boolean"
    },
    "latestImport": {
      "anyOf": [
        {
          "$ref": "#/$defs/KnowledgeImport"
        },
        {
          "type": "null"
        }
      ]
    },
    "canOrderOnTrial": {
      "default": false,
      "type": "boolean"
    },
    "paymentRequired": {
      "default": false,
      "type": "boolean"
    },
    "numberTrialDays": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "numberTrial": {
      "type": "object",
      "properties": {
        "numberId": {
          "type": "string",
          "pattern": "^num_[0-9a-z]{8,32}$"
        },
        "number": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$"
        },
        "until": {
          "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)))$"
        }
      },
      "required": [
        "numberId",
        "number",
        "until"
      ],
      "additionalProperties": false
    },
    "forwarding": {
      "type": "object",
      "properties": {
        "businessPhone": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$"
        },
        "verifiedAt": {
          "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)))$"
        },
        "lastCheck": {
          "type": "object",
          "properties": {
            "checkId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "at": {
              "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)))$"
            },
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "done"
              ]
            },
            "outcome": {
              "type": "string",
              "enum": [
                "forwarded",
                "not_forwarded",
                "no_answer",
                "error"
              ]
            },
            "detail": {
              "type": "string",
              "maxLength": 500
            },
            "finishedAt": {
              "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)))$"
            }
          },
          "required": [
            "checkId",
            "at",
            "status"
          ],
          "additionalProperties": false
        },
        "numberId": {
          "type": "string",
          "pattern": "^num_[0-9a-z]{8,32}$"
        },
        "number": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$"
        }
      },
      "required": [
        "numberId",
        "number"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "step",
    "hasNumber",
    "knowledgeReady",
    "latestImport",
    "canOrderOnTrial",
    "paymentRequired",
    "numberTrialDays"
  ],
  "additionalProperties": false,
  "$defs": {
    "KnowledgeImport": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^kimp_[0-9a-z]{8,32}$"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "running",
            "done",
            "failed"
          ]
        },
        "estimatedTokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "found": {
          "type": "object",
          "properties": {
            "hours": {
              "type": "boolean"
            },
            "services": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "faqs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "policies": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "summary": {
              "type": "boolean"
            }
          },
          "required": [
            "hours",
            "services",
            "faqs",
            "policies",
            "summary"
          ],
          "additionalProperties": false
        },
        "error": {
          "type": "string",
          "maxLength": 500
        },
        "createdAt": {
          "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)))$"
        },
        "finishedAt": {
          "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)))$"
        }
      },
      "required": [
        "id",
        "url",
        "status",
        "createdAt"
      ],
      "additionalProperties": false
    }
  }
}