{ "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "API", "description": "OpenAPI specification of endpoints to control the self-hosted backend." }, "servers": [ { "url": "http://127.0.0.1:12345" } ], "tags": [ { "name": "default" } ], "paths": { "/v1/info": { "get": { "operationId": "381bbe97-e5d8-4f25-8249-a168e2f15f53", "summary": "Information about capabilities", "description": "Get information about which services are currently available and under which URLs", "tags": ["default"], "parameters": [], "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "type": "object", "properties": { "currentNetwork": { "$ref": "#/components/schemas/NetworkMagic" }, "availableNetworks": { "type": "array", "items": { "$ref": "#/components/schemas/NetworkMagic" } }, "services": { "type": "array", "items": { "$ref": "#/components/schemas/ServiceStatus" } } } } } } } } } }, "/v1/switch-network/{networkMagic}": { "put": { "operationId": "6baa086b-9fc7-4ec6-b8ca-f9b2c025f523", "summary": "Switch network", "description": "Run local `cardano-node` and other services for a different network", "tags": ["default"], "parameters": [ { "name": "networkMagic", "in": "path", "description": "The parameter value to be used to retrieve the resource.", "required": true, "schema": { "$ref": "#/components/schemas/NetworkMagic" } } ], "requestBody": { "description": "empty", "content": {} }, "responses": { "200": { "description": "Successful operation", "content": {} }, "404": { "description": "Unknown network" } } } }, "/v1/websocket": { "head": { "operationId": "32f90caf-abdd-4a7a-b9a5-795616c44a0a", "summary": "Notifications about service and network changes over a WebSocket", "description": "Similar to `/v1/info`, but in real time. Also has logs.\n\nThis endpoint is modeled as a `HEAD` here, but in reality it’s a WebSocket with a few [JSON RPC 2.0](https://www.jsonrpc.org/specification) notifications (see responses below). There are no requests.\n\nTry the [Web UI](/ui/) to see WebSocket events as they happen.", "tags": ["default"], "parameters": [ { "name": "withLog", "in": "query", "description": "Include `Log` messages with `stdout`/`stderr` of services? (Currently does nothing.)", "required": false, "schema": { "type": "boolean", "example": true, "default": true } } ], "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "jsonrpc": { "type": "string", "example": "2.0" }, "method": { "type": "string", "example": "NetworkChange" }, "params": { "type": "object", "properties": { "currentNetwork": { "$ref": "#/components/schemas/NetworkMagic" }, "availableNetworks": { "type": "array", "items": { "$ref": "#/components/schemas/NetworkMagic" } } } } } }, { "type": "object", "properties": { "jsonrpc": { "type": "string", "example": "2.0" }, "method": { "type": "string", "example": "Log" }, "params": { "type": "object", "properties": { "timestamp": { "type": "string", "format": "date-time", "example": "2023-07-27T09:12:34.022511785Z" }, "serviceName": { "$ref": "#/components/schemas/ServiceName" }, "pid": { "type": "integer", "example": 10462 }, "stderr": { "type": "boolean", "example": false }, "line": { "type": "string", "example": "[ChainDB:Notice:52] Chain extended, new tip: 35cc8694d0f1d34146c93ea48357fe364f8a5487462ee79f5bb5cef92a7f7b9e at slot 33780262" } } } } }, { "type": "object", "properties": { "jsonrpc": { "type": "string", "example": "2.0" }, "method": { "type": "string", "example": "ServiceStatus" }, "params": { "$ref": "#/components/schemas/ServiceStatus" } } } ] } } } } } } } } }, "components": { "schemas": { "NetworkMagic": { "type": "integer", "enum": [764824073, 1, 2] }, "ServiceName": { "type": "string", "enum": ["cardano-node", "ogmios", "provider-server", "blockchain-services"] }, "ServiceStatus": { "type": "object", "properties": { "serviceName": { "$ref": "#/components/schemas/ServiceName" }, "url": { "type": "string", "description": "URL under which the service can be accessed (sometimes empty)", "example": "http://127.0.0.1:3001" }, "status": { "type": "string", "description": "Current status of the service", "example": "listening" }, "progress": { "type": "number", "format": "double", "description": "Progress of the `status` – usually between 0.0 and 1.0", "example": 0.53778 }, "taskSize": { "type": "number", "format": "double", "description": "Size of the current task, e.g. with Mithril it’s the size of the blockchain", "example": 2619930050.0 }, "secondsLeft": { "type": "number", "format": "double", "description": "Estimated time remaining to completion in seconds", "example": 244.3 }, "version": { "type": "string", "description": "Version (release)", "example": "8.1.2" }, "revision": { "type": "string", "description": "Git commit ID", "example": "d2d90b48c5577b4412d5c9c9968b55f8ab4b9767" } } } } } }