{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vertesiahq/json-schema/vertesiahq-create-collection-payload-schema.json",
  "title": "CreateCollectionPayload",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vertesiahq-collections-api-openapi.yml#/components/schemas/CreateCollectionPayload",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Description of the collection and its purpose"
    },
    "skip_head_sync": {
      "type": "boolean",
      "description": "When true the collection does not track and sync member HEAD revisions. Defaults to false."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Categorization tags for the collection"
    },
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Default content type ID for documents in the collection"
    },
    "query": {
      "type": "object",
      "additionalProperties": true,
      "description": "MongoDB query that determines membership of a dynamic collection"
    },
    "properties": {
      "type": "object",
      "additionalProperties": true,
      "description": "Metadata properties attached to the collection"
    },
    "parent": {
      "type": [
        "string",
        "null"
      ],
      "description": "Parent collection ID when the collection is nested"
    },
    "table_layout": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ColumnLayout"
      },
      "description": "Column layout used when listing collection members"
    },
    "allowed_types": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Content type IDs allowed to be added to the collection"
    },
    "updated_by": {
      "type": "string",
      "description": "Identity recorded as the updater of the collection"
    },
    "shared_properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Names of collection properties whose values are propagated to member documents"
    },
    "sensitivity": {
      "type": "number",
      "description": "BLP sensitivity level for member documents"
    },
    "compartments": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Compartments for member documents"
    },
    "shared_root": {
      "type": "boolean",
      "description": "Explicitly share this collection as a root of the project shared space (listable/readable by non-members via matching shared-content ABAC rules). This is the explicit API share flag — the sync never sets it."
    },
    "name": {
      "type": "string",
      "description": "Name of the collection"
    },
    "dynamic": {
      "type": "boolean",
      "description": "When true, membership is determined by `query`; when false, members are added explicitly"
    }
  },
  "required": [
    "name",
    "dynamic"
  ],
  "additionalProperties": false,
  "$defs": {
    "ColumnLayout": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "description": "The path of the field to use (e.g. \"properties.title\")"
        },
        "name": {
          "type": "string",
          "description": "The name to display in the table column"
        },
        "type": {
          "type": "string",
          "description": "The type of the field specifies how the rendering will be done. If not specified the string type will be used. The type may contain additional parameters prepended using a web-like query string syntax: date?LLL"
        },
        "fallback": {
          "type": "string",
          "description": "Path of an alternate field to display when the primary field is absent"
        },
        "default": {
          "description": "A default value to be used if the field is not present in the object"
        }
      },
      "required": [
        "field",
        "name"
      ],
      "additionalProperties": false
    }
  }
}