إنتقل إلى المحتوى الرئيسي

هذه الصفحة غير متاحة بالعربية بعد، وتُعرض بالإنجليزية.

Dexwize Insight AI Service

Evidence-bound explanations and report drafts (ADR-0018). Callers pass finding and recommendation ids; the service loads them for the caller's tenant. Every statement cites finding ids and is validated before it is returned; rejected model output falls back to deterministic templates and a human-review item. All endpoints require a bearer token; ids of another tenant are indistinguishable from missing ids (404).

Version 1.0.0. Download the OpenAPI specification.

Authentication: bearer.

Operations​

MethodPathSummary
POST/v1/insights/explanationsExplain findings (FindingsRead)
POST/v1/insights/investigationsAnswer a natural-language question from query-service rows (FindingsRead)
GET/v1/insights/investigations/templatesQuery templates offered when AI is unavailable (FindingsRead)
POST/v1/insights/report-sectionsDraft one report section (ReportsRead)
GET/v1/insights/reviewsHuman review queue (InsightsReview)
POST/v1/insights/reviews/{id}/approveapproveReview
POST/v1/insights/reviews/{id}/editReplace the draft with reviewer text (must cite the item's findings; no URLs or commands)
POST/v1/insights/reviews/{id}/rejectrejectReview
PUT/v1/insights/settingsEnable or disable AI and set the token cap and review threshold (TenantManage)
GET/v1/insights/usageAI token usage this month (TenantRead)

POST /v1/insights/explanations​

Explain findings (FindingsRead)

Request body: object (JSON).

StatusDescriptionBody
200OKInsightResponse
400No ids or too many ids
403Missing FindingsRead
404A finding id is unknown or belongs to another tenant

POST /v1/insights/investigations​

Answer a natural-language question from query-service rows (FindingsRead)

The model turns the question into a structured plan (never SQL); the plan is validated against the query-service catalog and run through query-service with the caller's token, so the caller's tenant and permissions apply. Requests to change devices are refused before any model call. When AI is disabled, over budget or the output fails validation, the response carries rows only or query templates (ADR-0031).

Request body: object (JSON).

StatusDescriptionBody
200Answer, rows only, refusal or templatesInvestigationResult
401No bearer token
403The 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).EntitlementRefusal
502query-service failed
503The 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.EntitlementRefusal

GET /v1/insights/investigations/templates​

Query templates offered when AI is unavailable (FindingsRead)

StatusDescriptionBody
200OKQueryTemplate[]
403The 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).EntitlementRefusal
503The 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.EntitlementRefusal

POST /v1/insights/report-sections​

Draft one report section (ReportsRead)

Request body: object (JSON).

StatusDescriptionBody
200OKInsightResponse
400Invalid ids, or a recommendation whose finding is not included
404A finding or recommendation id is unknown or belongs to another tenant

GET /v1/insights/reviews​

Human review queue (InsightsReview)

ParameterInTypeRequiredDescription
statusquerystringno
StatusDescriptionBody
200OKReviewItem[]

POST /v1/insights/reviews/{id}/approve​

ParameterInTypeRequiredDescription
idpathstringyes
StatusDescriptionBody
200ApprovedReviewItem
404Not found
409Already decided

POST /v1/insights/reviews/{id}/edit​

Replace the draft with reviewer text (must cite the item's findings; no URLs or commands)

ParameterInTypeRequiredDescription
idpathstringyes

Request body: object (JSON).

StatusDescriptionBody
200EditedReviewItem
400Statement failed validation
404Not found
409Already decided

POST /v1/insights/reviews/{id}/reject​

ParameterInTypeRequiredDescription
idpathstringyes
StatusDescriptionBody
200RejectedReviewItem
404Not found
409Already decided

PUT /v1/insights/settings​

Enable or disable AI and set the token cap and review threshold (TenantManage)

Request body: object (JSON).

StatusDescriptionBody
200SavedAiSettings
400Outside platform limits

GET /v1/insights/usage​

AI token usage this month (TenantRead)

StatusDescriptionBody
200OKobject