{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clment-com/json-schema/clment-com-document-version-schema.json",
  "title": "DocumentVersion",
  "description": "A file attached to a contract — the primary document, one of\nits revisions, or a supplementary attachment.\n",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clment-com-openapi.yml#/components/schemas/DocumentVersion",
  "type": "object",
  "required": [
    "id",
    "contractId",
    "versionNumber",
    "label",
    "versionType",
    "fileName",
    "fileFormat",
    "fileSize",
    "createdAt",
    "createdBy"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Use this as `versionId` / in the attachment-id arrays on a review."
    },
    "contractId": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "`primary` for the main document; any other value (e.g. amendment, schedule, exhibit, side-letter) marks an attachment."
    },
    "attachmentGroupId": {
      "type": "string",
      "description": "Groups a document and its revisions together."
    },
    "versionNumber": {
      "type": "integer"
    },
    "label": {
      "type": "string",
      "description": "Human label, e.g. \"Original\" or \"Redline v3\"."
    },
    "versionType": {
      "type": "string",
      "description": "e.g. original, revision, redline, converted."
    },
    "fileName": {
      "type": "string"
    },
    "fileFormat": {
      "type": "string"
    },
    "fileSize": {
      "type": [
        "integer",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  }
}