openapi: 3.1.0 info: title: Dexwize Operator Console API version: 1.0.0 description: > Vendor (NewTurn) operations backend (E25). Every /v1/ops route requires PlatformOperate, which requires a non-JIT platform-tenant session; anyone else receives 403. Downstream calls (tenant-service, identity-service, enrollment-service) forward the operator's own token so each service re-checks authorization. Every write is audited in the platform tenant's chain, and offboarding steps also in the customer's chain. servers: - url: https://ops.dexwize.example security: - bearer: [] paths: /v1/ops/tenants: post: summary: Create a tenant through tenant-service operationId: opsCreateTenant requestBody: required: true content: application/json: schema: type: object required: - name - deploymentModel - region - planId properties: name: type: string deploymentModel: type: string region: type: string planId: type: string partnerId: type: - string - 'null' format: uuid responses: '200': description: Created tenant as returned by tenant-service content: application/json: schema: type: object additionalProperties: true description: Tenant as returned by tenant-service (tenant-service.v1.yaml, Tenant) '403': description: Not a platform session /v1/ops/tenants/{id}/suspend: post: operationId: opsSuspendTenant parameters: - $ref: '#/components/parameters/Id' responses: '204': description: Suspended '404': description: Not found /v1/ops/tenants/{id}/offboarding: post: summary: Request offboarding with verified data deletion operationId: requestOffboarding parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: - reason properties: reason: type: string maxLength: 1000 responses: '201': description: Requested content: application/json: schema: $ref: '#/components/schemas/Offboarding' /v1/ops/offboarding: get: operationId: listOffboarding responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Offboarding' /v1/ops/offboarding/{id}: get: operationId: getOffboarding parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Offboarding' '404': description: Not found /v1/ops/offboarding/{id}/approve: post: summary: Approve (two-person rule; the requester cannot approve) operationId: approveOffboarding parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Approved content: application/json: schema: $ref: '#/components/schemas/Offboarding' '400': description: Wrong state '409': description: self_approval_refused /v1/ops/offboarding/{id}/reject: post: operationId: rejectOffboarding parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Rejected content: application/json: schema: $ref: '#/components/schemas/Offboarding' /v1/ops/offboarding/{id}/execute: post: summary: Suspend the tenant and run every deletion step; Completed only when every store is verified empty operationId: executeOffboarding parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Completed (with evidence) or Failed (retryable) content: application/json: schema: $ref: '#/components/schemas/Offboarding' '400': description: Not approved /v1/ops/support/access-requests: post: summary: Request JIT access to a customer tenant (forwarded to identity-service) operationId: requestJit requestBody: required: true content: application/json: schema: type: object required: - tenantId - reason - durationMinutes properties: tenantId: type: string format: uuid reason: type: string maxLength: 500 durationMinutes: type: integer minimum: 1 maximum: 240 responses: '200': description: Grant as returned by identity-service content: application/json: schema: type: object additionalProperties: true description: JIT grant as returned by identity-service (identity-service.v1.yaml, JitGrant) /v1/ops/support/access-requests/{id}/approve: post: operationId: approveJit parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Approved content: application/json: schema: type: object additionalProperties: true description: JIT grant as returned by identity-service (identity-service.v1.yaml, JitGrant) '404': description: Not found /v1/ops/releases: get: summary: Agent releases and rings (enrollment-service) operationId: listReleases responses: '200': description: OK content: application/json: schema: type: array items: type: object additionalProperties: true description: Release as returned by enrollment-service (enrollment-service.v1.yaml, Release) /v1/ops/releases/{id}/promote: post: operationId: promoteRelease parameters: - $ref: '#/components/parameters/Id' summary: Advance the release one stage (internal, pilot, ten_percent, all); passthrough to enrollment-service responses: '200': description: Promoted content: application/json: schema: type: object additionalProperties: true description: Release as returned by enrollment-service '404': description: Not found '409': description: Halted or already at all /v1/ops/releases/{id}/halt: post: operationId: haltRelease parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Halted content: application/json: schema: type: object additionalProperties: true description: Release as returned by enrollment-service /v1/ops/status/components: get: operationId: listComponents responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/StatusComponent' post: operationId: createComponent responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/StatusComponent' /v1/ops/status/components/{id}: put: operationId: updateComponent parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Saved content: application/json: schema: $ref: '#/components/schemas/StatusComponent' '404': description: Not found delete: operationId: deleteComponent parameters: - $ref: '#/components/parameters/Id' responses: '204': description: Removed /v1/ops/status/incidents: get: operationId: listIncidents responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Incident' post: operationId: openIncident responses: '201': description: Opened content: application/json: schema: $ref: '#/components/schemas/Incident' /v1/ops/status/incidents/{id}/updates: post: operationId: updateIncident parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Updated content: application/json: schema: $ref: '#/components/schemas/Incident' '400': description: Incident already resolved /v1/ops/kpis: get: summary: Revenue, retention, conversion and channel KPIs (docs/operations/kpis.md, definitions v1) description: > Computed on demand from subscription-service revenue facts (from 12 months before the window), partner-service channel attribution, tenant-service regions and the CRM funnel (CSV imports, then Zaatly). Amounts are per currency and never converted. A source that is not connected leaves its KPIs out; ratios with a zero denominator are null. operationId: getKpis parameters: - $ref: '#/components/parameters/KpiFrom' - $ref: '#/components/parameters/KpiTo' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/KpiReport' '400': description: Malformed window, an open month, or more than 24 months /v1/ops/kpis/export.csv: get: summary: The KPI report as CSV in long form (one value per row; formula-like text cells neutralised; audited) operationId: exportKpis parameters: - $ref: '#/components/parameters/KpiFrom' - $ref: '#/components/parameters/KpiTo' responses: '200': description: definitions_version, month, currency, metric, dimension, key, value content: text/csv: schema: type: string '400': description: Malformed window /v1/ops/kpis/crm-funnel/imports: get: summary: Accepted CRM funnel imports, newest first operationId: listCrmFunnelImports responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/CrmFunnelImport' post: summary: Import a CRM funnel export (format dexwize-crm-funnel/v1) description: > The CSV is the raw request body (text/csv, at most 256 KB, 5000 rows). Header exactly month, channel, source, leads, assessments, trials, won, won_after_trial in any order; any other column (for example a contact field) is refused, so only aggregate counts are stored. The whole file is accepted or refused; errors name the line. Replaces the stored rows of every month in the file. Audited. operationId: importCrmFunnel requestBody: required: true content: text/csv: schema: type: string responses: '201': description: Imported content: application/json: schema: $ref: '#/components/schemas/CrmFunnelImport' '400': description: Refused; errors.file lists the problems by line /v1/ops/kpis/crm-funnel/template.csv: get: summary: An example CRM funnel import file operationId: crmFunnelTemplate responses: '200': description: OK content: text/csv: schema: type: string /status.json: get: summary: Public status page data (anonymous, read-only, no internal identifiers or authors) operationId: publicStatus security: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PublicStatus' components: securitySchemes: bearer: type: http scheme: bearer bearerFormat: JWT parameters: Id: name: id in: path required: true schema: type: string format: uuid KpiFrom: name: from in: query description: First month (yyyy-MM); defaults to 11 months before 'to'. schema: type: string pattern: ^[0-9]{4}-[0-9]{2}$ KpiTo: name: to in: query description: Last month (yyyy-MM), which must have ended; defaults to last month. schema: type: string pattern: ^[0-9]{4}-[0-9]{2}$ schemas: Ratio: description: A ratio rounded to 4 decimals; null when its denominator is zero. type: - number - 'null' KpiShare: type: object required: [key, mrr, share] properties: key: type: string mrr: type: number share: $ref: '#/components/schemas/Ratio' CurrencyKpis: type: object required: [currency, mrr, arr, payingAccounts, arpa, devices, deviceGrowth, startingMrr, newMrr, reactivationMrr, expansionMrr, contractionMrr, churnedMrr, netNewMrr, grossRevenueRetention, netRevenueRetention, trailingGrossRevenueRetention, trailingNetRevenueRetention, partnerSourcedMrr, partnerSourcedShare, suspendedMrr, byPlan, byChannel, byRegion] properties: currency: type: string mrr: type: number arr: type: number payingAccounts: type: integer arpa: type: - number - 'null' devices: type: integer deviceGrowth: $ref: '#/components/schemas/Ratio' startingMrr: type: number newMrr: type: number reactivationMrr: type: number expansionMrr: type: number contractionMrr: type: number churnedMrr: type: number netNewMrr: type: number grossRevenueRetention: $ref: '#/components/schemas/Ratio' netRevenueRetention: $ref: '#/components/schemas/Ratio' trailingGrossRevenueRetention: $ref: '#/components/schemas/Ratio' trailingNetRevenueRetention: $ref: '#/components/schemas/Ratio' partnerSourcedMrr: type: number partnerSourcedShare: $ref: '#/components/schemas/Ratio' suspendedMrr: type: number byPlan: type: array items: $ref: '#/components/schemas/KpiShare' byChannel: type: array items: $ref: '#/components/schemas/KpiShare' byRegion: description: Null when tenant-service regions are not connected. type: - array - 'null' items: $ref: '#/components/schemas/KpiShare' LogoKpis: type: object required: [starting, new, reactivated, churned, ending, churnRate] properties: starting: type: integer new: type: integer reactivated: type: integer churned: type: integer ending: type: integer churnRate: $ref: '#/components/schemas/Ratio' MonthKpis: type: object required: [month, currencies, logos] properties: month: type: string currencies: type: array items: $ref: '#/components/schemas/CurrencyKpis' logos: $ref: '#/components/schemas/LogoKpis' CohortRow: type: object required: [cohort, currency, size, startingMrr, logoRetention, revenueRetention] properties: cohort: type: string currency: type: string size: type: integer startingMrr: type: number logoRetention: type: array items: $ref: '#/components/schemas/Ratio' revenueRetention: type: array items: $ref: '#/components/schemas/Ratio' FunnelMonth: type: object required: [month, leads, assessments, trials, won, wonAfterTrial, leadToAssessment, assessmentToPaid, trialToPaid, leadToPaid, byChannel] properties: month: type: string leads: type: integer assessments: type: integer trials: type: integer won: type: integer wonAfterTrial: type: integer leadToAssessment: $ref: '#/components/schemas/Ratio' assessmentToPaid: $ref: '#/components/schemas/Ratio' trialToPaid: $ref: '#/components/schemas/Ratio' leadToPaid: $ref: '#/components/schemas/Ratio' byChannel: type: array items: type: object required: [channel, leads, assessments, won, leadToPaid] properties: channel: type: string leads: type: integer assessments: type: integer won: type: integer leadToPaid: $ref: '#/components/schemas/Ratio' KpiSourceState: enum: - Connected - NotConnected - Failed KpiReport: type: object required: [definitionsVersion, from, to, generatedAt, sources, months, cohorts, funnel, topPartners, dataQuality] properties: definitionsVersion: type: string from: type: string to: type: string generatedAt: type: string format: date-time sources: type: object required: [billing, channel, regions, crm, crmOrigin, historyStartedAt] properties: billing: $ref: '#/components/schemas/KpiSourceState' channel: $ref: '#/components/schemas/KpiSourceState' regions: $ref: '#/components/schemas/KpiSourceState' crm: $ref: '#/components/schemas/KpiSourceState' crmOrigin: enum: - none - import - zaatly - import+zaatly historyStartedAt: type: - string - 'null' format: date-time months: type: array items: $ref: '#/components/schemas/MonthKpis' cohorts: type: array items: $ref: '#/components/schemas/CohortRow' funnel: description: Null when no CRM source is connected. type: - array - 'null' items: $ref: '#/components/schemas/FunnelMonth' topPartners: type: array items: type: object required: [partnerId, name, channel, currency, mrr] properties: partnerId: type: string format: uuid name: type: string channel: type: string currency: type: string mrr: type: number dataQuality: type: array items: type: object required: [code, severity, month, count, message] properties: code: type: string severity: enum: - Exception - Warning month: type: string count: type: integer message: type: string CrmFunnelImport: type: object required: [id, importedAt, importedBy, format, sha256, rows, months] properties: id: type: string format: uuid importedAt: type: string format: date-time importedBy: type: string format: type: string sha256: type: string rows: type: integer months: type: array items: type: string Offboarding: type: object properties: id: type: string format: uuid tenantId: type: string format: uuid requestedBy: type: string status: enum: - Requested - Approved - Rejected - Executing - Completed - Failed decidedBy: type: - string - 'null' steps: type: array items: type: object evidence: type: - object - 'null' properties: receipts: type: array items: type: object properties: store: type: string itemsDeleted: type: integer verifiedEmpty: type: boolean completedAt: type: string format: date-time evidenceHash: type: string description: SHA-256 over the tenant id and receipts OffboardingStep: type: object properties: name: type: string succeeded: type: boolean detail: type: string at: type: string format: date-time required: - name - succeeded - detail - at DeletionEvidence: type: object properties: tenantId: type: string format: uuid receipts: type: array items: type: object properties: store: type: string itemsDeleted: type: integer verifiedEmpty: type: boolean detail: type: string at: type: string format: date-time required: - store - itemsDeleted - verifiedEmpty - detail - at completedAt: type: string format: date-time evidenceHash: type: string required: - tenantId - receipts - completedAt - evidenceHash StatusComponent: type: object properties: id: type: string format: uuid name: type: string status: enum: - Operational - Maintenance - Degraded - PartialOutage - MajorOutage order: type: integer updatedAt: type: string format: date-time required: - id - name - status - order - updatedAt Incident: type: object properties: id: type: string format: uuid title: type: string impact: enum: - None - Minor - Major - Critical status: enum: - Investigating - Identified - Monitoring - Resolved componentIds: type: array items: type: string format: uuid updates: type: array items: type: object properties: status: enum: - Investigating - Identified - Monitoring - Resolved message: type: string at: type: string format: date-time author: type: string required: - status - message - at - author startedAt: type: string format: date-time resolvedAt: type: - string - 'null' format: date-time required: - id - title - impact - status - componentIds - updates - startedAt - resolvedAt PublicStatus: type: object properties: overall: enum: - Operational - Maintenance - Degraded - PartialOutage - MajorOutage components: type: array items: type: object properties: name: type: string status: enum: - Operational - Maintenance - Degraded - PartialOutage - MajorOutage required: - name - status activeIncidents: type: array items: type: object properties: title: type: string impact: enum: - None - Minor - Major - Critical status: enum: - Investigating - Identified - Monitoring - Resolved startedAt: type: string format: date-time updates: type: array items: type: object properties: status: enum: - Investigating - Identified - Monitoring - Resolved message: type: string at: type: string format: date-time required: - status - message - at required: - title - impact - status - startedAt - updates generatedAt: type: string format: date-time required: - overall - components - activeIncidents - generatedAt