{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tiro-ooo/json-schema/tiro-ooo-folder-detail-schema.json",
  "title": "FolderDetail",
  "description": "A folder and its metadata.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tiro-ooo-openapi.yml#/components/schemas/FolderDetail",
  "type": "object",
  "required": [
    "id",
    "workspaceGuid",
    "title",
    "description",
    "sharingType",
    "parentId",
    "color",
    "isTeamFolder",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the folder"
    },
    "workspaceGuid": {
      "type": "string",
      "description": "GUID of the workspace the folder belongs to"
    },
    "title": {
      "type": "string",
      "description": "Folder title (max 50 characters)"
    },
    "description": {
      "type": "string",
      "description": "Folder description. Empty string when unset."
    },
    "sharingType": {
      "$ref": "#/$defs/FolderSharingType"
    },
    "parentId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Parent folder ID. `null` for root-level folders. In the List Folders\nresponse, `parentId` is also `null` when the parent folder is not\naccessible to you.\n"
    },
    "color": {
      "type": "string",
      "description": "Folder color in hex format (#RRGGBB)"
    },
    "isTeamFolder": {
      "type": "boolean",
      "description": "`true` when the folder is shared with the workspace (any `sharingType`\nexcept `PRIVATE`); `false` for `PRIVATE` folders. Retained for backward\ncompatibility — use `sharingType` for the precise access level.\n"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 creation timestamp (UTC)"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 last-update timestamp (UTC)"
    }
  },
  "$defs": {
    "FolderSharingType": {
      "type": "string",
      "description": "Who can access a folder and the notes inside it.\n\n| Type | View | Edit |\n|------|------|------|\n| `PRIVATE` | Only you | Only you |\n| `ALL_MEMBER_VIEWER` | All workspace members | No member-wide edit access |\n| `ALL_MEMBER_EDITOR` | All workspace members | All workspace members |\n| `LIMITED` | Invited members only | Invited members only (per-member role) |\n\n- `PRIVATE`: Personal folder. Not shared with the workspace.\n- `ALL_MEMBER_VIEWER`: Every workspace member can view; no member-wide edit access is granted.\n- `ALL_MEMBER_EDITOR`: Every workspace member can view and edit.\n- `LIMITED`: Only explicitly invited members can access, each with an individual role (`VIEWER` or `EDITOR`).\n",
      "enum": [
        "PRIVATE",
        "ALL_MEMBER_VIEWER",
        "ALL_MEMBER_EDITOR",
        "LIMITED"
      ]
    }
  }
}