{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/realask-net/json-schema/realask-net-job-result-response-schema.json",
  "title": "JobResultResponse",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/realask-net-openapi.json#/components/schemas/JobResultResponse",
  "type": "object",
  "properties": {
    "job_id": {
      "type": "string"
    },
    "request_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "quoted",
        "awaiting_payment",
        "queued",
        "discovering",
        "calling",
        "extracting",
        "completed",
        "partial",
        "failed",
        "timed_out",
        "canceled"
      ]
    },
    "job_type": {
      "type": "string",
      "enum": [
        "single_business",
        "find_any",
        "compare",
        "capability",
        "policy",
        "status",
        "book",
        "hold",
        "request_quote",
        "cancel"
      ]
    },
    "verification_mode": {
      "type": "string",
      "enum": [
        "digital_fast",
        "live_verified",
        "auto"
      ]
    },
    "answer": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "resolved": {
          "type": "boolean"
        },
        "best_match": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "business_name": {
                  "type": "string"
                },
                "place_id": {
                  "type": "string"
                },
                "address": {
                  "type": "string"
                },
                "phone": {
                  "type": "string"
                },
                "distance_miles": {
                  "type": "number"
                },
                "confirmed": {
                  "type": "boolean"
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "confirmed_match",
                    "confirmed_no_match",
                    "uncertain",
                    "not_reached",
                    "declined",
                    "not_attempted",
                    "suppressed"
                  ]
                },
                "facts": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": [
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ]
                  }
                },
                "fact_details": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "value": {
                        "type": [
                          "string",
                          "number",
                          "boolean",
                          "null"
                        ]
                      },
                      "currency": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "uncertain",
                          "unconfirmed",
                          "conflicting",
                          "not_asked"
                        ]
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "live_business_call",
                              "published_listing",
                              "cached_verified_fact",
                              "business_website",
                              "merchant_feed"
                            ]
                          },
                          "call_attempt_id": {
                            "type": "string"
                          },
                          "job_id": {
                            "type": "string"
                          },
                          "speaker_role": {
                            "type": "string",
                            "enum": [
                              "business_employee",
                              "ivr",
                              "voicemail",
                              "unknown",
                              "assistant"
                            ]
                          },
                          "observed_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "observed_at"
                        ],
                        "additionalProperties": false
                      },
                      "confidence": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "age_seconds": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notes": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "value",
                      "status",
                      "source",
                      "confidence",
                      "age_seconds",
                      "notes"
                    ],
                    "additionalProperties": false
                  }
                },
                "verified_at": {
                  "type": "string"
                },
                "confidence": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              },
              "required": [
                "business_name",
                "confirmed",
                "outcome",
                "facts",
                "fact_details",
                "confidence"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "alternatives": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "business_name": {
                "type": "string"
              },
              "place_id": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "distance_miles": {
                "type": "number"
              },
              "confirmed": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "confirmed_match",
                  "confirmed_no_match",
                  "uncertain",
                  "not_reached",
                  "declined",
                  "not_attempted",
                  "suppressed"
                ]
              },
              "facts": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              },
              "fact_details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "value": {
                      "type": [
                        "string",
                        "number",
                        "boolean",
                        "null"
                      ]
                    },
                    "currency": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "uncertain",
                        "unconfirmed",
                        "conflicting",
                        "not_asked"
                      ]
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "live_business_call",
                            "published_listing",
                            "cached_verified_fact",
                            "business_website",
                            "merchant_feed"
                          ]
                        },
                        "call_attempt_id": {
                          "type": "string"
                        },
                        "job_id": {
                          "type": "string"
                        },
                        "speaker_role": {
                          "type": "string",
                          "enum": [
                            "business_employee",
                            "ivr",
                            "voicemail",
                            "unknown",
                            "assistant"
                          ]
                        },
                        "observed_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "observed_at"
                      ],
                      "additionalProperties": false
                    },
                    "confidence": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "age_seconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "name",
                    "value",
                    "status",
                    "source",
                    "confidence",
                    "age_seconds",
                    "notes"
                  ],
                  "additionalProperties": false
                }
              },
              "verified_at": {
                "type": "string"
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            "required": [
              "business_name",
              "confirmed",
              "outcome",
              "facts",
              "fact_details",
              "confidence"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "summary",
        "resolved",
        "best_match",
        "alternatives"
      ],
      "additionalProperties": false
    },
    "commitment": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "committed",
                "declined",
                "unavailable",
                "over_budget",
                "not_reached",
                "needs_human",
                "canceled"
              ]
            },
            "action": {
              "type": "string",
              "enum": [
                "book",
                "hold",
                "request_quote",
                "cancel"
              ]
            },
            "business_name": {
              "type": "string"
            },
            "place_id": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "confirmation_reference": {
              "type": [
                "string",
                "null"
              ]
            },
            "what": {
              "type": "string"
            },
            "agreed_time": {
              "type": [
                "string",
                "null"
              ]
            },
            "agreed_price_minor": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            },
            "currency": {
              "type": [
                "string",
                "null"
              ]
            },
            "cancellation_policy": {
              "type": [
                "string",
                "null"
              ]
            },
            "held_under_name": {
              "type": [
                "string",
                "null"
              ]
            },
            "committed_at": {
              "type": [
                "string",
                "null"
              ]
            },
            "confidence": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "evidence_excerpt": {
              "type": [
                "string",
                "null"
              ]
            },
            "notes": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "state",
            "action",
            "business_name",
            "confirmation_reference",
            "what",
            "agreed_time",
            "agreed_price_minor",
            "currency",
            "cancellation_policy",
            "held_under_name",
            "committed_at",
            "confidence",
            "evidence_excerpt",
            "notes"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "live_business_call",
              "published_listing",
              "cached_verified_fact",
              "business_website",
              "merchant_feed"
            ]
          },
          "business_name": {
            "type": "string"
          },
          "place_id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "speaker_role": {
            "type": "string",
            "enum": [
              "business_employee",
              "ivr",
              "voicemail",
              "unknown",
              "assistant"
            ]
          },
          "excerpt": {
            "type": "string"
          },
          "call_attempt_id": {
            "type": "string"
          },
          "transcript_retention": {
            "type": "string",
            "enum": [
              "policy-controlled",
              "not-retained",
              "retained"
            ]
          }
        },
        "required": [
          "type",
          "business_name",
          "timestamp",
          "speaker_role",
          "excerpt",
          "transcript_retention"
        ],
        "additionalProperties": false
      }
    },
    "freshness": {
      "type": "object",
      "properties": {
        "verified_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "age_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "fact_class": {
          "type": "string",
          "enum": [
            "volatile",
            "daily",
            "stable"
          ]
        }
      },
      "required": [
        "verified_at",
        "age_seconds",
        "fact_class"
      ],
      "additionalProperties": false
    },
    "limitations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "job_id",
    "request_id",
    "status",
    "job_type",
    "verification_mode",
    "answer",
    "evidence",
    "freshness",
    "limitations",
    "completed_at"
  ],
  "additionalProperties": false
}