{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ploti-ai/json-schema/ploti-ai-request-status-view-schema.json",
  "title": "RequestStatus.View",
  "description": "The request's status: headline, what is needed from the user (you), what it waits on outside Ploti (waits, dates in UTC), heartbeat, typical timing, percent (straightforward requests only), datasets available to open, its parts, milestones, the keeping-fresh line once ready, and how it ended (outcome).",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/ploti-ai-v1-openapi.json#/components/schemas/RequestStatus.View",
  "type": "object",
  "properties": {
    "subject": {
      "$ref": "#/$defs/CustomerStatus.Subject"
    },
    "headline": {
      "$ref": "#/$defs/CustomerStatus.Headline"
    },
    "you": {
      "$ref": "#/$defs/CustomerStatus.You"
    },
    "waits": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomerStatus.Wait"
      }
    },
    "timing": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomerStatus.Timing"
        },
        {
          "type": "null"
        }
      ]
    },
    "percent": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomerStatus.Percent"
        },
        {
          "type": "null"
        }
      ]
    },
    "available": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomerStatus.Available"
      }
    },
    "parts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomerStatus.Part"
      }
    },
    "milestones": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomerStatus.Milestone"
      }
    },
    "updates": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomerStatus.Updates"
        },
        {
          "type": "null"
        }
      ]
    },
    "outcome": {
      "anyOf": [
        {
          "$ref": "#/$defs/CustomerStatus.Outcome"
        },
        {
          "type": "null"
        }
      ]
    },
    "heartbeat": {
      "type": "object",
      "properties": {
        "lastActivityAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "runningNow": {
          "type": "boolean"
        },
        "records": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "sourcesDone": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "sourcesTotal": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "countsText": {
          "type": "string"
        },
        "line": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "When something last happened on the request, such as \"Last activity 12 min ago\"; null when nothing has."
        }
      },
      "required": [
        "lastActivityAt",
        "runningNow",
        "records",
        "sourcesDone",
        "sourcesTotal",
        "countsText",
        "line"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "subject",
    "headline",
    "you",
    "waits",
    "timing",
    "percent",
    "available",
    "parts",
    "milestones",
    "updates",
    "outcome",
    "heartbeat"
  ],
  "additionalProperties": false,
  "$defs": {
    "CustomerStatus.Available": {
      "type": "object",
      "properties": {
        "datasetId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "own": {
          "type": "boolean"
        },
        "firstResults": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "datasetId",
        "name",
        "own",
        "firstResults",
        "note"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Headline": {
      "type": "object",
      "properties": {
        "journey": {
          "type": "string",
          "enum": [
            "straightforward",
            "collected",
            "built",
            "places",
            "research"
          ]
        },
        "step": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "hold": {
          "type": "boolean"
        },
        "tone": {
          "type": "string",
          "enum": [
            "working",
            "waiting",
            "late",
            "needs_you",
            "done",
            "ended"
          ]
        },
        "sentenceKey": {
          "type": "string",
          "enum": [
            "not_found",
            "paid_source",
            "outside_coverage",
            "withdrawn",
            "paused",
            "ready",
            "needs_you",
            "our_problem",
            "stalled",
            "quality_issue",
            "checking",
            "publisher",
            "parts",
            "supporting",
            "first_results",
            "searching_again",
            "building",
            "collecting",
            "searching",
            "research_checking",
            "research_report_ready",
            "research_gathering",
            "research_researching",
            "research_writing",
            "research_complete",
            "research_no_data",
            "research_failed",
            "research_held"
          ]
        },
        "sentence": {
          "type": "string"
        }
      },
      "required": [
        "journey",
        "step",
        "hold",
        "tone",
        "sentenceKey",
        "sentence"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Milestone": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "key": {
          "type": "string",
          "enum": [
            "submitted",
            "found_source",
            "built",
            "quality_checked",
            "first_results",
            "ready",
            "searching_again",
            "paused",
            "not_found",
            "withdrawn",
            "updated"
          ]
        },
        "at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "type": "string"
        },
        "tone": {
          "type": "string",
          "enum": [
            "ok",
            "note",
            "ended"
          ]
        }
      },
      "required": [
        "id",
        "key",
        "at",
        "text",
        "tone"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Outcome": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "not_found",
            "paid_source",
            "outside_coverage",
            "withdrawn"
          ]
        },
        "text": {
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "office": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "feeCents": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "reason",
        "text",
        "next",
        "office",
        "feeCents"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Part": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "ready",
            "first_results",
            "needs_you",
            "waiting",
            "searching_again",
            "working",
            "stalled",
            "ended"
          ]
        },
        "stateLabel": {
          "type": "string"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "sentenceKey": {
          "type": "string",
          "enum": [
            "not_found",
            "paid_source",
            "outside_coverage",
            "withdrawn",
            "paused",
            "ready",
            "needs_you",
            "our_problem",
            "stalled",
            "quality_issue",
            "checking",
            "publisher",
            "parts",
            "supporting",
            "first_results",
            "searching_again",
            "building",
            "collecting",
            "searching",
            "research_checking",
            "research_report_ready",
            "research_gathering",
            "research_researching",
            "research_writing",
            "research_complete",
            "research_no_data",
            "research_failed",
            "research_held"
          ]
        },
        "step": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "requestId",
        "label",
        "state",
        "stateLabel",
        "text",
        "sentenceKey",
        "step"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Percent": {
      "type": "object",
      "properties": {
        "value": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "value",
        "text"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Question": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "requestId": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "assumption": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "deadlineAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "requestId",
        "text",
        "options",
        "assumption",
        "deadlineAt"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Subject": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "data_request",
            "ask",
            "research_request"
          ]
        },
        "title": {
          "type": "string"
        },
        "areaLabel": {
          "type": "string"
        },
        "coverageKind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "county",
                "state",
                "national"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "requestedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "askId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "kind",
        "title",
        "areaLabel",
        "coverageKind",
        "requestedAt",
        "askId"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Timing": {
      "type": "object",
      "properties": {
        "typicalHours": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "usualMaxHours": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "late": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "typicalHours",
        "usualMaxHours",
        "late",
        "text"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Updates": {
      "type": "object",
      "properties": {
        "tone": {
          "type": "string",
          "enum": [
            "ok",
            "live",
            "retry"
          ]
        },
        "lastCheckedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastChangeAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "cadence": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "tone",
        "lastCheckedAt",
        "lastChangeAt",
        "cadence",
        "text"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.Wait": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "enum": [
            "records_request_preparing",
            "records_request_sent",
            "publisher_replied",
            "publisher_question",
            "publisher_fee",
            "site_blocks_automation",
            "site_rate_limit",
            "site_down",
            "needs_account",
            "supporting_data",
            "ours"
          ]
        },
        "party": {
          "type": "string",
          "enum": [
            "publisher",
            "source",
            "supporting",
            "ours"
          ]
        },
        "label": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "partLabel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "since": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "sentAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "nextAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "records": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "feeCents": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "ready": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "bucket",
        "party",
        "label",
        "text",
        "partLabel",
        "names",
        "since",
        "sentAt",
        "nextAt",
        "records",
        "feeCents",
        "count",
        "ready"
      ],
      "additionalProperties": false
    },
    "CustomerStatus.You": {
      "type": "object",
      "properties": {
        "needed": {
          "type": "boolean"
        },
        "text": {
          "type": "string"
        },
        "question": {
          "anyOf": [
            {
              "$ref": "#/$defs/CustomerStatus.Question"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "needed",
        "text",
        "question"
      ],
      "additionalProperties": false
    }
  }
}