{ "openapi": "3.1.0", "info": { "title": "Bluex Cloud API", "version": "1.0.0" }, "components": { "schemas": { "CloudDeviceFlowStartResult": { "type": "object", "properties": { "flowId": { "type": "string", "minLength": 1 }, "userCode": { "type": "string", "minLength": 1 }, "verificationUri": { "type": "string", "format": "uri" }, "intervalSeconds": { "type": "integer", "exclusiveMinimum": 0 }, "expiresInSeconds": { "type": "integer", "exclusiveMinimum": 0 } }, "required": [ "flowId", "userCode", "verificationUri", "intervalSeconds", "expiresInSeconds" ], "additionalProperties": false }, "CloudApiError": { "type": "object", "properties": { "error": { "type": "string" } }, "required": ["error"], "additionalProperties": false }, "CloudDeviceFlowStartInput": { "type": "object", "properties": { "deviceName": { "type": "string", "minLength": 1, "maxLength": 120 } }, "required": ["deviceName"], "additionalProperties": false }, "CloudDeviceFlowPollResult": { "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "enum": ["pending"] } }, "required": ["status"], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "enum": ["slow_down"] }, "intervalSeconds": { "type": "integer", "exclusiveMinimum": 0 } }, "required": ["status", "intervalSeconds"], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "enum": ["expired"] } }, "required": ["status"], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "enum": ["complete"] }, "deviceToken": { "type": "string", "minLength": 1 }, "device": { "$ref": "#/components/schemas/CloudDevice" }, "user": { "$ref": "#/components/schemas/CloudUser" } }, "required": ["status", "deviceToken", "device", "user"], "additionalProperties": false } ] }, "CloudDevice": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string", "format": "date-time" }, "lastSeenAt": { "type": ["string", "null"], "format": "date-time", "default": null }, "revokedAt": { "type": ["string", "null"], "format": "date-time", "default": null } }, "required": ["id", "name", "createdAt"], "additionalProperties": false }, "CloudUser": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "email": { "type": "string", "minLength": 1 }, "image": { "type": ["string", "null"], "default": null }, "role": { "$ref": "#/components/schemas/CloudUserRole" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["id", "name", "email", "role", "createdAt"], "additionalProperties": false }, "CloudUserRole": { "type": "string", "enum": ["user", "admin"] }, "CloudDeviceFlowPollInput": { "type": "object", "properties": { "flowId": { "type": "string", "minLength": 1 } }, "required": ["flowId"], "additionalProperties": false }, "CloudAccount": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/CloudUser" }, "quota": { "$ref": "#/components/schemas/CloudQuota" }, "devices": { "type": "array", "items": { "$ref": "#/components/schemas/CloudDevice" } } }, "required": ["user", "quota", "devices"], "additionalProperties": false }, "CloudQuota": { "type": "object", "properties": { "maxChannels": { "type": "integer", "exclusiveMinimum": 0 }, "maxPayloadBytes": { "type": "integer", "exclusiveMinimum": 0 }, "maxDeliveriesPerHour": { "type": "integer", "exclusiveMinimum": 0 }, "retentionHours": { "type": "integer", "exclusiveMinimum": 0 } }, "required": ["maxChannels", "maxPayloadBytes", "maxDeliveriesPerHour", "retentionHours"], "additionalProperties": false }, "CloudChannelList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudChannel" } } }, "required": ["items"], "additionalProperties": false }, "CloudChannel": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "provider": { "type": "string", "enum": ["github"] }, "name": { "type": "string", "minLength": 1 }, "webhookPath": { "type": "string", "minLength": 1 }, "webhookUrl": { "type": "string", "format": "uri" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "expiresAt": { "type": ["string", "null"], "format": "date-time", "default": null }, "metadata": { "type": "object", "additionalProperties": {}, "default": {} } }, "required": [ "id", "provider", "name", "webhookPath", "webhookUrl", "createdAt", "updatedAt" ], "additionalProperties": false }, "CloudCreateChannelResult": { "type": "object", "properties": { "channel": { "$ref": "#/components/schemas/CloudChannel" }, "channelToken": { "type": "string", "minLength": 1 }, "webhookSecret": { "type": "string", "minLength": 1 } }, "required": ["channel", "channelToken", "webhookSecret"], "additionalProperties": false }, "CloudCreateChannelInput": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "metadata": { "type": "object", "additionalProperties": {}, "default": {} } }, "required": ["name"], "additionalProperties": false }, "CloudDeliveryList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudDeliverySummary" } } }, "required": ["items"], "additionalProperties": false }, "CloudDeliverySummary": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "channelId": { "type": "string", "minLength": 1 }, "sequence": { "type": "integer", "minimum": 0 }, "status": { "type": "string", "enum": ["pending", "delivered", "acknowledged", "expired"] }, "receivedAt": { "type": "string", "format": "date-time" }, "acknowledgedAt": { "type": ["string", "null"], "format": "date-time", "default": null }, "event": { "type": ["string", "null"], "default": null } }, "required": ["id", "channelId", "sequence", "status", "receivedAt"], "additionalProperties": false }, "CloudDiagnosticsIngestResult": { "type": "object", "properties": { "accepted": { "type": "boolean", "enum": [true] }, "duplicate": { "type": "boolean" }, "recordId": { "type": "string", "minLength": 1 } }, "required": ["accepted", "duplicate", "recordId"], "additionalProperties": false }, "CloudDiagnosticsIngestInput": { "type": "object", "properties": { "source": { "$ref": "#/components/schemas/CloudDiagnosticsSource" }, "severity": { "$ref": "#/components/schemas/CloudDiagnosticSeverity" }, "kind": { "type": "string", "minLength": 1, "maxLength": 160 }, "occurredAt": { "type": "string", "format": "date-time" }, "installationId": { "type": "string", "minLength": 1, "maxLength": 200 }, "runtimeInstanceId": { "type": "string", "minLength": 1, "maxLength": 200 }, "processId": { "type": "string", "minLength": 1, "maxLength": 120 }, "appVersion": { "type": "string", "minLength": 1, "maxLength": 120 }, "environment": { "type": "string", "minLength": 1, "maxLength": 120 }, "correlation": { "$ref": "#/components/schemas/CloudDiagnosticCorrelation" }, "detail": { "type": "object", "additionalProperties": {}, "default": {} }, "redaction": { "$ref": "#/components/schemas/CloudDiagnosticRedaction" }, "dedupeKey": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": ["source", "severity", "kind", "occurredAt"], "additionalProperties": false }, "CloudDiagnosticsSource": { "type": "string", "enum": [ "desktop_shell", "desktop_host", "api", "worker", "realtime", "executor", "exchanges_ui", "cloud_api" ] }, "CloudDiagnosticSeverity": { "type": "string", "enum": ["info", "warning", "error", "fatal"] }, "CloudDiagnosticCorrelation": { "type": "object", "properties": { "issueId": { "type": "string", "minLength": 1 }, "workId": { "type": "string", "minLength": 1 }, "sessionId": { "type": "string", "minLength": 1 }, "executionSiteId": { "type": "string", "minLength": 1 } }, "default": {}, "additionalProperties": false }, "CloudDiagnosticRedaction": { "type": "object", "properties": { "applied": { "type": "boolean" }, "fields": { "type": "array", "items": { "type": "string", "minLength": 1 }, "default": [] } }, "default": { "applied": false, "fields": [] }, "required": ["applied"], "additionalProperties": false }, "CloudDiagnosticList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudDiagnosticRecord" } } }, "required": ["items"], "additionalProperties": false }, "CloudDiagnosticRecord": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "userId": { "type": "string", "minLength": 1 }, "deviceId": { "type": ["string", "null"], "minLength": 1, "default": null }, "installationId": { "type": ["string", "null"], "minLength": 1, "default": null }, "runtimeInstanceId": { "type": ["string", "null"], "minLength": 1, "default": null }, "source": { "$ref": "#/components/schemas/CloudDiagnosticsSource" }, "severity": { "$ref": "#/components/schemas/CloudDiagnosticSeverity" }, "kind": { "type": "string", "minLength": 1 }, "occurredAt": { "type": "string", "format": "date-time" }, "processId": { "type": ["string", "null"], "minLength": 1, "default": null }, "appVersion": { "type": ["string", "null"], "minLength": 1, "default": null }, "environment": { "type": ["string", "null"], "minLength": 1, "default": null }, "correlation": { "$ref": "#/components/schemas/CloudDiagnosticCorrelation" }, "detail": { "type": "object", "additionalProperties": {}, "default": {} }, "redaction": { "$ref": "#/components/schemas/CloudDiagnosticRedaction" }, "dedupeKey": { "type": ["string", "null"], "minLength": 1, "default": null }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["id", "userId", "source", "severity", "kind", "occurredAt", "createdAt"], "additionalProperties": false }, "CloudAdminAccountList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudAdminAccountSummary" } } }, "required": ["items"], "additionalProperties": false }, "CloudAdminAccountSummary": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/CloudUser" }, "quota": { "$ref": "#/components/schemas/CloudQuota" }, "deviceCount": { "type": "integer", "minimum": 0 }, "channelCount": { "type": "integer", "minimum": 0 } }, "required": ["user", "quota", "deviceCount", "channelCount"], "additionalProperties": false }, "CloudAdminChannelList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudAdminChannelSummary" } } }, "required": ["items"], "additionalProperties": false }, "CloudAdminChannelSummary": { "type": "object", "properties": { "channel": { "$ref": "#/components/schemas/CloudChannel" }, "ownerEmail": { "type": ["string", "null"], "default": null }, "pendingDeliveries": { "type": "integer", "minimum": 0 } }, "required": ["channel", "pendingDeliveries"], "additionalProperties": false }, "CloudEventList": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CloudEvent" } } }, "required": ["items"], "additionalProperties": false }, "CloudEvent": { "type": "object", "properties": { "sequence": { "type": "integer", "minimum": 0 }, "id": { "type": "string", "minLength": 1 }, "type": { "$ref": "#/components/schemas/CloudEventType" }, "actorId": { "type": ["string", "null"], "default": null }, "subjectId": { "type": ["string", "null"], "default": null }, "payload": { "type": "object", "additionalProperties": {}, "default": {} }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["sequence", "id", "type", "createdAt"], "additionalProperties": false }, "CloudEventType": { "type": "string", "enum": [ "account.created", "device.enrolled", "device.revoked", "channel.created", "channel.deleted", "delivery.received", "delivery.acked", "delivery.rejected", "quota.exceeded", "admin.user.role_changed", "admin.user.banned", "admin.channel.deleted" ] }, "CloudIngestHealth": { "type": "object", "properties": { "observedAt": { "type": "string", "format": "date-time" }, "lastDeliveryAt": { "type": ["string", "null"], "format": "date-time", "default": null }, "deliveriesLastHour": { "type": "integer", "minimum": 0 }, "pendingDeliveries": { "type": "integer", "minimum": 0 }, "rejectedLastHour": { "type": "integer", "minimum": 0 } }, "required": ["observedAt", "deliveriesLastHour", "pendingDeliveries", "rejectedLastHour"], "additionalProperties": false }, "CloudAdminSetRoleInput": { "type": "object", "properties": { "role": { "type": "string", "enum": ["user", "admin"] } }, "required": ["role"], "additionalProperties": false } }, "parameters": {} }, "paths": { "/device-flow/start": { "post": { "operationId": "startCloudDeviceFlow", "tags": ["CloudDeviceFlow"], "summary": "Start a GitHub device flow enrollment", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDeviceFlowStartInput" } } } }, "responses": { "200": { "description": "Device flow started", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDeviceFlowStartResult" } } } }, "500": { "description": "Device flow start failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/device-flow/poll": { "post": { "operationId": "pollCloudDeviceFlow", "tags": ["CloudDeviceFlow"], "summary": "Poll a GitHub device flow enrollment", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDeviceFlowPollInput" } } } }, "responses": { "200": { "description": "Device flow state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDeviceFlowPollResult" } } } }, "500": { "description": "Device flow poll failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/account": { "get": { "operationId": "getCloudAccount", "tags": ["CloudAccount"], "summary": "Read the signed-in account with quota and devices", "responses": { "200": { "description": "Cloud account", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAccount" } } } }, "404": { "description": "Account not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Account read failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/account/devices/{deviceId}/revoke": { "post": { "operationId": "revokeCloudDevice", "tags": ["CloudAccount"], "summary": "Revoke a device token", "responses": { "200": { "description": "Device revoked", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAccount" } } } }, "404": { "description": "Device not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Device revocation failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/channels": { "get": { "operationId": "listCloudChannels", "tags": ["CloudChannels"], "summary": "List the account's webhook channels", "responses": { "200": { "description": "Channels", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudChannelList" } } } }, "500": { "description": "Channel list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } }, "post": { "operationId": "createCloudChannel", "tags": ["CloudChannels"], "summary": "Create a self-service webhook channel", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudCreateChannelInput" } } } }, "responses": { "201": { "description": "Channel created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudCreateChannelResult" } } } }, "429": { "description": "Quota exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Channel creation failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/channels/ensure": { "post": { "operationId": "ensureCloudChannel", "tags": ["CloudChannels"], "summary": "Create or reuse a webhook channel by name, rotating its stream token", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudCreateChannelInput" } } } }, "responses": { "200": { "description": "Channel ensured", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudCreateChannelResult" } } } }, "429": { "description": "Quota exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Channel ensure failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/channels/{channelId}": { "delete": { "operationId": "deleteCloudChannel", "tags": ["CloudChannels"], "summary": "Delete an owned webhook channel", "responses": { "200": { "description": "Channel deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudChannelList" } } } }, "404": { "description": "Channel not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Channel deletion failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/channels/{channelId}/deliveries": { "get": { "operationId": "listCloudChannelDeliveries", "tags": ["CloudChannels"], "summary": "List recent deliveries for an owned channel", "responses": { "200": { "description": "Deliveries", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDeliveryList" } } } }, "404": { "description": "Channel not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } }, "500": { "description": "Delivery list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/diagnostics": { "post": { "operationId": "ingestCloudDiagnostic", "tags": ["CloudDiagnostics"], "summary": "Ingest a structured runtime diagnostic", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDiagnosticsIngestInput" } } } }, "responses": { "202": { "description": "Diagnostic accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDiagnosticsIngestResult" } } } }, "500": { "description": "Diagnostic ingest failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/diagnostics": { "get": { "operationId": "listCloudAdminDiagnostics", "tags": ["CloudDiagnostics"], "summary": "List structured runtime diagnostics (admin)", "parameters": [ { "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 }, "required": false, "name": "limit", "in": "query" }, { "schema": { "type": "string", "minLength": 1 }, "required": false, "name": "userId", "in": "query" }, { "schema": { "type": "string", "minLength": 1 }, "required": false, "name": "deviceId", "in": "query" }, { "schema": { "type": "string", "minLength": 1 }, "required": false, "name": "installationId", "in": "query" }, { "schema": { "type": "string", "minLength": 1 }, "required": false, "name": "runtimeInstanceId", "in": "query" }, { "schema": { "$ref": "#/components/schemas/CloudDiagnosticsSource" }, "required": false, "name": "source", "in": "query" }, { "schema": { "$ref": "#/components/schemas/CloudDiagnosticSeverity" }, "required": false, "name": "severity", "in": "query" } ], "responses": { "200": { "description": "Diagnostics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudDiagnosticList" } } } }, "500": { "description": "Diagnostic list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/accounts": { "get": { "operationId": "listCloudAdminAccounts", "tags": ["CloudAdmin"], "summary": "List all accounts (admin)", "responses": { "200": { "description": "Accounts", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAdminAccountList" } } } }, "500": { "description": "Account list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/channels": { "get": { "operationId": "listCloudAdminChannels", "tags": ["CloudAdmin"], "summary": "List all channels (admin)", "responses": { "200": { "description": "Channels", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAdminChannelList" } } } }, "500": { "description": "Channel list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/events": { "get": { "operationId": "listCloudAdminEvents", "tags": ["CloudAdmin"], "summary": "Read the cloud event log (admin)", "responses": { "200": { "description": "Events", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudEventList" } } } }, "500": { "description": "Event list failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/ingest-health": { "get": { "operationId": "getCloudAdminIngestHealth", "tags": ["CloudAdmin"], "summary": "Read webhook ingest health (admin)", "responses": { "200": { "description": "Ingest health", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudIngestHealth" } } } }, "500": { "description": "Ingest health failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } }, "/admin/users/{userId}/role": { "post": { "operationId": "setCloudUserRole", "tags": ["CloudAdmin"], "summary": "Change a user's role (admin)", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAdminSetRoleInput" } } } }, "responses": { "200": { "description": "Role updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudAdminAccountList" } } } }, "500": { "description": "Role update failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CloudApiError" } } } } } } } }, "webhooks": {} }