Home General Torq gRPC API

Torq gRPC API

Last updated on Jul 31, 2024

It's now possible to use some features of Torq via gRPC API. This feature became available in Torq 2.0. The motivation of the Torq API is to expose a common unified API for all the nodes connected to Torq. You can use the same commands to interact with LND or CLN. In later releases it will be possible to use the API such that it can dynamically choose which node to use. You could for example have a primary node and a failover node, in the case the primary node doesn't respond.

Besides directly interacting with the nodes, the API provides actions like triggering workflows and adding torq tags to peer nodes. If you have a need for some API method that does not exist yet, please reach out.

To enable the gRPC API, go to Settings, set a desired gRPC port and set the API to enabled. Important: the API is unauthenticated so you should make sure that the port is not publicly open to the internet!

Click "Download Torq Proto File" to get the proto file to see all the available methods and to implement your gRPC client.

Usage of the API

The API methods that interact directly with the lightning nodes, require you to identify the node to interact with by "API handle". You can check and edit the API handles for your nodes in the node settings. You can also get the node handles by calling the gRPC method GetActiveNodes.