openapi: 3.1.0 info: title: Dexwize employee IT agent version: 1.0.0 description: > Arabic-first employee IT agent in Microsoft Teams (E32, ADR-0038). The Bot Framework posts activities to /api/messages with a Bot Framework token; the agent diagnoses the employee's own devices, offers only library self-help actions the tenant allows (run through remediation-service, so autonomy and approval rules apply) and otherwise opens a ticket through integration-service. Message content is not kept unless a tenant admin sets a retention of 1 to 30 days; audit records hold outcomes only. servers: - url: https://api.dexwize.example security: - bearer: [] paths: /api/messages: post: summary: Bot Framework messaging endpoint description: 'Requires a Bot Framework token (issuer https://api.botframework.com, audience the bot app id, serviceurl claim equal to the activity serviceUrl). The reply is sent to the Bot Connector, not returned.' operationId: postBotActivity security: - botFramework: [] requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Activity' } responses: '202': { description: Accepted; any reply goes to the conversation } '400': { description: Service URL not allowed or no conversation } '401': { description: Missing or invalid Bot Framework token } /v1/agent/settings: get: summary: Agent settings for the tenant (TenantManage) operationId: getAgentSettings responses: '200': description: Settings; defaults when never saved (disabled, Arabic, retention 0) content: application/json: schema: { $ref: '#/components/schemas/Settings' } '403': description: "Missing TenantManage, or the tenant is not entitled to employee_it_agent (error feature_not_entitled)" content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } put: summary: Replace the agent settings (TenantManage; audited) operationId: saveAgentSettings requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/SettingsRequest' } responses: '200': description: Saved content: application/json: schema: { $ref: '#/components/schemas/Settings' } '400': { description: 'Unknown action, retention out of range, missing or already linked Entra tenant' } '403': description: "Missing TenantManage, or the tenant is not entitled to employee_it_agent (error feature_not_entitled)" content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/agent/actions: get: summary: Self-help actions an admin may allow (TenantManage) operationId: listAgentActions responses: '200': description: Library actions with English and Arabic titles content: application/json: schema: type: array items: type: object required: [id, titleEn, titleAr] properties: id: { type: string } titleEn: { type: string } titleAr: { type: string } '403': description: "Missing permission, or the tenant is not entitled to employee_it_agent (error feature_not_entitled)" content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/agent/teams-app: get: summary: The Teams app package in the tenant's brand (TenantManage; ADR-0049) description: >- A zip with manifest.json and ar.json rendered for the caller's tenant: a white-label partner's tenant gets its partner's product name in every string; other tenants get the default product name. The Teams administrator adds the two icons and uploads the package. operationId: getAgentTeamsApp responses: '200': description: The app package content: application/zip: schema: type: string format: binary '403': description: "Missing permission, or the tenant is not entitled to employee_it_agent (error feature_not_entitled)" content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } /v1/agent/device-owners: put: summary: Replace the employee-to-device map (TenantManage; audited) operationId: replaceAgentDeviceOwners requestBody: required: true content: application/json: schema: type: array maxItems: 50000 items: type: object required: [userObjectId, deviceId, deviceName] properties: userObjectId: { type: string, format: uuid, description: Entra object id of the primary user } deviceId: { type: string, format: uuid } deviceName: { type: string, minLength: 1, maxLength: 100 } responses: '200': description: Rows stored content: application/json: schema: type: object required: [count] properties: count: { type: integer } '400': { description: Too many rows or invalid device names } '409': { description: Owners come from the enrollment-service device-to-employee mapping (ADR-0041) } '403': description: "Missing permission, or the tenant is not entitled to employee_it_agent (error feature_not_entitled)" content: { application/json: { schema: { $ref: '#/components/schemas/EntitlementRefusal' } } } '503': { $ref: '#/components/responses/EntitlementsUnavailable' } components: responses: 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' } } } securitySchemes: bearer: { type: http, scheme: bearer, bearerFormat: JWT } botFramework: { type: http, scheme: bearer, bearerFormat: JWT, description: Token issued by the Bot Framework } 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 campaigns } Account: type: object properties: id: { type: [string, 'null'] } name: { type: [string, 'null'] } aadObjectId: { type: [string, 'null'] } Activity: type: object required: [type, serviceUrl, conversation] properties: type: { type: string, description: Only message activities are answered } id: { type: [string, 'null'] } serviceUrl: { type: string, format: uri } channelId: { type: [string, 'null'] } text: { type: [string, 'null'], maxLength: 2000 } locale: { type: [string, 'null'] } from: { $ref: '#/components/schemas/Account' } recipient: { $ref: '#/components/schemas/Account' } conversation: type: object properties: id: { type: string } conversationType: { type: [string, 'null'] } tenantId: { type: [string, 'null'] } channelData: type: object properties: tenant: type: object properties: id: { type: [string, 'null'] } SettingsRequest: type: object required: [enabled, defaultLanguage, messageRetentionDays, useModel] properties: enabled: { type: boolean } entraTenantId: { type: [string, 'null'], format: uuid, description: Required to enable } defaultLanguage: { type: string, enum: [Arabic, English] } allowedActions: { type: array, items: { type: string } } messageRetentionDays: { type: integer, minimum: 0, maximum: 30, default: 0 } useModel: { type: boolean, description: 'Let a configured model reword replies; output is validated and falls back to templates' } Settings: allOf: - $ref: '#/components/schemas/SettingsRequest' - type: object required: [allowedActions, updatedAt, updatedBy] properties: updatedAt: { type: string, format: date-time } updatedBy: { type: string }