{ "openapi": "3.0.3", "info": { "title": "nxmesh-master", "description": "", "contact": { "name": "NxMesh Team" }, "license": { "name": "GNU General Public License v3.0" }, "version": "0.1.0" }, "paths": { "/api/v1/agents/{id}": { "get": { "tags": [ "Agents" ], "summary": "Get agent by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Agent ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Agent found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentResponse" } } } }, "404": { "description": "Agent not found" } } }, "delete": { "tags": [ "Agents" ], "summary": "Delete agent", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Agent ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Agent deleted" } } } }, "/api/v1/agents/{id}/reload": { "post": { "tags": [ "Agents" ], "summary": "Reload agent nginx", "operationId": "reload", "parameters": [ { "name": "id", "in": "path", "description": "Agent ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Nginx reloaded successfully" } } } }, "/api/v1/certificates/{id}": { "get": { "tags": [ "Certificates" ], "summary": "Get certificate by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Certificate ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Certificate found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CertificateResponse" } } } }, "404": { "description": "Certificate not found" } } }, "delete": { "tags": [ "Certificates" ], "summary": "Delete certificate", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Certificate ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Certificate deleted" } } } }, "/api/v1/organizations": { "get": { "tags": [ "Organizations" ], "summary": "List organizations", "operationId": "list", "responses": { "200": { "description": "List of organizations", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/OrganizationResponse" } } } } } } }, "post": { "tags": [ "Organizations" ], "summary": "Create organization", "operationId": "create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Organization created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "400": { "description": "Invalid request" } } } }, "/api/v1/organizations/{id}": { "get": { "tags": [ "Organizations" ], "summary": "Get organization by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Organization ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Organization found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "404": { "description": "Organization not found" } } }, "delete": { "tags": [ "Organizations" ], "summary": "Delete organization", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Organization ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Organization deleted" }, "404": { "description": "Organization not found" } } }, "patch": { "tags": [ "Organizations" ], "summary": "Update organization", "operationId": "update", "parameters": [ { "name": "id", "in": "path", "description": "Organization ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "200": { "description": "Organization updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationResponse" } } } }, "404": { "description": "Organization not found" } } } }, "/api/v1/organizations/{id}/workspaces": { "get": { "tags": [ "Workspaces" ], "summary": "List workspaces", "operationId": "list", "parameters": [ { "name": "id", "in": "path", "description": "Organization ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "List of workspaces", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WorkspaceResponse" } } } } } } }, "post": { "tags": [ "Workspaces" ], "summary": "Create workspace", "operationId": "create", "parameters": [ { "name": "id", "in": "path", "description": "Organization ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Workspace created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceResponse" } } } } } } }, "/api/v1/upstreams/{id}": { "get": { "tags": [ "Upstreams" ], "summary": "Get upstream by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Upstream ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Upstream found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpstreamResponse" } } } }, "404": { "description": "Upstream not found" } } }, "delete": { "tags": [ "Upstreams" ], "summary": "Delete upstream", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Upstream ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Upstream deleted" } } }, "patch": { "tags": [ "Upstreams" ], "summary": "Update upstream", "operationId": "update", "parameters": [ { "name": "id", "in": "path", "description": "Upstream ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "200": { "description": "Upstream updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpstreamResponse" } } } } } } }, "/api/v1/virtual-hosts/{id}": { "get": { "tags": [ "Virtual Hosts" ], "summary": "Get virtual host by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Virtual Host ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Virtual host found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VirtualHostResponse" } } } }, "404": { "description": "Virtual host not found" } } }, "delete": { "tags": [ "Virtual Hosts" ], "summary": "Delete virtual host", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Virtual Host ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Virtual host deleted" } } }, "patch": { "tags": [ "Virtual Hosts" ], "summary": "Update virtual host", "operationId": "update", "parameters": [ { "name": "id", "in": "path", "description": "Virtual Host ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "200": { "description": "Virtual host updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VirtualHostResponse" } } } } } } }, "/api/v1/workspaces/{id}": { "get": { "tags": [ "Workspaces" ], "summary": "Get workspace by ID", "operationId": "get", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "Workspace found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceResponse" } } } }, "404": { "description": "Workspace not found" } } }, "delete": { "tags": [ "Workspaces" ], "summary": "Delete workspace", "operationId": "delete", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "204": { "description": "Workspace deleted" } } }, "patch": { "tags": [ "Workspaces" ], "summary": "Update workspace", "operationId": "update", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "200": { "description": "Workspace updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceResponse" } } } } } } }, "/api/v1/workspaces/{id}/agents": { "get": { "tags": [ "Agents" ], "summary": "List agents", "operationId": "list", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "List of agents", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AgentResponse" } } } } } } } }, "/api/v1/workspaces/{id}/agents/tokens": { "post": { "tags": [ "Agents" ], "summary": "Create agent registration token", "operationId": "create_token", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenRequest" } } }, "required": true }, "responses": { "201": { "description": "Token created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenResponse" } } } } } } }, "/api/v1/workspaces/{id}/certificates": { "get": { "tags": [ "Certificates" ], "summary": "List certificates", "operationId": "list", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "List of certificates", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CertificateResponse" } } } } } } }, "post": { "tags": [ "Certificates" ], "summary": "Create certificate", "operationId": "create", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Certificate requested", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CertificateResponse" } } } } } } }, "/api/v1/workspaces/{id}/upstreams": { "get": { "tags": [ "Upstreams" ], "summary": "List upstreams", "operationId": "list", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "List of upstreams", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UpstreamResponse" } } } } } } }, "post": { "tags": [ "Upstreams" ], "summary": "Create upstream", "operationId": "create", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Upstream created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpstreamResponse" } } } } } } }, "/api/v1/workspaces/{id}/virtual-hosts": { "get": { "tags": [ "Virtual Hosts" ], "summary": "List virtual hosts", "operationId": "list", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "responses": { "200": { "description": "List of virtual hosts", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualHostResponse" } } } } } } }, "post": { "tags": [ "Virtual Hosts" ], "summary": "Create virtual host", "operationId": "create", "parameters": [ { "name": "id", "in": "path", "description": "Workspace ID", "required": true, "schema": { "$ref": "#/components/schemas/Uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Virtual host created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VirtualHostResponse" } } } } } } }, "/health": { "get": { "tags": [ "routes" ], "summary": "Health check endpoint", "operationId": "health_check", "responses": { "200": { "description": "Server is healthy", "content": { "text/plain": { "schema": { "type": "string" } } } } } } } }, "components": { "schemas": { "AgentResponse": { "type": "object", "description": "Agent response", "required": [ "id", "workspace_id", "name", "hostname", "state" ], "properties": { "hostname": { "type": "string" }, "id": { "$ref": "#/components/schemas/Uuid" }, "name": { "type": "string" }, "state": { "type": "string" }, "workspace_id": { "$ref": "#/components/schemas/Uuid" } } }, "CertificateResponse": { "type": "object", "description": "Certificate response", "required": [ "id", "domain", "status" ], "properties": { "domain": { "type": "string" }, "id": { "$ref": "#/components/schemas/Uuid" }, "status": { "type": "string" } } }, "CreateRequest": { "type": "object", "description": "Create certificate request", "required": [ "domain" ], "properties": { "domain": { "type": "string" } } }, "OrganizationResponse": { "type": "object", "description": "Organization response", "required": [ "id", "name", "slug" ], "properties": { "id": { "$ref": "#/components/schemas/Uuid" }, "name": { "type": "string" }, "slug": { "type": "string" } } }, "TokenRequest": { "type": "object", "description": "Create agent token request", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "TokenResponse": { "type": "object", "description": "Create agent token response", "required": [ "token", "agent_id" ], "properties": { "agent_id": { "$ref": "#/components/schemas/Uuid" }, "token": { "type": "string" } } }, "UpstreamResponse": { "type": "object", "description": "Upstream response", "required": [ "id", "name", "algorithm" ], "properties": { "algorithm": { "type": "string" }, "id": { "$ref": "#/components/schemas/Uuid" }, "name": { "type": "string" } } }, "Uuid": { "type": "string", "format": "uuid", "description": "UUID string", "example": "550e8400-e29b-41d4-a716-446655440000" }, "VirtualHostResponse": { "type": "object", "description": "Virtual Host response", "required": [ "id", "name", "server_name", "listen_port" ], "properties": { "id": { "$ref": "#/components/schemas/Uuid" }, "listen_port": { "type": "integer", "format": "int32", "minimum": 0 }, "name": { "type": "string" }, "server_name": { "type": "string" } } }, "WorkspaceResponse": { "type": "object", "description": "Workspace response", "required": [ "id", "organization_id", "name", "slug" ], "properties": { "id": { "$ref": "#/components/schemas/Uuid" }, "name": { "type": "string" }, "organization_id": { "$ref": "#/components/schemas/Uuid" }, "slug": { "type": "string" } } } } }, "tags": [ { "name": "Organizations", "description": "Organization management" }, { "name": "Workspaces", "description": "Workspace management" }, { "name": "Agents", "description": "Agent management" }, { "name": "Virtual Hosts", "description": "Virtual host configuration" }, { "name": "Upstreams", "description": "Upstream configuration" }, { "name": "Certificates", "description": "SSL certificate management" } ] }