{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-index-document-op-schema.json",
  "title": "IndexDocumentOp",
  "description": "Body for index-document (corpus content-op).\n\nCreate a new document when `document_id` is absent; update the named\ndocument (partial — only supplied fields) when present.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-content-operations-api-openapi.yml#/components/schemas/IndexDocumentOp",
  "properties": {
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Document Id",
      "description": "Present → update that document; absent → create a new one"
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "Required when creating"
    },
    "content": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500000
        },
        {
          "type": "null"
        }
      ],
      "title": "Content",
      "description": "Required when creating"
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tags",
      "description": "Optional labels"
    },
    "folder": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Folder",
      "description": "Optional folder"
    },
    "external_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "External Id",
      "description": "Upsert key (create): re-indexing the same id replaces"
    }
  },
  "additionalProperties": false,
  "type": "object"
}