LND Router API
LND Router API endpoints from Lightning Labs
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
LND Router API endpoints from Lightning Labs
Endpoints 19
Router
- POSTlncli: `deletefwdhistory`
DeleteForwardingHistory allows the caller to delete forwarding history
events with a timestamp at or before a specified time. This is useful
for implementing data retention policies for privacy purposes. The call
deletes events in batches and returns statistics including the total number
of events deleted and the aggregate fees earned from those events. The
deletion is performed in a transaction-safe manner with configurable batch
sizes to avoid holding large database locks.
/v2/router/fwdhistory/delete - GETSubscribeHtlcEvents creates a uni-directional stream from the server to
the client which delivers a stream of htlc events.
/v2/router/htlcevents - POST*
HtlcInterceptor dispatches a bi-directional streaming RPC in which
Forwarded HTLC requests are sent to the client and the client responds with
a boolean that tells LND if this htlc should be intercepted.
In case of interception, the htlc can be either settled, cancelled or
resumed later by using the ResolveHoldForward endpoint.
/v2/router/htlcinterceptor - GETlncli: `querymc`
QueryMissionControl exposes the internal mission control state to callers.
It is a development feature.
/v2/router/mc - GETlncli: `queryprob`
Deprecated. QueryProbability returns the current success probability
estimate for a given node pair and amount. The call returns a zero success
probability if no channel is available or if the amount violates min/max
HTLC constraints.
/v2/router/mc/probability/:from_node/:to_node/:amt_msat - POSTlncli: `resetmc`
ResetMissionControl clears all mission control state and starts with a clean
slate.
/v2/router/mc/reset - GETlncli: `getmccfg`
GetMissionControlConfig returns mission control's current config.
/v2/router/mccfg - POSTlncli: `setmccfg`
SetMissionControlConfig will set mission control's config, if the config
provided is valid.
/v2/router/mccfg - GETTrackPayments returns an update stream for every payment that is not in a
terminal state. Note that if payments are in-flight while starting a new
subscription, the start of the payment stream could produce out-of-order
and/or duplicate events. In order to get updates for every in-flight
payment attempt make sure to subscribe to this method before initiating any
payments.
/v2/router/payments - POSTlncli: `buildroute`
BuildRoute builds a fully specified route based on a list of hop public
keys. It retrieves the relevant channel policies from the graph in order to
calculate the correct fees and time locks.
Note that LND will use its default final_cltv_delta if no value is supplied.
Make sure to add the correct final_cltv_delta depending on the invoice
restriction. Moreover the caller has to make sure to provide the
payment_addr if the route is paying an invoice which signaled it.
/v2/router/route - POSTlncli: `estimateroutefee`
EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
may cost to send an HTLC to the target end destination.
/v2/router/route/estimatefee - POSTlncli: `sendtoroute`
SendToRouteV2 attempts to make a payment via the specified route. This
method differs from SendPayment in that it allows users to specify a full
route manually. This can be used for things like rebalancing, and atomic
swaps.
/v2/router/route/send - POSTlncli: `sendpayment`
SendPaymentV2 attempts to route a payment described by the passed
PaymentRequest to the final destination. The call returns a stream of
payment updates. When using this RPC, make sure to set a fee limit, as the
default routing fee limit is 0 sats. Without a non-zero fee limit only
routes without fees will be attempted which often fails with
FAILURE_REASON_NO_ROUTE.
/v2/router/send - GETlncli: `trackpayment`
TrackPaymentV2 returns an update stream for the payment identified by the
payment hash.
/v2/router/track/:payment_hash - POSTlncli: `updatechanstatus`
UpdateChanStatus attempts to manually set the state of a channel
(enabled, disabled, or auto). A manual "disable" request will cause the
channel to stay disabled until a subsequent manual request of either
"enable" or "auto".
/v2/router/updatechanstatus - POSTXAddLocalChanAliases is an experimental API that creates a set of new
channel SCID alias mappings. The final total set of aliases in the manager
after the add operation is returned. This is only a locally stored alias,
and will not be communicated to the channel peer via any message. Therefore,
routing over such an alias will only work if the peer also calls this same
RPC on their end. If an alias already exists, an error is returned
/v2/router/x/addaliases - POSTXDeleteLocalChanAliases is an experimental API that deletes a set of alias
mappings. The final total set of aliases in the manager after the delete
operation is returned. The deletion will not be communicated to the channel
peer via any message.
/v2/router/x/deletealiases - POSTXFindBaseLocalChanAlias is an experimental API that looks up the base scid
for a local chan alias that was registered during the current runtime.
/v2/router/x/findbasealias - POSTlncli: `importmc`
XImportMissionControl is an experimental API that imports the state provided
to the internal mission control's state, using all results which are more
recent than our existing values. These values will only be imported
in-memory, and will not be persisted across restarts.
/v2/router/x/importhistory
API details
- Authentication
- None declared in the description
- Operations
- 19 operations on 18 pathsPOST 13GET 6
- Main resources
- Router 19
- Response formats
application/json- Description format
- Swagger 2.0, API version
version not set - Links
- OpenAPI document
How to test the LND Router API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the LND Router API collection, without the publisher's secrets.
- Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
- Send a requestPick an endpoint, for example “lncli: `deletefwdhistory` DeleteForwardingHistory allows the caller to delete forwarding history events with a timestamp at or before a specified time. This is useful for implementing data retention policies for privacy purposes. The call deletes events in batches and returns statistics including the total number of events deleted and the aggregate fees earned from those events. The deletion is performed in a transaction-safe manner with configurable batch sizes to avoid holding large database locks.” (POST /v2/router/fwdhistory/delete), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the LND Router API?
LND Router API endpoints from Lightning Labs It is listed under Finance & banking and has 19 endpoints.
Who publishes the LND Router API?
It is listed from Lightning Labs's public API description (an OpenAPI document), not published by Lightning Labs on Swastik Codes. Anyone who controls lightning.engineering can claim the profile by adding a DNS TXT record.
How do I authenticate with the LND Router API?
Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.
How many endpoints does the LND Router API have?
19 operations on 18 paths (13 POST, 6 GET). The largest groups are Router.
Is forking the LND Router API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.