هذه الصفحة غير متاحة بالعربية بعد، وتُعرض بالإنجليزية.
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
| Method | Path | Summary |
|---|---|---|
POST | /v1/insights/explanations | Explain findings (FindingsRead) |
POST | /v1/insights/investigations | Answer a natural-language question from query-service rows (FindingsRead) |
GET | /v1/insights/investigations/templates | Query templates offered when AI is unavailable (FindingsRead) |
POST | /v1/insights/report-sections | Draft one report section (ReportsRead) |
GET | /v1/insights/reviews | Human review queue (InsightsReview) |
POST | /v1/insights/reviews/{id}/approve | approveReview |
POST | /v1/insights/reviews/{id}/edit | Replace the draft with reviewer text (must cite the item's findings; no URLs or commands) |
POST | /v1/insights/reviews/{id}/reject | rejectReview |
PUT | /v1/insights/settings | Enable or disable AI and set the token cap and review threshold (TenantManage) |
GET | /v1/insights/usage | AI token usage this month (TenantRead) |
POST /v1/insights/explanations
Explain findings (FindingsRead)
Request body: object (JSON).
| Status | Description | Body |
|---|---|---|
| 200 | OK | InsightResponse |
| 400 | No ids or too many ids | |
| 403 | Missing FindingsRead | |
| 404 | A 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).
| Status | Description | Body |
|---|---|---|
| 200 | Answer, rows only, refusal or templates | InvestigationResult |
| 401 | No bearer token | |
| 403 | 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). | EntitlementRefusal |
| 502 | query-service failed | |
| 503 | 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. | EntitlementRefusal |
GET /v1/insights/investigations/templates
Query templates offered when AI is unavailable (FindingsRead)
| Status | Description | Body |
|---|---|---|
| 200 | OK | QueryTemplate[] |
| 403 | 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). | EntitlementRefusal |
| 503 | 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. | EntitlementRefusal |
POST /v1/insights/report-sections
Draft one report section (ReportsRead)
Request body: object (JSON).
| Status | Description | Body |
|---|---|---|
| 200 | OK | InsightResponse |
| 400 | Invalid ids, or a recommendation whose finding is not included | |
| 404 | A finding or recommendation id is unknown or belongs to another tenant |
GET /v1/insights/reviews
Human review queue (InsightsReview)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
status | query | string | no |
| Status | Description | Body |
|---|---|---|
| 200 | OK | ReviewItem[] |
POST /v1/insights/reviews/{id}/approve
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | Approved | ReviewItem |
| 404 | Not found | |
| 409 | Already decided |
POST /v1/insights/reviews/{id}/edit
Replace the draft with reviewer text (must cite the item's findings; no URLs or commands)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body: object (JSON).
| Status | Description | Body |
|---|---|---|
| 200 | Edited | ReviewItem |
| 400 | Statement failed validation | |
| 404 | Not found | |
| 409 | Already decided |
POST /v1/insights/reviews/{id}/reject
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | Rejected | ReviewItem |
| 404 | Not found | |
| 409 | Already decided |
PUT /v1/insights/settings
Enable or disable AI and set the token cap and review threshold (TenantManage)
Request body: object (JSON).
| Status | Description | Body |
|---|---|---|
| 200 | Saved | AiSettings |
| 400 | Outside platform limits |
GET /v1/insights/usage
AI token usage this month (TenantRead)
| Status | Description | Body |
|---|---|---|
| 200 | OK | object |