{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usestring-ai/json-schema/usestring-ai-sitemap-job-schema.json",
  "title": "SitemapJob",
  "description": "Job status. Extra fields depend on `status`: `awaiting_approval`: `estimatedCostUsd`. `running`: `pending`, `processed`. `completed`: `pagesProcessed`, plus `urls` (full results) shortly after completion or `finishedAt`. `failed`: `errorMessage`, `finishedAt`. `canceled` / `token_cap_exceeded`: `pending`, `processed`.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usestring-ai-openapi.json#/components/schemas/SitemapJob",
  "type": "object",
  "required": [
    "jobId",
    "status"
  ],
  "properties": {
    "jobId": {
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/SitemapJobStatusValue"
    },
    "estimatedCostUsd": {
      "type": "string",
      "description": "Quoted cost in USD, as a decimal string."
    },
    "pending": {
      "type": "integer",
      "description": "Queued URLs."
    },
    "processed": {
      "type": "integer",
      "description": "URLs crawled so far."
    },
    "pagesProcessed": {
      "type": "integer"
    },
    "urls": {
      "type": "array",
      "description": "Full results, on a completed job. Use GET /sitemap/{jobId}/urls to page through them."
    },
    "errorMessage": {
      "type": "string",
      "description": "Why the job failed, for example `quote_expired`."
    },
    "finishedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "SitemapJobStatusValue": {
      "type": "string",
      "enum": [
        "awaiting_approval",
        "running",
        "completed",
        "failed",
        "canceled",
        "token_cap_exceeded"
      ],
      "description": "Job status."
    }
  }
}