{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citation-co/json-schema/citation-co-write-schema.json",
  "title": "write",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citation-co-openapi.json#/components/schemas/write",
  "type": "object",
  "properties": {
    "max_credits": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "document_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "apply": {
      "default": false,
      "type": "boolean"
    },
    "version": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "message": {
      "type": "string",
      "minLength": 1,
      "maxLength": 24000
    },
    "intent": {
      "type": "string",
      "enum": [
        "brief",
        "outline",
        "section",
        "sources",
        "synthesis",
        "argument",
        "style",
        "rewrite",
        "memory",
        "feedback",
        "completion"
      ]
    },
    "selection": {
      "type": "string",
      "maxLength": 40000
    },
    "source_ids": {
      "default": [],
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      }
    },
    "section_id": {
      "type": "string",
      "maxLength": 100
    },
    "comment_ids": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      }
    },
    "shorten_percent": {
      "type": "number",
      "minimum": 5,
      "maximum": 80
    },
    "terms": {
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 200
      }
    },
    "context_revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "themes": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 4000
      }
    },
    "cursor": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "max_credits",
    "document_id",
    "version",
    "message",
    "intent"
  ],
  "additionalProperties": false
}