openapi: 3.1.0 info: title: Dexwize intelligence-service version: 1.0.0 description: >- WP10 (ADR-0032). E18 change impact and canary go or no-go; E19 conflict knowledge graph (opt-in, shared SaaS only); E20 security tool rationalization, software metering, hardware refresh planning and productivity value. Every endpoint is tenant-scoped through the caller's token except POST /v1/change-impact/external, which authenticates with a tenant-scoped change token in the X-Change-Token header. security: - bearer: [] paths: /v1/change-impact/changes: get: summary: Change groups derived from inventory diffs plus external change events (last 30 days) operationId: listChanges responses: '200': description: Change groups, newest first content: application/json: schema: type: array items: $ref: '#/components/schemas/ChangeGroup' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/changes/{key}/impact: get: summary: Stored impact results for a change group operationId: getImpact parameters: - $ref: '#/components/parameters/Key' responses: '200': description: Results per metric content: application/json: schema: type: array items: $ref: '#/components/schemas/ImpactResult' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/changes/{key}/evaluate: post: summary: Difference-in-differences impact of a change against matched unchanged devices operationId: evaluateImpact parameters: - $ref: '#/components/parameters/Key' requestBody: content: application/json: schema: type: object properties: metrics: type: array items: $ref: '#/components/schemas/Metric' responses: '200': description: Results per metric (stored) content: application/json: schema: type: array items: $ref: '#/components/schemas/ImpactResult' '400': description: Unknown metric '404': description: No such change group for this tenant '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/canary: post: summary: Canary versus control go or no-go operationId: evaluateCanary requestBody: required: true content: application/json: schema: type: object description: Either changeKey, or canaryDevices with effectiveAt. properties: changeKey: type: - string - 'null' canaryDevices: type: - array - 'null' maxItems: 10000 items: type: string format: uuid effectiveAt: type: - string - 'null' format: date-time metrics: type: - array - 'null' items: $ref: '#/components/schemas/Metric' responses: '200': description: Decision with per-metric evidence content: application/json: schema: $ref: '#/components/schemas/CanaryEvaluation' '400': description: Invalid request '404': description: No such change group '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/tokens: get: summary: Change tokens of the tenant (never the secrets) operationId: listChangeTokens responses: '200': description: Tokens content: application/json: schema: type: array items: $ref: '#/components/schemas/ChangeToken' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } post: summary: Create a change token; the secret is returned once operationId: createChangeToken requestBody: required: true content: application/json: schema: type: object required: - name properties: name: type: string maxLength: 100 responses: '201': description: Created; store the token now, it is never shown again content: application/json: schema: type: object required: - id - name - token properties: id: type: string format: uuid name: type: string token: type: string '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/tokens/{id}: delete: summary: Revoke a change token operationId: revokeChangeToken parameters: - name: id in: path required: true schema: type: string format: uuid responses: '204': description: Revoked '404': description: Not found or already revoked '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/change-impact/external: post: summary: External change events (Intune, GPO, update rings) pushed with a change token operationId: ingestExternalChanges security: [] parameters: - name: X-Change-Token in: header required: true schema: type: string requestBody: required: true content: application/json: schema: type: object required: - source - target - deviceIds - effectiveAt properties: source: type: string enum: - intune - gpo - update_ring - sccm - jamf - other target: type: string maxLength: 200 version: type: - string - 'null' maxLength: 100 deviceIds: type: array minItems: 1 maxItems: 10000 items: type: string format: uuid effectiveAt: type: string format: date-time responses: '202': description: Accepted (idempotent per device and change) content: application/json: schema: type: object properties: accepted: type: integer '400': description: Invalid body '401': description: Missing, unknown or revoked token '429': description: Rate limited /v1/knowledge-graph/settings: get: summary: Whether the tenant contributes to the knowledge graph operationId: getGraphSettings responses: '200': description: Opt-in state content: application/json: schema: $ref: '#/components/schemas/OptIn' put: summary: Opt in or out (TenantManage; audited) operationId: setGraphSettings requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/OptIn' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/OptIn' /v1/knowledge-graph/contribute: post: summary: Contribute the tenant's anonymized combinations (opted-in shared SaaS tenants only) operationId: contributeToGraph responses: '200': description: Outcome; refused contributions explain why content: application/json: schema: type: object required: - contributed - reason - nodes properties: contributed: type: boolean reason: type: string nodes: type: integer /v1/knowledge-graph/matches: get: summary: Known-bad combinations from the graph that are present in the caller's own fleet operationId: listGraphMatches responses: '200': description: Matches with the caller's own device counts content: application/json: schema: type: array items: type: object properties: node: $ref: '#/components/schemas/PublishedNode' yourDevices: type: integer /v1/rationalization/security: get: summary: Security agent overhead and overlap with licence savings where prices are set operationId: getSecurityRationalization parameters: - $ref: '#/components/parameters/Days' responses: '200': description: Report content: application/json: schema: $ref: '#/components/schemas/SecurityReport' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/metering/unused: get: summary: Installed applications not used in the last N days (per device; departments of at least five devices) operationId: getUnusedLicences parameters: - $ref: '#/components/parameters/Days' responses: '200': description: Report content: application/json: schema: $ref: '#/components/schemas/MeteringReport' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/refresh/plan: get: summary: Upgrade, keep or replace per device, only when the data supports it operationId: getRefreshPlan parameters: - $ref: '#/components/parameters/Days' responses: '200': description: One recommendation per device content: application/json: schema: type: array items: $ref: '#/components/schemas/RefreshRecommendation' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/value/productivity: get: summary: Hours and money lost per department as low-high ranges operationId: getProductivityValue parameters: - $ref: '#/components/parameters/Days' responses: '200': description: Report content: application/json: schema: $ref: '#/components/schemas/ProductivityReport' '400': description: days outside 1-90 '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/value/fixes: get: summary: Value of verified fixes (recommendation-service before and after measurements) operationId: getFixValues responses: '200': description: Value per verified fix content: application/json: schema: type: array items: $ref: '#/components/schemas/FixValue' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/value/assumptions: get: summary: The tenant's value assumptions (defaults until changed) operationId: getValueAssumptions responses: '200': description: Assumptions content: application/json: schema: $ref: '#/components/schemas/ValueAssumptions' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } put: summary: Change value assumptions (TenantManage; audited) operationId: setValueAssumptions requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ValueAssumptions' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/ValueAssumptions' '400': description: Invalid assumptions '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/value/prices: get: summary: Per-seat monthly prices the tenant entered operationId: getSeatPrices responses: '200': description: Prices content: application/json: schema: $ref: '#/components/schemas/SeatPrices' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } put: summary: Set per-seat prices (TenantManage; audited) operationId: setSeatPrices requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SeatPrices' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/SeatPrices' '400': description: Invalid prices '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/predictions: get: summary: Raised failure forecasts (disk, battery, blue-screen recurrence) over the horizon (Enterprise feature predictive_failure) operationId: listPredictions responses: '200': description: Forecasts with their probability, basis and reasons content: application/json: schema: $ref: '#/components/schemas/PredictionsView' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/predictions/notify: post: summary: Send failure_predicted notifications for raised forecasts, at most once per device, component and ISO week operationId: notifyPredictions responses: '200': description: Counts of raised and sent forecasts content: application/json: schema: $ref: '#/components/schemas/ForecastNotification' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/sustainability: get: summary: Energy, emissions and life-extension carbon avoided as low-high ranges (Enterprise feature sustainability_reporting) operationId: getSustainability parameters: - name: days in: query description: Measurement window for active hours, clamped to 7-180 schema: type: integer default: 30 responses: '200': description: Report with every assumption and the method content: application/json: schema: $ref: '#/components/schemas/SustainabilityReport' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/sustainability/assumptions: get: summary: The tenant's sustainability assumptions (published defaults until changed) operationId: getSustainabilityAssumptions responses: '200': description: Assumptions content: application/json: schema: $ref: '#/components/schemas/SustainabilityAssumptions' '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } put: summary: Change sustainability assumptions (TenantManage; validated and audited) operationId: setSustainabilityAssumptions requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SustainabilityAssumptions' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/SustainabilityAssumptions' '400': description: Invalid assumptions '403': { $ref: '#/components/responses/FeatureNotEntitled' } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/benchmarks: get: summary: The tenant against anonymized peer percentiles (opted-in shared SaaS tenants only) operationId: getBenchmarks responses: '200': description: Published peer cells that match the tenant fleet; unavailable views explain why content: application/json: schema: $ref: '#/components/schemas/BenchmarkView' /v1/benchmarks/contribute: post: summary: Contribute the tenant percentiles per device model and OS (uses the knowledge graph opt-in) operationId: contributeBenchmarks responses: '200': description: Outcome; refused contributions explain why content: application/json: schema: type: object required: - contributed - reason - nodes properties: contributed: type: boolean reason: type: string nodes: type: integer description: Number of cells contributed /v1/warranty/consent: get: summary: Vendors the tenant consented to send device serials to operationId: getWarrantyConsent responses: '200': description: Consent content: application/json: schema: $ref: '#/components/schemas/WarrantyConsent' put: summary: Set warranty consent (tenant admin; refused on air-gapped installations) operationId: setWarrantyConsent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WarrantyConsent' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/WarrantyConsent' '400': description: Not allowed on this installation /v1/warranty/lookup: post: summary: Look up warranties; serials are used for the vendor call only and stored as tenant-salted hashes operationId: lookupWarranties requestBody: required: true content: application/json: schema: type: object required: - items properties: items: type: array minItems: 1 maxItems: 200 items: type: object required: - deviceId - manufacturer - serial properties: deviceId: type: string format: uuid manufacturer: type: string serial: type: string maxLength: 32 responses: '200': description: Counts per outcome content: application/json: schema: type: object properties: requested: type: integer found: type: integer notFound: type: integer refused: type: integer problems: type: array items: type: string '400': description: Batch too large or air-gapped installation /v1/warranty: get: summary: Stored warranty results (serial hashes only) operationId: listWarranties responses: '200': description: One record per device content: application/json: schema: type: array items: $ref: '#/components/schemas/WarrantyRecord' components: securitySchemes: bearer: type: http scheme: bearer bearerFormat: JWT parameters: Key: name: key in: path required: true schema: type: string Days: name: days in: query schema: type: integer minimum: 1 maximum: 90 responses: FeatureNotEntitled: description: The caller lacks the permission (empty body), or the tenant's plan, add-ons, licence and overrides do not include the feature (error feature_not_entitled, ADR-0053). content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } EntitlementsUnavailable: description: The tenant's entitlements could not be confirmed and nothing usable was cached, so the paid feature is refused (fail closed, ADR-0053). Retry-After is set. content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } schemas: EntitlementRefusal: description: Module licensing refusal (ADR-0053). type: object required: [error, feature] properties: error: { type: string, enum: [feature_not_entitled, entitlements_unavailable] } feature: { type: string, description: Catalogue feature code, for example query } WarrantyVendor: type: string enum: - Dell - Hp - Lenovo WarrantyConsent: type: object required: - vendors properties: vendors: type: array items: $ref: '#/components/schemas/WarrantyVendor' WarrantyRecord: type: object properties: deviceId: type: string format: uuid serialHash: type: string vendor: $ref: '#/components/schemas/WarrantyVendor' shipDate: type: - string - 'null' format: date endDate: type: - string - 'null' format: date serviceLevel: type: - string - 'null' checkedAt: type: string format: date-time Percentiles: type: object properties: p25: type: number p50: type: number p75: type: number p90: type: number PublishedBenchmark: type: object description: Anonymized peer cell; at least 5 tenants and 50 devices, no tenant identity. properties: key: type: string metric: type: string enum: - boot_s - crashes_per_day - experience_score model: type: string osBuild: type: string tenantBucket: type: string enum: - 5-9 - 10-24 - 25+ devicesAtLeast: type: integer values: $ref: '#/components/schemas/Percentiles' publishedAt: type: string format: date-time BenchmarkView: type: object required: - available - reason - cells properties: available: type: boolean reason: type: string cells: type: array items: type: object properties: metric: type: string model: type: string osBuild: type: string yourDevices: type: integer yourMedian: type: number peers: $ref: '#/components/schemas/PublishedBenchmark' position: type: string enum: - top_quartile - middle - bottom_quartile Metric: type: string enum: - boot_s - crashes_per_day - hangs_per_day - cpu_percent SecurityReport: type: object properties: devices: type: integer avgSecurityCpuPercent: type: number avgSecurityMemoryMb: type: number products: type: array items: type: object properties: product: type: string category: type: string devices: type: integer avgCpuPercent: type: number avgMemoryMb: type: number overlaps: type: array items: type: object properties: category: type: string devicesWithOverlap: type: integer products: type: array items: type: string retirementCandidate: type: - string - 'null' monthlySavings: type: - number - 'null' totalMonthlySavings: type: - number - 'null' currency: type: string MeteringReport: type: object properties: unusedDays: type: integer windowCoversPeriod: type: boolean apps: type: array items: type: object properties: app: type: string installedDevices: type: integer unusedDevices: type: integer monthlyReclaimValue: type: - number - 'null' departments: type: array description: Departments under five devices are merged into Other (k-anonymity). items: type: object properties: department: type: string devices: type: integer unusedInstalls: type: integer totalMonthlyReclaimValue: type: - number - 'null' currency: type: string RefreshRecommendation: type: object properties: deviceId: type: string format: uuid model: type: - string - 'null' action: type: string enum: - Keep - Upgrade - Replace - InsufficientData ageMonths: type: - integer - 'null' reasons: type: array items: type: string ProductivityReport: type: object properties: currency: type: string departments: type: array items: type: object properties: department: type: string devices: type: integer hoursPerMonth: $ref: '#/components/schemas/ValueRange' costPerMonth: $ref: '#/components/schemas/ValueRange' bootHours: $ref: '#/components/schemas/ValueRange' crashHours: $ref: '#/components/schemas/ValueRange' hangHours: $ref: '#/components/schemas/ValueRange' totalHoursPerMonth: $ref: '#/components/schemas/ValueRange' totalCostPerMonth: $ref: '#/components/schemas/ValueRange' assumptions: $ref: '#/components/schemas/ValueAssumptions' FixValue: type: object properties: recommendationId: type: string format: uuid title: type: string metric: type: string devices: type: integer hoursSavedPerMonth: $ref: '#/components/schemas/ValueRange' costSavedPerMonth: $ref: '#/components/schemas/ValueRange' ChangeGroup: type: object properties: key: type: string kind: type: string target: type: string toVersion: type: - string - 'null' source: type: string devices: type: integer firstSeen: type: string format: date-time lastSeen: type: string format: date-time ImpactResult: type: object properties: changeKey: type: string metric: $ref: '#/components/schemas/Metric' verdict: type: string enum: - InsufficientData - Inconclusive - NoEffect - Improvement - Regression treatedDevices: type: integer controlDevices: type: integer baseline: type: - number - 'null' effect: type: - number - 'null' ciLower: type: - number - 'null' ciUpper: type: - number - 'null' relativeEffect: type: - number - 'null' reason: type: string CanaryEvaluation: type: object properties: changeKey: type: string decision: type: string enum: - Go - NoGo - Hold metrics: type: array items: $ref: '#/components/schemas/ImpactResult' reason: type: string ChangeToken: type: object properties: id: type: string format: uuid name: type: string createdAt: type: string format: date-time createdBy: type: string revokedAt: type: - string - 'null' format: date-time OptIn: type: object required: - optIn properties: optIn: type: boolean PublishedNode: type: object description: Anonymized; no tenant identity of any kind. properties: key: type: string apps: type: array items: type: string tenantBucket: type: string enum: - 5-9 - 10-24 - 25+ devicesAtLeast: type: integer crashRateMedian: type: number knownBad: type: boolean publishedAt: type: string format: date-time ValueRange: type: object required: - low - high properties: low: type: number minimum: 0 high: type: number minimum: 0 ValueAssumptions: type: object properties: currency: type: string minLength: 3 maxLength: 3 hourlyCost: $ref: '#/components/schemas/ValueRange' bootTargetSeconds: type: number bootsPerDay: $ref: '#/components/schemas/ValueRange' minutesLostPerCrash: $ref: '#/components/schemas/ValueRange' minutesLostPerHang: $ref: '#/components/schemas/ValueRange' workdaysPerMonth: type: integer minimum: 1 maximum: 31 SeatPrices: type: object required: - currency - perSeatMonthly properties: currency: type: string minLength: 3 maxLength: 3 perSeatMonthly: type: object additionalProperties: type: number minimum: 0 FailurePrediction: type: object required: [deviceId, component, probability, basis, points, reasons] properties: deviceId: type: string format: uuid component: type: string enum: [Disk, Battery, BlueScreen] probability: type: number basis: type: string description: "smart_predicted_failure, threshold_reached, wear_trend or recurrence_rate" estimatedDaysToFailure: type: [number, 'null'] daysLow: type: [number, 'null'] daysHigh: type: [number, 'null'] points: type: integer reasons: type: array items: type: string PredictionsView: type: object required: [horizonDays, predictions] properties: horizonDays: type: integer predictions: type: array items: $ref: '#/components/schemas/FailurePrediction' ForecastNotification: type: object required: [raised, sent] properties: raised: type: integer sent: type: integer PowerProfile: type: object properties: activeWatts: $ref: '#/components/schemas/ValueRange' idleWatts: $ref: '#/components/schemas/ValueRange' sleepWatts: $ref: '#/components/schemas/ValueRange' embodiedKgCo2e: $ref: '#/components/schemas/ValueRange' SustainabilityAssumptions: type: object description: "Every figure is a low-high range; gridFactorSource cites the grid emission factor (an assumption to verify)." properties: profiles: type: object additionalProperties: $ref: '#/components/schemas/PowerProfile' activeHoursPerDay: $ref: '#/components/schemas/ValueRange' idleHoursPerDay: $ref: '#/components/schemas/ValueRange' workdaysPerYear: type: integer gridKgCo2ePerKwh: $ref: '#/components/schemas/ValueRange' gridFactorSource: type: string usefulLifeYears: $ref: '#/components/schemas/ValueRange' lifeExtensionYears: $ref: '#/components/schemas/ValueRange' upgradePartsKgCo2e: $ref: '#/components/schemas/ValueRange' minMeasuredDays: type: integer minGroupSize: type: integer SustainabilityGroup: type: object properties: department: type: string devices: type: integer energyKwhPerYear: $ref: '#/components/schemas/ValueRange' kgCo2ePerYear: $ref: '#/components/schemas/ValueRange' SustainabilityReport: type: object required: [devices, energyKwhPerYear, kgCo2ePerYear, assumptions, method] properties: devices: type: integer measuredDevices: type: integer energyKwhPerYear: $ref: '#/components/schemas/ValueRange' kgCo2ePerYear: $ref: '#/components/schemas/ValueRange' devicesExtendedByUpgrade: type: integer kgCo2eAvoidedByLifeExtension: $ref: '#/components/schemas/ValueRange' departments: type: array items: $ref: '#/components/schemas/SustainabilityGroup' devicesByClass: type: object additionalProperties: type: integer assumptions: $ref: '#/components/schemas/SustainabilityAssumptions' method: type: array items: type: string