{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/serpkite-com/json-schema/serpkite-com-batch-schema.json",
  "title": "Batch",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/serpkite-com-batches-api-openapi.yml#/components/schemas/Batch",
  "type": "object",
  "required": [
    "id",
    "status",
    "endpoint",
    "created_at",
    "poll_url"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "done",
        "failed"
      ]
    },
    "endpoint": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "credits_used": {
      "type": "number"
    },
    "poll_url": {
      "type": "string"
    },
    "webhook_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "webhook_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "pending",
        "delivered",
        "failed",
        null
      ]
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Present when done; kept 24h. The endpoint's response body, or {markdown, meta} for format=markdown jobs"
    }
  }
}