{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/serpmantics-com/json-schema/serpmantics-com-guide-progress-status-schema.json",
  "title": "GuideProgressStatus",
  "description": "Creation progress of a guide (shared by /guide and /guides). When `step` is `failed`, `generationFailed`, `terminal`, `reason`, `message` and `kind` are set, and `failureFacts` may be (only for sources whose web pages we read).",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/serpmantics-com-openapi.yml#/components/schemas/GuideProgressStatus",
  "type": "object",
  "properties": {
    "isReady": {
      "type": "boolean",
      "description": "True once the guide is ready to be read"
    },
    "pct": {
      "type": "number",
      "description": "Creation progress in percent (0 to 100)"
    },
    "step": {
      "type": "string",
      "enum": [
        "notStarted",
        "queued",
        "created",
        "serpFetched",
        "pagesCrawled",
        "ready",
        "failed"
      ],
      "description": "Current creation step. `queued` (returned by GET /api/v1/guides, and by the 202 of GET /api/v1/guide): the guide has not started and is held because the account is beyond the priority guides of its plan for the current month; held guides start at a rate of one per hour, in creation order. See `estimatedStartAt`."
    },
    "estimatedStartAt": {
      "type": "string",
      "format": "date-time",
      "description": "Only when step is `queued`. Estimated start of the generation (UTC). An estimate, not a promise: the guide then moves to `created` and the usual steps."
    },
    "upgradeUrl": {
      "type": "string",
      "description": "Only when step is `queued`, and only when the \"Priority and API volume\" add-on can raise this account's monthly volume. Absolute URL where to buy it."
    },
    "requiresValidation": {
      "type": "boolean",
      "description": "Present and true when the guide waits for the user to validate the results to analyse"
    },
    "generationFailed": {
      "type": "boolean",
      "description": "Present and true when the creation failed (step `failed`)"
    },
    "terminal": {
      "type": "boolean",
      "description": "Only when step is `failed`. True when the failure is definitive (explicit backend flag, or inferred when the failure is older than 15 minutes, see `terminalInferred`). False while the backend may still retry (failure younger than 15 minutes without the explicit flag)."
    },
    "terminalInferred": {
      "type": "boolean",
      "description": "Only when step is `failed` and `terminal` is true without the explicit backend flag (failure older than 15 minutes, no retry will happen). Present and true in that case only. The refund status is then given by the `refunded` field of /guide, never promised in `message`."
    },
    "reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Only when step is `failed`. Raw, stable failure reason slug",
      "enum": [
        "exception-creation",
        "no-serp-results",
        "not-enough-serp-results",
        "not-enough-fetchable-pages",
        "no-top10-fetchable-pages",
        "failed-to-save-serp-results",
        "exception-fetch-serp",
        "exception-fetch-results",
        "exception-fetch-llm-citations",
        "no-citations",
        "unsupported-locale",
        "exception-fetch-llm-content",
        "no-ai-overview-available",
        "exception-fetch-ai-overview",
        "exception-process-corpus",
        "exception-wrap-up",
        "failed-task",
        "relaunch_count_exceeded"
      ]
    },
    "message": {
      "type": "string",
      "description": "Only when step is `failed`. Human-readable French message, depending on the reason and the source of the guide"
    },
    "kind": {
      "type": "string",
      "enum": [
        "legitimate",
        "technical"
      ],
      "description": "Only when step is `failed`. `legitimate`: the query or the source does not allow a guide to be built (no results, too few readable pages, no AI Overview, unsupported language); nothing is broken, change the query or the source. `technical`: an error on our side, including any unknown reason."
    },
    "failureFacts": {
      "type": "object",
      "description": "Only when step is `failed`, only for the reasons `not-enough-fetchable-pages` and `no-top10-fetchable-pages`, only for sources whose web pages we read (a search engine such as `GOOGLE` or `BING`, or a `_CITATIONS` source), and only when the figures could be read and cross-checked. Never set for a source in answer mode (`GOOGLE_AI_OVERVIEW`, `CHATGPT`, `PERPLEXITY`, ... without `_CITATIONS`): those guides are built from AI answers, no web page is read. Absent otherwise: never assume 0. Always `attempted = readable + notAnalyzable + invalidContent + unreachable`.",
      "required": [
        "attempted",
        "readable",
        "unreadable"
      ],
      "properties": {
        "attempted": {
          "type": "integer",
          "description": "Number of results whose page we tried to read."
        },
        "readable": {
          "type": "integer",
          "description": "Number of pages read and usable for the analysis."
        },
        "unreadable": {
          "type": "object",
          "description": "Pages that could not be read, by cause.",
          "required": [
            "notAnalyzable",
            "invalidContent",
            "unreachable"
          ],
          "properties": {
            "notAnalyzable": {
              "type": "integer",
              "description": "Pages on sites we do not analyze (social networks, video platforms)."
            },
            "invalidContent": {
              "type": "integer",
              "description": "Pages whose content is too short or unreadable."
            },
            "unreachable": {
              "type": "integer",
              "description": "Pages that are unreachable or protected."
            }
          }
        }
      }
    }
  }
}