{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collate/json-schema/collate-create-aiapplication-schema.json",
  "title": "CreateAIApplication",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collate-ai-applications-api-openapi.yml#/components/schemas/CreateAIApplication",
  "required": [
    "applicationType",
    "name"
  ],
  "type": "object",
  "properties": {
    "name": {
      "maxLength": 256,
      "minLength": 1,
      "pattern": "^((?!::)[^>\"\\x00-\\x1f])*$",
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "applicationType": {
      "type": "string",
      "enum": [
        "Chatbot",
        "Agent",
        "Copilot",
        "Assistant",
        "RAG",
        "CodeGenerator",
        "DataAnalyst",
        "AutomationBot",
        "MultiAgent",
        "Custom"
      ]
    },
    "developmentStage": {
      "type": "string",
      "enum": [
        "Proposal",
        "Development",
        "Testing",
        "Staging",
        "Production",
        "Deprecated",
        "Unauthorized"
      ]
    },
    "modelConfigurations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ModelConfiguration"
      }
    },
    "primaryModel": {
      "maxLength": 3072,
      "minLength": 1,
      "type": "string"
    },
    "promptTemplates": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "dataSources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "knowledgeBases": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "upstreamApplications": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "downstreamApplications": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "framework": {
      "$ref": "#/$defs/FrameworkInfo"
    },
    "governanceMetadata": {
      "$ref": "#/$defs/GovernanceMetadata"
    },
    "biasMetrics": {
      "$ref": "#/$defs/BiasMetrics"
    },
    "performanceMetrics": {
      "$ref": "#/$defs/PerformanceMetrics"
    },
    "qualityMetrics": {
      "$ref": "#/$defs/QualityMetrics"
    },
    "safetyMetrics": {
      "$ref": "#/$defs/SafetyMetrics"
    },
    "testSuites": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "sourceCode": {
      "type": "string"
    },
    "deploymentUrl": {
      "type": "string"
    },
    "documentation": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TagLabel"
      }
    },
    "owners": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "extension": {
      "type": "object"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "dataProducts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "reviewers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "lifeCycle": {
      "$ref": "#/$defs/LifeCycle"
    }
  },
  "$defs": {
    "AICompliance": {
      "type": "object",
      "properties": {
        "complianceRecords": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AIComplianceRecord"
          }
        }
      }
    },
    "AIComplianceRecord": {
      "required": [
        "framework",
        "status"
      ],
      "type": "object",
      "properties": {
        "framework": {
          "type": "string",
          "enum": [
            "EU_AI_Act",
            "Singapore_Model_AI_Governance",
            "Canada_AIDA",
            "US_AI_Bill_of_Rights",
            "NIST_AI_RMF",
            "ISO_IEC_42001",
            "UK_AI_Regulation",
            "China_AI_Regulations",
            "Custom"
          ]
        },
        "assessedBy": {
          "type": "string"
        },
        "assessedAt": {
          "type": "integer",
          "format": "int64"
        },
        "nextReviewDate": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "type": "string",
          "enum": [
            "Compliant",
            "PartiallyCompliant",
            "NonCompliant",
            "UnderReview",
            "NotApplicable"
          ]
        },
        "euAIAct": {
          "$ref": "#/$defs/EUAIActCompliance"
        },
        "ethicalAssessment": {
          "$ref": "#/$defs/EthicalAIAssessment"
        },
        "scopeAndDeployment": {
          "$ref": "#/$defs/ScopeAndDeployment"
        },
        "verification": {
          "$ref": "#/$defs/Verification"
        },
        "notes": {
          "type": "string"
        },
        "remediationRequired": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AIDetection": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "OutboundApiTraffic",
            "SSOLogs",
            "ConnectorAudit",
            "ManualUpload",
            "Other"
          ]
        },
        "sourceDetails": {
          "type": "string"
        },
        "detectedAt": {
          "type": "integer",
          "format": "int64"
        },
        "suspectedUser": {
          "type": "string"
        },
        "suspectedTeam": {
          "type": "string"
        },
        "volume7d": {
          "type": "string"
        },
        "flags": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "PiiWithoutDpa",
              "NoOwner",
              "NewDeployment",
              "OrgWideEnable",
              "PrivilegedData"
            ]
          }
        },
        "severity": {
          "type": "string",
          "enum": [
            "High",
            "Medium",
            "Low"
          ]
        }
      }
    },
    "AIEvidence": {
      "type": "object",
      "properties": {
        "dpiaUrl": {
          "type": "string"
        },
        "fairnessEvidenceUrl": {
          "type": "string"
        },
        "modelCardUrl": {
          "type": "string"
        },
        "technicalDocsUrl": {
          "type": "string"
        },
        "additional": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Additional"
          }
        }
      }
    },
    "AccessDetails": {
      "required": [
        "timestamp"
      ],
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "integer",
          "format": "int64"
        },
        "accessedBy": {
          "$ref": "#/$defs/EntityReference"
        },
        "accessedByAProcess": {
          "type": "string"
        }
      }
    },
    "AccountabilityMeasures": {
      "type": "object",
      "properties": {
        "hasOwner": {
          "type": "boolean"
        },
        "subjectToHumanOversight": {
          "type": "boolean"
        },
        "auditTrailEnabled": {
          "type": "boolean"
        }
      }
    },
    "Additional": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "framework": {
          "type": "string",
          "enum": [
            "EU_AI_Act",
            "Singapore_Model_AI_Governance",
            "Canada_AIDA",
            "US_AI_Bill_of_Rights",
            "NIST_AI_RMF",
            "ISO_IEC_42001",
            "UK_AI_Regulation",
            "China_AI_Regulations",
            "Custom"
          ]
        },
        "addedBy": {
          "type": "string"
        },
        "addedAt": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "BiasMetrics": {
      "type": "object",
      "properties": {
        "lastEvaluatedAt": {
          "type": "integer",
          "format": "int64"
        },
        "evaluationMethod": {
          "type": "string"
        },
        "overallBiasScore": {
          "type": "number",
          "format": "double"
        },
        "demographicParity": {
          "type": "number",
          "format": "double"
        },
        "equalizedOdds": {
          "type": "number",
          "format": "double"
        },
        "disparateImpact": {
          "type": "number",
          "format": "double"
        },
        "dimensionScores": {
          "$ref": "#/$defs/DimensionScores"
        },
        "testDataset": {
          "$ref": "#/$defs/EntityReference"
        },
        "biasDetected": {
          "type": "boolean"
        },
        "remediationSteps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ConformityAssessment": {
      "type": "object",
      "properties": {
        "assessmentRequired": {
          "type": "boolean"
        },
        "assessmentType": {
          "type": "string",
          "enum": [
            "Internal",
            "ThirdParty",
            "NotRequired"
          ]
        },
        "assessmentBody": {
          "type": "string"
        },
        "certificateNumber": {
          "type": "string"
        },
        "validUntil": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "CoverImage": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "position": {
          "type": "string"
        }
      }
    },
    "DataClassification": {
      "type": "object",
      "properties": {
        "accessesPII": {
          "type": "boolean"
        },
        "accessesSensitiveData": {
          "type": "boolean"
        },
        "dataCategories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dataRetentionPeriod": {
          "type": "string"
        }
      }
    },
    "DimensionScores": {
      "type": "object",
      "properties": {
        "gender": {
          "type": "number",
          "format": "double"
        },
        "race": {
          "type": "number",
          "format": "double"
        },
        "age": {
          "type": "number",
          "format": "double"
        },
        "religion": {
          "type": "number",
          "format": "double"
        },
        "disability": {
          "type": "number",
          "format": "double"
        },
        "socioeconomic": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "EUAIActCompliance": {
      "type": "object",
      "properties": {
        "riskClassification": {
          "type": "string",
          "enum": [
            "Minimal",
            "Limited",
            "High",
            "Unacceptable"
          ]
        },
        "riskRationale": {
          "type": "string"
        },
        "prohibitedPractices": {
          "$ref": "#/$defs/ProhibitedPractices"
        },
        "highRiskSystems": {
          "$ref": "#/$defs/HighRiskSystems"
        },
        "conformityAssessment": {
          "$ref": "#/$defs/ConformityAssessment"
        },
        "transparencyObligations": {
          "$ref": "#/$defs/TransparencyObligations"
        }
      }
    },
    "EntityReference": {
      "required": [
        "id",
        "type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "fullyQualifiedName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "deleted": {
          "type": "boolean"
        },
        "inherited": {
          "type": "boolean"
        },
        "href": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "EthicalAIAssessment": {
      "type": "object",
      "properties": {
        "privacyLevel": {
          "type": "string",
          "enum": [
            "Public",
            "Sensitive",
            "PersonalData"
          ]
        },
        "fairnessRisk": {
          "type": "string",
          "enum": [
            "Low",
            "Medium",
            "High"
          ]
        },
        "biasMitigationCoverage": {
          "type": "string",
          "enum": [
            "None",
            "Partial",
            "Full"
          ]
        },
        "reliabilitySafetyRisk": {
          "type": "string",
          "enum": [
            "Low",
            "Moderate",
            "High"
          ]
        },
        "transparencyLevel": {
          "type": "string",
          "enum": [
            "None",
            "Partial",
            "FullDisclosure"
          ]
        },
        "accountabilityMeasures": {
          "$ref": "#/$defs/AccountabilityMeasures"
        },
        "environmentalConsciousness": {
          "type": "string",
          "enum": [
            "LowRisk",
            "MediumRisk",
            "HighRisk"
          ]
        }
      }
    },
    "FrameworkInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "LangChain",
            "LlamaIndex",
            "AutoGen",
            "CrewAI",
            "Semantic Kernel",
            "Haystack",
            "Custom"
          ]
        },
        "version": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "enum": [
            "Python",
            "TypeScript",
            "JavaScript",
            "Java",
            "C#",
            "Go"
          ]
        }
      }
    },
    "GovernanceMetadata": {
      "type": "object",
      "properties": {
        "registrationStatus": {
          "type": "string",
          "enum": [
            "Registered",
            "Unregistered",
            "PendingApproval",
            "Approved",
            "Rejected"
          ]
        },
        "registeredBy": {
          "type": "string"
        },
        "registeredAt": {
          "type": "integer",
          "format": "int64"
        },
        "approvedBy": {
          "type": "string"
        },
        "approvedAt": {
          "type": "integer",
          "format": "int64"
        },
        "riskAssessment": {
          "$ref": "#/$defs/RiskAssessment"
        },
        "dataClassification": {
          "$ref": "#/$defs/DataClassification"
        },
        "governancePolicies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityReference"
          }
        },
        "aiCompliance": {
          "$ref": "#/$defs/AICompliance"
        },
        "detection": {
          "$ref": "#/$defs/AIDetection"
        },
        "evidence": {
          "$ref": "#/$defs/AIEvidence"
        },
        "remediationActions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RemediationAction"
          }
        },
        "intakeNotes": {
          "type": "string"
        },
        "approvalComments": {
          "type": "string"
        }
      }
    },
    "HighRiskSystems": {
      "type": "object",
      "properties": {
        "criticalInfrastructure": {
          "type": "boolean"
        },
        "educationVocationalTraining": {
          "type": "boolean"
        },
        "employment": {
          "type": "boolean"
        },
        "essentialPrivateServices": {
          "type": "boolean"
        },
        "essentialPublicServices": {
          "type": "boolean"
        },
        "lawEnforcement": {
          "type": "boolean"
        },
        "migrationAsylumBorderControl": {
          "type": "boolean"
        },
        "administrationOfJustice": {
          "type": "boolean"
        }
      }
    },
    "LifeCycle": {
      "type": "object",
      "properties": {
        "created": {
          "$ref": "#/$defs/AccessDetails"
        },
        "updated": {
          "$ref": "#/$defs/AccessDetails"
        },
        "accessed": {
          "$ref": "#/$defs/AccessDetails"
        }
      }
    },
    "ModelConfiguration": {
      "required": [
        "model",
        "purpose"
      ],
      "type": "object",
      "properties": {
        "model": {
          "$ref": "#/$defs/EntityReference"
        },
        "purpose": {
          "type": "string",
          "enum": [
            "Primary",
            "Reasoning",
            "Embedding",
            "CodeGeneration",
            "Fallback",
            "CostOptimization"
          ]
        },
        "selectionCriteria": {
          "$ref": "#/$defs/SelectionCriteria"
        },
        "parameters": {
          "$ref": "#/$defs/Parameters"
        }
      }
    },
    "Parameters": {
      "type": "object"
    },
    "PatternMatch": {
      "required": [
        "name",
        "score"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "regex": {
          "type": "string"
        },
        "score": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "PerformanceMetrics": {
      "type": "object",
      "properties": {
        "totalExecutions": {
          "type": "integer",
          "format": "int32"
        },
        "successRate": {
          "type": "number",
          "format": "double"
        },
        "averageLatencyMs": {
          "type": "number",
          "format": "double"
        },
        "p95LatencyMs": {
          "type": "number",
          "format": "double"
        },
        "p99LatencyMs": {
          "type": "number",
          "format": "double"
        },
        "averageCost": {
          "type": "number",
          "format": "double"
        },
        "totalCost": {
          "type": "number",
          "format": "double"
        },
        "currency": {
          "type": "string"
        },
        "lastExecutionAt": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "ProhibitedPractices": {
      "type": "object",
      "properties": {
        "subliminalManipulativeTechniques": {
          "type": "boolean"
        },
        "exploitationOfVulnerabilities": {
          "type": "boolean"
        },
        "socialScoringSystem": {
          "type": "boolean"
        },
        "riskAssessmentCriminalOffences": {
          "type": "boolean"
        },
        "facialRecognitionDatabaseCreation": {
          "type": "boolean"
        },
        "emotionInferenceWorkplaceEducation": {
          "type": "boolean"
        },
        "biometricCategorisation": {
          "type": "boolean"
        },
        "realTimeBiometricIdentification": {
          "type": "boolean"
        }
      }
    },
    "QualityMetrics": {
      "type": "object",
      "properties": {
        "answerRelevancy": {
          "type": "number",
          "format": "double"
        },
        "contextPrecision": {
          "type": "number",
          "format": "double"
        },
        "faithfulness": {
          "type": "number",
          "format": "double"
        },
        "hallucinationRate": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "RemediationAction": {
      "required": [
        "id",
        "label",
        "status"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "label": {
          "type": "string"
        },
        "frameworkRef": {
          "type": "string",
          "enum": [
            "EU_AI_Act",
            "Singapore_Model_AI_Governance",
            "Canada_AIDA",
            "US_AI_Bill_of_Rights",
            "NIST_AI_RMF",
            "ISO_IEC_42001",
            "UK_AI_Regulation",
            "China_AI_Regulations",
            "Custom"
          ]
        },
        "controlCode": {
          "type": "string"
        },
        "assignee": {
          "$ref": "#/$defs/EntityReference"
        },
        "dueDate": {
          "type": "integer",
          "format": "int64"
        },
        "priority": {
          "type": "string",
          "enum": [
            "High",
            "Medium",
            "Low"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "Open",
            "InProgress",
            "Done",
            "Deferred"
          ]
        },
        "createdAt": {
          "type": "integer",
          "format": "int64"
        },
        "createdBy": {
          "type": "string"
        },
        "completedAt": {
          "type": "integer",
          "format": "int64"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "RiskAssessment": {
      "type": "object",
      "properties": {
        "riskLevel": {
          "type": "string",
          "enum": [
            "Low",
            "Medium",
            "High",
            "Critical"
          ]
        },
        "riskFactors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mitigations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "assessedBy": {
          "type": "string"
        },
        "assessedAt": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "SafetyMetrics": {
      "type": "object",
      "properties": {
        "piiLeakageRate": {
          "type": "number",
          "format": "double"
        },
        "harmfulContentRate": {
          "type": "number",
          "format": "double"
        },
        "promptInjectionAttempts": {
          "type": "integer",
          "format": "int32"
        },
        "blockedRequests": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "ScopeAndDeployment": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string",
          "enum": [
            "Internal",
            "External",
            "Both"
          ]
        },
        "deploymentRegions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "affectedUserCount": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "SelectionCriteria": {
      "type": "object",
      "properties": {
        "queryTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "maxTokens": {
          "type": "integer",
          "format": "int32"
        },
        "costThreshold": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "Style": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "iconURL": {
          "type": "string"
        },
        "coverImage": {
          "$ref": "#/$defs/CoverImage"
        }
      }
    },
    "TagLabel": {
      "required": [
        "labelType",
        "source",
        "state",
        "tagFQN"
      ],
      "type": "object",
      "properties": {
        "tagFQN": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "style": {
          "$ref": "#/$defs/Style"
        },
        "source": {
          "type": "string",
          "enum": [
            "Classification",
            "Glossary"
          ]
        },
        "labelType": {
          "type": "string",
          "enum": [
            "Manual",
            "Propagated",
            "Automated",
            "Derived",
            "Generated"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "Suggested",
            "Confirmed"
          ]
        },
        "href": {
          "type": "string",
          "format": "uri"
        },
        "reason": {
          "type": "string"
        },
        "appliedAt": {
          "type": "string",
          "format": "date-time"
        },
        "appliedBy": {
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/TagLabelMetadata"
        }
      }
    },
    "TagLabelMetadata": {
      "type": "object",
      "properties": {
        "recognizer": {
          "$ref": "#/$defs/TagLabelRecognizerMetadata"
        },
        "expiryDate": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "TagLabelRecognizerMetadata": {
      "required": [
        "recognizerId",
        "recognizerName",
        "score"
      ],
      "type": "object",
      "properties": {
        "recognizerId": {
          "type": "string",
          "format": "uuid"
        },
        "recognizerName": {
          "type": "string"
        },
        "score": {
          "type": "number",
          "format": "double"
        },
        "target": {
          "type": "string",
          "enum": [
            "content",
            "column_name"
          ]
        },
        "patterns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PatternMatch"
          }
        }
      }
    },
    "TransparencyObligations": {
      "type": "object",
      "properties": {
        "usersInformed": {
          "type": "boolean"
        },
        "deepfakeLabeling": {
          "type": "boolean"
        },
        "emotionRecognitionDisclosure": {
          "type": "boolean"
        }
      }
    },
    "Verification": {
      "type": "object",
      "properties": {
        "isVerified": {
          "type": "boolean"
        },
        "verifiedBy": {
          "type": "string"
        },
        "verifiedAt": {
          "type": "integer",
          "format": "int64"
        },
        "verificationNotes": {
          "type": "string"
        },
        "certificateUrl": {
          "type": "string"
        }
      }
    }
  }
}