{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scribetools-com/json-schema/scribetools-com-outcome-job-created-schema.json",
  "title": "OutcomeJobCreated",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/scribetools-com-api-openapi.json#/components/schemas/OutcomeJobCreated",
  "properties": {
    "job_id": {
      "type": "string",
      "title": "Job Id"
    },
    "created": {
      "type": "boolean",
      "title": "Created",
      "description": "False when an earlier request with this idempotency key made the job."
    },
    "state": {
      "type": "string",
      "title": "State"
    },
    "outcome": {
      "type": "string",
      "title": "Outcome"
    },
    "format": {
      "type": "string",
      "title": "Format"
    },
    "credits_reserved": {
      "type": "integer",
      "title": "Credits Reserved",
      "description": "Credits held for this job; charged only for work that completes."
    },
    "page_selection": {
      "anyOf": [
        {
          "$ref": "#/$defs/PageSelectionInfo"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set when the job processes only some pages of its file."
    },
    "callback_secret": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Callback Secret",
      "description": "Only with callback_url: verify each callback's ScribeTools-Signature header (t=<unix>,v1=<hex HMAC-SHA256 of '<t>.' + body>) with this secret."
    }
  },
  "type": "object",
  "required": [
    "job_id",
    "created",
    "state",
    "outcome",
    "format",
    "credits_reserved"
  ],
  "$defs": {
    "PageSelectionInfo": {
      "properties": {
        "pages": {
          "type": "string",
          "title": "Pages",
          "description": "The pages processed, in the source file's numbering, e.g. \"12-14\"."
        },
        "page_count": {
          "type": "integer",
          "title": "Page Count",
          "description": "How many pages are processed and charged."
        },
        "source_pages": {
          "type": "integer",
          "title": "Source Pages",
          "description": "Pages in the whole source file."
        }
      },
      "type": "object",
      "required": [
        "pages",
        "page_count",
        "source_pages"
      ],
      "title": "PageSelectionInfo"
    }
  }
}