{
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "JWT",
        "description": "JWT authentication token",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Semantic Platform API - GitHub for Semantic Models",
    "title": "Pletka API",
    "version": "2.0.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/admin/ontologies/families": {
      "post": {
        "operationId": "postAdminOntologiesFamilies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Create ontology family",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/families/{id}": {
      "post": {
        "operationId": "postAdminOntologiesFamilies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Update ontology family",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/families/{id}/delete": {
      "post": {
        "operationId": "postAdminOntologiesFamiliesDelete",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Delete ontology family",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}": {
      "post": {
        "operationId": "postAdminOntologies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Update ontology",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}/delete": {
      "post": {
        "operationId": "postAdminOntologiesDelete",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Delete ontology",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}/versions/{version_id}/activate": {
      "post": {
        "operationId": "postAdminOntologiesVersionsActivate",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Set version as active",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}/versions/{version_id}/compatibility": {
      "post": {
        "operationId": "postAdminOntologiesVersionsCompatibility",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Update version compatibility",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}/versions/{version_id}/delete": {
      "post": {
        "operationId": "postAdminOntologiesVersionsDelete",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Delete version",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/ontologies/{id}/versions/{version_id}/projects": {
      "get": {
        "operationId": "getAdminOntologiesVersionsProjects",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Admin: Get projects using this version",
        "tags": [
          "admin"
        ],
        "x-required-role": "admin"
      }
    },
    "/admin/stats": {
      "get": {
        "operationId": "getAdminStats",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "System statistics and metrics",
        "tags": [
          "admin"
        ],
        "x-feature-tier": "internal",
        "x-required-role": "admin"
      }
    },
    "/airtable/redirect/stats": {
      "get": {
        "operationId": "getAirtableRedirectStats",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get redirect service statistics",
        "tags": [
          "general"
        ]
      }
    },
    "/api-docs/markdown": {
      "get": {
        "operationId": "getApi-DocsMarkdown",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "API documentation in Markdown format",
        "tags": [
          "general"
        ]
      }
    },
    "/api-docs/openapi.json": {
      "get": {
        "operationId": "getApi-DocsOpenapi.Json",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "OpenAPI 3.0 specification (JSON)",
        "tags": [
          "general"
        ]
      }
    },
    "/api-docs/openapi.yaml": {
      "get": {
        "operationId": "getApi-DocsOpenapi.Yaml",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "OpenAPI 3.0 specification (YAML)",
        "tags": [
          "general"
        ]
      }
    },
    "/api/ontologies/base": {
      "get": {
        "operationId": "getApiOntologiesBase",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List all base ontologies",
        "tags": [
          "general"
        ]
      }
    },
    "/api/ontologies/{id}/versions": {
      "get": {
        "operationId": "getApiOntologiesVersions",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List versions for a base ontology",
        "tags": [
          "general"
        ]
      }
    },
    "/api/projects/{project_id}/ontology-labels": {
      "get": {
        "operationId": "getApiProjectsOntology-Labels",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "class_labels": {
                      "description": "object (URI -\u003e label mappings for classes)",
                      "type": "string"
                    },
                    "project_id": {
                      "description": "string",
                      "type": "string"
                    },
                    "property_labels": {
                      "description": "object (URI -\u003e label mappings for properties)",
                      "type": "string"
                    },
                    "success": {
                      "description": "bool",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get human-readable labels for ontology classes and properties used in project fields",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/projects/{project_id}/validate-ontology-paths": {
      "get": {
        "operationId": "getApiProjectsValidate-Ontology-Paths",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "empty_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "fields_with_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "invalid_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "project_id": {
                      "description": "string",
                      "type": "string"
                    },
                    "project_name": {
                      "description": "string",
                      "type": "string"
                    },
                    "summary": {
                      "description": "string",
                      "type": "string"
                    },
                    "total_fields": {
                      "description": "int",
                      "type": "integer"
                    },
                    "valid_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "validation_errors": {
                      "description": "array of validation error objects",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Validate all ontology paths for a project's fields",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "operationId": "postApiV1AuthLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "login": {
                    "description": "string (email or username)",
                    "type": "string"
                  },
                  "password": {
                    "description": "string",
                    "type": "string"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "description": "string",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "token": {
                      "description": "string (JWT)",
                      "type": "string"
                    },
                    "user": {
                      "description": "object",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "User login with email/username and password",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "postApiV1AuthLogout",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "User logout",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "operationId": "getApiV1AuthMe",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "email": {
                      "description": "string",
                      "type": "string"
                    },
                    "id": {
                      "description": "string (UUID)",
                      "type": "string"
                    },
                    "role": {
                      "description": "string",
                      "type": "string"
                    },
                    "username": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get current user profile",
        "tags": [
          "auth"
        ]
      },
      "put": {
        "operationId": "putApiV1AuthMe",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "description": "string (optional)",
                    "type": "string"
                  },
                  "first_name": {
                    "description": "string (optional)",
                    "type": "string"
                  },
                  "last_name": {
                    "description": "string (optional)",
                    "type": "string"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update current user profile",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "operationId": "postApiV1AuthRefresh",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "refresh_token": {
                    "description": "string (required)",
                    "type": "string"
                  }
                },
                "required": [
                  "refresh_token"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "token": {
                      "description": "string (new JWT)",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Refresh JWT token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "operationId": "postApiV1AuthRegister",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "confirm_password": {
                    "description": "string (required, must match password)",
                    "type": "string"
                  },
                  "email": {
                    "description": "string (required, valid email)",
                    "type": "string"
                  },
                  "institution": {
                    "description": "string (optional, institution name)",
                    "type": "string"
                  },
                  "name": {
                    "description": "string (required, min 2 chars)",
                    "type": "string"
                  },
                  "orcid": {
                    "description": "string (optional, ORCID identifier)",
                    "type": "string"
                  },
                  "password": {
                    "description": "string (required, min 8 chars)",
                    "type": "string"
                  },
                  "username": {
                    "description": "string (required, min 3 chars, alphanumeric)",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email",
                  "username",
                  "password",
                  "confirm_password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "errors": {
                      "description": "object (field validation errors)",
                      "type": "string"
                    },
                    "message": {
                      "description": "string",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "user": {
                      "description": "object",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "User registration with email, username and password",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/role/current": {
      "get": {
        "operationId": "getApiV1AuthRoleCurrent",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "current_role": {
                      "description": "string",
                      "type": "string"
                    },
                    "is_overridden": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "original_role": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get current role information",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/role/reset": {
      "post": {
        "operationId": "postApiV1AuthRoleReset",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Reset role override and return to original role",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/role/switch": {
      "post": {
        "operationId": "postApiV1AuthRoleSwitch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "role": {
                    "description": "string (viewer, contributor, maintainer, owner, admin)",
                    "type": "integer"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Switch to a different role (superadmin only)",
        "tags": [
          "auth"
        ],
        "x-required-role": "admin"
      }
    },
    "/api/v1/categories": {
      "get": {
        "operationId": "getApiV1Categories",
        "parameters": [
          {
            "description": "Search categories by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "List all categories across all projects with pagination",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/collections": {
      "get": {
        "operationId": "getApiV1Collections",
        "parameters": [
          {
            "description": "Search collections by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "List all collections across all projects with pagination",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/collections/{id}/export": {
      "get": {
        "operationId": "getApiV1CollectionsExport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "content-type": {
                      "description": "application/xml",
                      "type": "string"
                    },
                    "download": {
                      "description": "file attachment",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Export a collection in XML format. Supports query param ?format=xml",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/diagrams/instance": {
      "post": {
        "operationId": "postApiV1DiagramsInstance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "turtle": {
                    "description": "string (required, Turtle/N-Triples RDF content)",
                    "type": "string"
                  }
                },
                "required": [
                  "turtle"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "edge_count": {
                      "description": "int (number of relationship edges)",
                      "type": "integer"
                    },
                    "mermaid": {
                      "description": "string (Mermaid diagram syntax with CIDOC-CRM color-coded nodes)",
                      "type": "string"
                    },
                    "node_count": {
                      "description": "int (number of resource nodes)",
                      "type": "integer"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Convert Turtle RDF to an instance Mermaid diagram showing individual resources with URIs and literals",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/diagrams/ontology": {
      "post": {
        "operationId": "postApiV1DiagramsOntology",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "turtle": {
                    "description": "string (required, Turtle/N-Triples RDF content)",
                    "type": "string"
                  }
                },
                "required": [
                  "turtle"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "edge_count": {
                      "description": "int (number of relationship edges)",
                      "type": "integer"
                    },
                    "mermaid": {
                      "description": "string (Mermaid diagram syntax with CIDOC-CRM color-coded classes)",
                      "type": "string"
                    },
                    "node_count": {
                      "description": "int (number of class nodes)",
                      "type": "integer"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Convert Turtle RDF to an ontology-only Mermaid diagram showing CIDOC-CRM classes and relationships",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/enterprise-analytics": {
      "get": {
        "operationId": "getApiV1Enterprise-Analytics",
        "parameters": [
          {
            "description": "Metric type (performance, usage, quality)",
            "in": "query",
            "name": "metric",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Time granularity (hour, day, week, month)",
            "in": "query",
            "name": "granularity",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Aggregation method (sum, avg, max, min)",
            "in": "query",
            "name": "aggregation",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Enterprise analytics dashboard",
        "tags": [
          "general"
        ],
        "x-feature-tier": "enterprise"
      }
    },
    "/api/v1/fields": {
      "get": {
        "operationId": "getApiV1Fields",
        "parameters": [
          {
            "description": "Search fields by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "List all fields across all projects with pagination",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/fields/patterns": {
      "get": {
        "operationId": "getApiV1FieldsPatterns",
        "parameters": [
          {
            "description": "Optional project UUID filter",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "elements": {
                      "description": "array of element patterns with counts",
                      "type": "string"
                    },
                    "paths": {
                      "description": "array of full path patterns with counts",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "total_fields": {
                      "description": "number",
                      "type": "number"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get commonly used ontology path patterns across fields",
        "tags": [
          "patterns"
        ]
      }
    },
    "/api/v1/fields/search/path-element": {
      "get": {
        "operationId": "getApiV1FieldsSearchPath-Element",
        "parameters": [
          {
            "description": "The local name to search for (e.g., P1_is_identified_by, E21_Person)",
            "in": "query",
            "name": "element",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional element type filter (class, property, literal)",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional project UUID filter",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "description": "number",
                      "type": "number"
                    },
                    "element": {
                      "description": "string",
                      "type": "string"
                    },
                    "fields": {
                      "description": "array of field summaries",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    },
                    "type": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Search fields by ontology path element. Query params: element (required), type (optional: class/property/literal), project_id (optional)",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/fields/{id}/export": {
      "get": {
        "operationId": "getApiV1FieldsExport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "content-type": {
                      "description": "application/xml or text/turtle",
                      "type": "string"
                    },
                    "download": {
                      "description": "file attachment",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Export a field in XML or Turtle format. Supports query param ?format=xml|turtle",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/institutions": {
      "get": {
        "operationId": "getApiV1Institutions",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Search institutions by name",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires admin role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List all institutions",
        "tags": [
          "general"
        ],
        "x-required-role": "admin"
      }
    },
    "/api/v1/models": {
      "get": {
        "operationId": "getApiV1Models",
        "parameters": [
          {
            "description": "Search models by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (default: 1)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Items per page (default: 20, max: 100)",
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "List all models across all projects with pagination",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/models/{id}/diagram": {
      "get": {
        "operationId": "getApiV1ModelsDiagram",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "description": "int (field count)",
                      "type": "integer"
                    },
                    "id": {
                      "description": "string (model ID)",
                      "type": "string"
                    },
                    "mermaid": {
                      "description": "string (Mermaid diagram syntax)",
                      "type": "string"
                    },
                    "name": {
                      "description": "string (model name)",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Generate a Mermaid diagram for a model showing its fields and relationships",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/models/{id}/export": {
      "get": {
        "operationId": "getApiV1ModelsExport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "content-type": {
                      "description": "application/xml",
                      "type": "string"
                    },
                    "download": {
                      "description": "file attachment",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Export a model in XML format. Supports query param ?format=xml",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/autocomplete": {
      "post": {
        "operationId": "postApiV1OntologyAutocomplete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "current_path": {
                    "description": "array of strings (current path elements)",
                    "type": "string"
                  },
                  "include_inverse": {
                    "description": "bool (include inverse properties)",
                    "type": "boolean"
                  },
                  "include_parent_projects": {
                    "description": "bool (include parent project ontologies)",
                    "type": "boolean"
                  },
                  "max_results": {
                    "description": "int (default: 20)",
                    "type": "integer"
                  },
                  "project_id": {
                    "description": "string (optional, for project context)",
                    "type": "string"
                  },
                  "query": {
                    "description": "string (search query)",
                    "type": "string"
                  },
                  "version_id": {
                    "description": "string (optional, for specific version)",
                    "type": "string"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get ontology autocomplete suggestions based on current path",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/convert-legacy-path": {
      "post": {
        "operationId": "postApiV1OntologyConvert-Legacy-Path",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "legacy_path": {
                    "description": "string (required, e.g., '-\u003eaaao:ZP29i_is_familial_subject_of-\u003eaaao:ZE10_Family_Status[SRDF.373_1]')",
                    "type": "string"
                  },
                  "version_id": {
                    "description": "string (required)",
                    "type": "string"
                  }
                },
                "required": [
                  "version_id",
                  "legacy_path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "cleaned_path": {
                      "description": "string",
                      "type": "string"
                    },
                    "converted_path": {
                      "description": "array of PathSuggestion objects",
                      "type": "string"
                    },
                    "message": {
                      "description": "string",
                      "type": "string"
                    },
                    "original_path": {
                      "description": "string",
                      "type": "string"
                    },
                    "success": {
                      "description": "bool",
                      "type": "boolean"
                    },
                    "unresolved_items": {
                      "description": "array of strings",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Convert legacy path format to modern PathSuggestion format",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/metadata/{version_id}/{uri}": {
      "get": {
        "operationId": "getApiV1OntologyMetadata",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "comment": {
                      "description": "object (multilingual)",
                      "type": "string"
                    },
                    "domain_classes": {
                      "description": "array of strings",
                      "type": "string"
                    },
                    "label": {
                      "description": "object (multilingual)",
                      "type": "string"
                    },
                    "local_name": {
                      "description": "string",
                      "type": "string"
                    },
                    "ontology_info": {
                      "description": "object",
                      "type": "string"
                    },
                    "prefix": {
                      "description": "string",
                      "type": "string"
                    },
                    "range_classes": {
                      "description": "array of strings",
                      "type": "string"
                    },
                    "type": {
                      "description": "string",
                      "type": "string"
                    },
                    "uri": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get detailed metadata for an ontology element",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/path-diagram": {
      "post": {
        "operationId": "postApiV1OntologyPath-Diagram",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "path": {
                    "description": "string (required, ontology path e.g., '-\u003ecrm:P1_is_identified_by-\u003ecrm:E33_E41')",
                    "type": "string"
                  },
                  "scope_class": {
                    "description": "string (optional, starting class e.g., 'E21_Person')",
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "mermaid": {
                      "description": "string (Mermaid diagram syntax)",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Generate a Mermaid diagram for an ontology path",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/validate-legacy-path": {
      "post": {
        "operationId": "postApiV1OntologyValidate-Legacy-Path",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "legacy_path": {
                    "description": "string (required, e.g., '-\u003ecrm:P2_has_type-\u003ecrm:E55_Type[229_1]')",
                    "type": "string"
                  },
                  "project_id": {
                    "description": "string (required)",
                    "type": "string"
                  },
                  "scope_id": {
                    "description": "string (optional, base class like 'E21' or 'crm:E21_Person')",
                    "type": "string"
                  }
                },
                "required": [
                  "project_id",
                  "legacy_path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error_message": {
                      "description": "string (if invalid)",
                      "type": "string"
                    },
                    "is_valid": {
                      "description": "bool",
                      "type": "boolean"
                    },
                    "severity": {
                      "description": "string (info, warning, error)",
                      "type": "string"
                    },
                    "suggested_fixes": {
                      "description": "array of fix suggestions",
                      "type": "string"
                    },
                    "unresolved_items": {
                      "description": "array of strings (unresolved path elements)",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Validate a legacy ontology path against project ontologies",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/ontology/validate-path": {
      "post": {
        "operationId": "postApiV1OntologyValidate-Path",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "path": {
                    "description": "array of strings (path to validate)",
                    "type": "string"
                  },
                  "project_id": {
                    "description": "string (required)",
                    "type": "string"
                  }
                },
                "required": [
                  "project_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error_message": {
                      "description": "string (if invalid)",
                      "type": "string"
                    },
                    "error_step": {
                      "description": "int (index of error in path)",
                      "type": "integer"
                    },
                    "is_valid": {
                      "description": "bool",
                      "type": "boolean"
                    },
                    "suggestions": {
                      "description": "array of strings (alternative suggestions)",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Validate an ontological path for correctness",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/patterns": {
      "get": {
        "operationId": "getApiV1Patterns",
        "parameters": [
          {
            "description": "Search patterns by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by pattern type (field, model, collection)",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by project UUID",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of patterns per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Search and list semantic patterns",
        "tags": [
          "patterns"
        ]
      },
      "post": {
        "operationId": "postApiV1Patterns",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "description": "string (optional)",
                    "type": "string"
                  },
                  "name": {
                    "description": "string (required)",
                    "type": "string"
                  },
                  "project_id": {
                    "description": "string (UUID, required)",
                    "type": "string"
                  },
                  "type": {
                    "description": "string (field, model, collection)",
                    "type": "string"
                  }
                },
                "required": [
                  "project_id",
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires contributor role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new semantic pattern",
        "tags": [
          "patterns"
        ],
        "x-required-role": "contributor"
      }
    },
    "/api/v1/premium-reports": {
      "get": {
        "operationId": "getApiV1Premium-Reports",
        "parameters": [
          {
            "description": "Type of report to generate",
            "in": "query",
            "name": "report_type",
            "required": true,
            "schema": {
              "enum": [
                "usage",
                "analytics",
                "patterns",
                "quality"
              ],
              "type": "string"
            }
          },
          {
            "description": "Start date (ISO 8601 format)",
            "example": "2024-01-01T00:00:00Z",
            "in": "query",
            "name": "start_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (ISO 8601 format)",
            "example": "2024-12-31T23:59:59Z",
            "in": "query",
            "name": "end_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Output format",
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "json",
              "enum": [
                "json",
                "csv",
                "pdf",
                "excel"
              ],
              "type": "string"
            }
          },
          {
            "description": "Grouping field",
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month",
                "project",
                "user"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Generate premium reports",
        "tags": [
          "general"
        ],
        "x-feature-tier": "premium"
      }
    },
    "/api/v1/projects": {
      "get": {
        "operationId": "getApiV1Projects",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of projects per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Search projects by name or description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by visibility (public, private)",
            "in": "query",
            "name": "visibility",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List all projects",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postApiV1Projects",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "description": "string (optional)",
                    "type": "string"
                  },
                  "identifier": {
                    "description": "string (optional)",
                    "type": "string"
                  },
                  "name": {
                    "description": "string (required)",
                    "type": "string"
                  },
                  "visibility": {
                    "description": "string (public, private)",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "403": {
            "description": "Forbidden - Requires contributor role"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new project",
        "tags": [
          "projects"
        ],
        "x-required-role": "contributor"
      }
    },
    "/api/v1/projects/{id}/diagram": {
      "get": {
        "operationId": "getApiV1ProjectsDiagram",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "description": "int (model count)",
                      "type": "integer"
                    },
                    "id": {
                      "description": "string (project ID)",
                      "type": "string"
                    },
                    "mermaid": {
                      "description": "string (Mermaid diagram syntax)",
                      "type": "string"
                    },
                    "name": {
                      "description": "string (project name)",
                      "type": "string"
                    },
                    "success": {
                      "description": "boolean",
                      "type": "boolean"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Generate a Mermaid diagram showing project structure with models and collections",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/v1/projects/{projectId}": {
      "get": {
        "operationId": "getApiV1Projects",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get project details by ID",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/v1/projects/{project_id}/ontologies": {
      "get": {
        "operationId": "getApiV1ProjectsOntologies",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ontologies": {
                      "description": "array of ontology versions",
                      "type": "string"
                    },
                    "project_id": {
                      "description": "string",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get ontologies associated with a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/v1/projects/{project_id}/validate-ontology-paths": {
      "get": {
        "operationId": "getApiV1ProjectsValidate-Ontology-Paths",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "invalid_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "project_id": {
                      "description": "string",
                      "type": "string"
                    },
                    "project_name": {
                      "description": "string",
                      "type": "string"
                    },
                    "summary": {
                      "description": "string",
                      "type": "string"
                    },
                    "total_fields": {
                      "description": "int",
                      "type": "integer"
                    },
                    "valid_paths": {
                      "description": "int",
                      "type": "integer"
                    },
                    "validation_errors": {
                      "description": "array of validation error objects",
                      "type": "string"
                    }
                  },
                  "required": [],
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Validate all ontology paths for a project's fields",
        "tags": [
          "projects"
        ]
      }
    },
    "/api/v1/stats": {
      "get": {
        "operationId": "getApiV1Stats",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get dashboard statistics for all entity types",
        "tags": [
          "general"
        ]
      }
    },
    "/api/v1/users": {
      "get": {
        "operationId": "getApiV1Users",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Number of users per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Search users by name or username",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List all users (public profiles)",
        "tags": [
          "users"
        ]
      }
    },
    "/api/v1/users/{userId}": {
      "get": {
        "operationId": "getApiV1Users",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get user profile by ID",
        "tags": [
          "users"
        ]
      }
    },
    "/explorer/api/{entity}": {
      "get": {
        "operationId": "getExplorerApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get entities as JSON",
        "tags": [
          "general"
        ]
      }
    },
    "/explorer/api/{entity}/{id}": {
      "get": {
        "operationId": "getExplorerApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get entity details as JSON",
        "tags": [
          "general"
        ]
      }
    },
    "/explorer/api/{entity}/{id}/parse-export": {
      "post": {
        "operationId": "postExplorerApiParse-Export",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Test ParseFromExport on an entity",
        "tags": [
          "general"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "System health check",
        "tags": [
          "health"
        ]
      }
    },
    "/health/check-all": {
      "get": {
        "operationId": "getHealthCheck-All",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Test all registered endpoints",
        "tags": [
          "health"
        ],
        "x-feature-tier": "internal"
      }
    },
    "/health/check/{category}/{index}": {
      "get": {
        "operationId": "getHealthCheck",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Test individual endpoint",
        "tags": [
          "health"
        ],
        "x-feature-tier": "internal"
      }
    },
    "/ontologies/{id}/versions/{version_id}/classes/{class_uri}": {
      "get": {
        "operationId": "getOntologiesVersionsClasses",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get details of a specific ontology class",
        "tags": [
          "general"
        ]
      }
    },
    "/ontologies/{id}/versions/{version_id}/periodic-table-data": {
      "get": {
        "operationId": "getOntologiesVersionsPeriodic-Table-Data",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "JSON data for periodic table visualization",
        "tags": [
          "general"
        ]
      }
    },
    "/ontologies/{id}/versions/{version_id}/properties/{property_uri}": {
      "get": {
        "operationId": "getOntologiesVersionsProperties",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get details of a specific ontology property",
        "tags": [
          "general"
        ]
      }
    },
    "/projects": {
      "post": {
        "operationId": "postProjects",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/api": {
      "get": {
        "operationId": "getProjectsApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "List all projects as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/api/{projectID}": {
      "get": {
        "operationId": "getProjectsApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get project details as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/check-prefix": {
      "get": {
        "operationId": "getProjectsCheck-Prefix",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Check if an ID prefix is available",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/ontologies/available": {
      "get": {
        "operationId": "getProjectsOntologiesAvailable",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List all available ontologies and their versions",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/categories": {
      "get": {
        "operationId": "getProjectsCategories",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get project categories with counts as JSON",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsCategories",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new category in a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/categories/api/{categoryID}": {
      "get": {
        "operationId": "getProjectsCategoriesApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get category details as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/categories/reorder": {
      "patch": {
        "operationId": "patchProjectsCategoriesReorder",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Reorder categories in a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/categories/{categoryID}": {
      "delete": {
        "operationId": "deleteProjectsCategories",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a category",
        "tags": [
          "projects"
        ]
      },
      "put": {
        "operationId": "putProjectsCategories",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a category",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/categories/{categoryID}/stats": {
      "get": {
        "operationId": "getProjectsCategoriesStats",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get category usage statistics",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/collections": {
      "get": {
        "operationId": "getProjectsCollections",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get project collections as JSON",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsCollections",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new collection in a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/collections/api/{collectionID}": {
      "get": {
        "operationId": "getProjectsCollectionsApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get collection details as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/collections/{collectionID}": {
      "delete": {
        "operationId": "deleteProjectsCollections",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a collection",
        "tags": [
          "projects"
        ]
      },
      "put": {
        "operationId": "putProjectsCollections",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a collection",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/collections/{collectionID}/fields": {
      "get": {
        "operationId": "getProjectsCollectionsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get fields for a collection as JSON",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsCollectionsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Save collection fields to database",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/collections/{collectionID}/fork": {
      "post": {
        "operationId": "postProjectsCollectionsFork",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Fork an external collection to make a local editable copy",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/external-links/{entityType}/{entityID}": {
      "get": {
        "operationId": "getProjectsExternal-Links",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get external links (Airtable, Zellij v1) for an entity",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields": {
      "get": {
        "operationId": "getProjectsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get project fields as JSON",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new field in a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields/aggregations": {
      "get": {
        "operationId": "getProjectsFieldsAggregations",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get field filter aggregations",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields/api/{fieldID}": {
      "get": {
        "operationId": "getProjectsFieldsApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get field details as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields/{fieldID}": {
      "delete": {
        "operationId": "deleteProjectsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a field",
        "tags": [
          "projects"
        ]
      },
      "put": {
        "operationId": "putProjectsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a field",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields/{fieldID}/collections": {
      "get": {
        "operationId": "getProjectsFieldsCollections",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get collections that use this field",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/fields/{fieldID}/models": {
      "get": {
        "operationId": "getProjectsFieldsModels",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get models that use this field",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/form-schema/{entityType}": {
      "get": {
        "operationId": "getProjectsForm-Schema",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get form schema for entity type",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/inheritance-tree": {
      "get": {
        "operationId": "getProjectsInheritance-Tree",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get project inheritance tree with ontology counts",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/list-schema/{entityType}": {
      "get": {
        "operationId": "getProjectsList-Schema",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get list schema for entity type",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/models": {
      "get": {
        "operationId": "getProjectsModels",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get project models as JSON",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsModels",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create a new model in a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/models/api/{modelID}": {
      "get": {
        "operationId": "getProjectsModelsApi",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get model details as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/models/{modelID}": {
      "delete": {
        "operationId": "deleteProjectsModels",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Delete a model",
        "tags": [
          "projects"
        ]
      },
      "put": {
        "operationId": "putProjectsModels",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update a model",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/models/{modelID}/data": {
      "get": {
        "operationId": "getProjectsModelsData",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Get model structure and fields as JSON",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/models/{modelID}/fields": {
      "post": {
        "operationId": "postProjectsModelsFields",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Save model fields to database",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/ontologies": {
      "get": {
        "operationId": "getProjectsOntologies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List ontology versions linked to this project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsOntologies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Link an ontology version to this project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/ontologies/{ontologyVersionID}": {
      "delete": {
        "operationId": "deleteProjectsOntologies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Remove an ontology version link from this project",
        "tags": [
          "projects"
        ]
      },
      "patch": {
        "operationId": "patchProjectsOntologies",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project-ontology link metadata",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/settings/danger": {
      "post": {
        "operationId": "postProjectsSettingsDanger",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project danger zone settings",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/settings/general": {
      "post": {
        "operationId": "postProjectsSettingsGeneral",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project general settings",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/settings/ontology": {
      "post": {
        "operationId": "postProjectsSettingsOntology",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project ontology \u0026 semantics settings",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/settings/repository": {
      "post": {
        "operationId": "postProjectsSettingsRepository",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project repository settings",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/settings/social": {
      "post": {
        "operationId": "postProjectsSettingsSocial",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Update project social \u0026 collaboration settings",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{projectID}/star": {
      "delete": {
        "operationId": "deleteProjectsStar",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Unstar a project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "postProjectsStar",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "description": "Bad request - Invalid parameters"
          },
          "401": {
            "description": "Unauthorized - Authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Star a project",
        "tags": [
          "projects"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Production server",
      "url": "https://api.pletka.io/api/v1"
    },
    {
      "description": "Development server",
      "url": "http://localhost:8080/api/v1"
    }
  ],
  "tags": [
    {
      "description": "Authentication endpoints",
      "name": "auth"
    },
    {
      "description": "User management",
      "name": "users"
    },
    {
      "description": "Project management",
      "name": "projects"
    },
    {
      "description": "Pattern management (fields, models, collections)",
      "name": "patterns"
    },
    {
      "description": "Health and monitoring",
      "name": "health"
    },
    {
      "description": "Administrative functions",
      "name": "admin"
    }
  ]
}