{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mainbook-ai/json-schema/mainbook-ai-developer-jobs-page-schema.json",
  "title": "DeveloperJobsPage",
  "description": "Cursor page returned by GET /developer/jobs.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mainbook-ai-openapi.yml#/components/schemas/DeveloperJobsPage",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DeveloperJob"
      }
    },
    "next": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "previous": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    }
  },
  "required": [
    "next",
    "previous",
    "results"
  ],
  "$defs": {
    "DeveloperJob": {
      "type": "object",
      "description": "Stable public polling resource from spec §5.4.",
      "properties": {
        "job_id": {
          "type": "string",
          "format": "uuid"
        },
        "state": {
          "$ref": "#/$defs/StateEnum"
        },
        "filename": {
          "type": "string"
        },
        "file_format": {
          "$ref": "#/$defs/FileFormatEnum"
        },
        "pages": {
          "type": "integer",
          "minimum": 1
        },
        "credits_reserved": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "source": {
          "$ref": "#/$defs/SourceEnum"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "validation": {
          "allOf": [
            {
              "$ref": "#/$defs/DeveloperJobValidation"
            }
          ],
          "nullable": true
        },
        "error": {
          "allOf": [
            {
              "$ref": "#/$defs/DeveloperJobError"
            }
          ],
          "nullable": true
        }
      },
      "required": [
        "created_at",
        "credits_reserved",
        "error",
        "file_format",
        "filename",
        "job_id",
        "pages",
        "source",
        "state",
        "updated_at",
        "validation"
      ]
    },
    "DeveloperJobError": {
      "type": "object",
      "description": "Persisted processing failure details for a failed job.",
      "properties": {
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "category",
        "reason"
      ]
    },
    "DeveloperJobValidation": {
      "type": "object",
      "description": "Math-validation signal present on terminal success jobs (spec §5.4).\n\nThe three fields answer three different questions and are routinely confused,\nso each one says so in the public schema rather than leaving a caller to guess\nfrom a bare boolean.",
      "properties": {
        "reconcilable": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether this statement carried the anchors a balance check needs — both debit and credit sides, and an opening and closing figure. `false` means the document itself gave us nothing to check against, not that a check failed. `null` means no verdict was produced. Checking, savings and credit-card statements are all eligible; whether an individual document qualifies depends on what it prints."
        },
        "passed": {
          "type": "boolean",
          "description": "Whether the conversion finished without warnings. Read it together with `reconcilable`: passing while `reconcilable` is false means nothing was off, not that the arithmetic was confirmed."
        },
        "mismatched_rows": {
          "type": "integer",
          "minimum": 0,
          "description": "Rows whose own arithmetic did not line up and that a human should look at."
        }
      },
      "required": [
        "mismatched_rows",
        "passed",
        "reconcilable"
      ]
    },
    "FileFormatEnum": {
      "enum": [
        "pdf"
      ],
      "type": "string",
      "description": "* `pdf` - pdf"
    },
    "SourceEnum": {
      "enum": [
        "web",
        "api"
      ],
      "type": "string",
      "description": "* `web` - web\n* `api` - api"
    },
    "StateEnum": {
      "enum": [
        "awaiting_upload",
        "queued",
        "processing",
        "succeeded",
        "succeeded_with_warnings",
        "insufficient_credits",
        "failed",
        "expired"
      ],
      "type": "string",
      "description": "* `awaiting_upload` - awaiting_upload\n* `queued` - queued\n* `processing` - processing\n* `succeeded` - succeeded\n* `succeeded_with_warnings` - succeeded_with_warnings\n* `insufficient_credits` - insufficient_credits\n* `failed` - failed\n* `expired` - expired"
    }
  }
}