{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-document-detail-response-schema.json",
  "title": "DocumentDetailResponse",
  "description": "Full document detail with raw content.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-documents-api-openapi.yml#/components/schemas/DocumentDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "graph_id": {
      "type": "string",
      "title": "Graph Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "content": {
      "type": "string",
      "title": "Content"
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tags"
    },
    "folder": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Folder"
    },
    "external_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "External Id"
    },
    "source_type": {
      "type": "string",
      "title": "Source Type"
    },
    "source_provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Provider"
    },
    "sections_indexed": {
      "type": "integer",
      "title": "Sections Indexed"
    },
    "file": {
      "anyOf": [
        {
          "$ref": "#/$defs/DocumentFileInfo"
        },
        {
          "type": "null"
        }
      ],
      "description": "The stored file, for a document that is one; its `content` is empty. Download it from `GET /documents/{document_id}/file`."
    },
    "evidence_for": {
      "items": {
        "$ref": "#/$defs/DocumentEvidence"
      },
      "type": "array",
      "title": "Evidence For",
      "description": "The live events that name this document as their evidence (an invoice, a bill, a statement balance), newest first, at most 50. While any are listed, the document cannot be deleted."
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "graph_id",
    "user_id",
    "title",
    "content",
    "source_type",
    "sections_indexed",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "DocumentEvidence": {
      "properties": {
        "event_id": {
          "type": "string",
          "title": "Event Id"
        },
        "event_type": {
          "type": "string",
          "title": "Event Type"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "occurred_at": {
          "type": "string",
          "title": "Occurred At"
        }
      },
      "type": "object",
      "required": [
        "event_id",
        "event_type",
        "status",
        "occurred_at"
      ],
      "title": "DocumentEvidence",
      "description": "A live event on the books that names the document as its evidence."
    },
    "DocumentFileInfo": {
      "properties": {
        "file_name": {
          "type": "string",
          "title": "File Name",
          "description": "The file's name as uploaded."
        },
        "content_type": {
          "type": "string",
          "title": "Content Type",
          "description": "The file's media type."
        },
        "size_bytes": {
          "type": "integer",
          "title": "Size Bytes",
          "description": "The stored file's size."
        },
        "sha256": {
          "type": "string",
          "title": "Sha256",
          "description": "Hex SHA-256 of the stored bytes, taken when the upload completed. A stored file never changes, so this identifies it."
        }
      },
      "type": "object",
      "required": [
        "file_name",
        "content_type",
        "size_bytes",
        "sha256"
      ],
      "title": "DocumentFileInfo",
      "description": "The stored file behind a document, when it is one."
    }
  }
}