POST /api/v3/lightning/router-allocations¶
Summary¶
POST /v3/lightning/router-allocations
Description¶
Allocate the next available WG IP + LAN /30 to the given lightning device. Returns a RESERVED allocation that should be consumed by a subsequent provisioning call. Stale reservations are released by a scheduled janitor.
Tags: lightning
Parameters¶
Header Parameters¶
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization |
string |
✓ Yes | Bearer {AuthToken} |
|
Content-Type |
string |
✓ Yes | application/json |
|
Accept |
string |
✓ Yes | application/json |
|
AppIdV3 |
string |
✓ Yes | LCUID-LAP-********-****-****-****-************ |
Request Body¶
Required: Yes
Content Type: application/json¶
Schema¶
Type: object
Required fields: lcuid
Properties:
lcuid(string) (required): The lcuid of the lightning device to allocate to.requested_by(string): Optional free-form operator identifier (max 128 chars).
Responses¶
Response: 201¶
Description: Sample Response
Content Type: application/json¶
Schema¶
Type: object
Properties:
success(boolean): truelightning_router_ip_allocation(object) Type:object
Properties:
lcuid(string): The allocation lcuid.wg_ip(string): Assigned WireGuard peer IP.lan_subnet(string): Assigned LAN /30 subnet.rut_lan_ip(string): Router-side LAN IP within the /30.device_ip(string): Lightning-device-side LAN IP within the /30.status(integer): Allocation status (1 = RESERVED, 2 = ACTIVE, 3 = RELEASED).reserved_until(string): ISO8601 expiry timestamp for the reservation.lightning_device_id(integer)requested_by(string)created_at(string)-
updated_at(string) -
vpn_endpoint_host(string): The hub server endpoint hostname. vpn_endpoint_port(integer): The hub server endpoint UDP port.
Example Response¶
{
"success": true,
"lightning_router_ip_allocation": {
"lcuid": "LCUID-LDRA-f5ec2499-a7f1-41a9-8385-4a49ddfdf25e",
"wg_ip": "10.70.1.1",
"lan_subnet": "10.71.0.0/30",
"rut_lan_ip": "10.71.0.1",
"device_ip": "10.71.0.2",
"status": 1,
"reserved_until": "2026-10-09T21:36:29.000000Z",
"lightning_device_id": 20475,
"requested_by": "tester@example.com",
"created_at": "2026-10-08T21:36:29.000000Z",
"updated_at": "2026-10-08T21:36:29.000000Z"
},
"vpn_endpoint_host": "backbone-lightning-vpn-1.lcdevops.com",
"vpn_endpoint_port": 51820
}
Example Implementations¶
Bash (cURL)¶
curl --request POST \
"https://api.lucit.app/api/v3/lightning/router-allocations" \
--header "Authorization: Bearer {AuthToken}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
--data "{
\"lcuid\": \"aliquid\",
\"requested_by\": \"aliquid\"
}"
JavaScript (Fetch API)¶
const url = new URL(
"https://api.lucit.app/api/v3/lightning/router-allocations"
);
const headers = {
"Authorization": "Bearer {AuthToken}",
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************",
};
let body = {
"lcuid": "aliquid",
"requested_by": "aliquid"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
PHP (Guzzle)¶
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.lucit.app/api/v3/lightning/router-allocations',
[
'headers' => [
'Authorization' => 'Bearer {AuthToken}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
],
'json' => [
'lcuid' => 'aliquid',
'requested_by' => 'aliquid',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Python (Requests)¶
import requests
import json
url = 'https://api.lucit.app/api/v3/lightning/router-allocations'
payload = {
"lcuid": "aliquid",
"requested_by": "aliquid"
}
headers = {
'Authorization': 'Bearer {AuthToken}',
'Content-Type': 'application/json',
'Accept': 'application/json',
'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example Responses¶
201 Response¶
{
"success": true,
"lightning_router_ip_allocation": {
"lcuid": "LCUID-LDRA-f5ec2499-a7f1-41a9-8385-4a49ddfdf25e",
"wg_ip": "10.70.1.1",
"lan_subnet": "10.71.0.0/30",
"rut_lan_ip": "10.71.0.1",
"device_ip": "10.71.0.2",
"status": 1,
"reserved_until": "2026-10-09T21:36:29.000000Z",
"lightning_device_id": 20475,
"requested_by": "tester@example.com",
"created_at": "2026-10-08T21:36:29.000000Z",
"updated_at": "2026-10-08T21:36:29.000000Z"
},
"vpn_endpoint_host": "backbone-lightning-vpn-1.lcdevops.com",
"vpn_endpoint_port": 51820
}