Add a device
Add a device to the private network of the tenant.
POST /v1/tenants/{tenant}/devices
curl -X POST "https://api.shako.dev/v1/tenants/acme/devices" \
-H "Authorization: Bearer $SHAKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"laptop","public_key":"mH4V0sQ7..."}'201 (excerpt)
{
"name": "laptop",
"address": "100.96.0.2",
"gateway": "100.96.0.1",
"endpoint": "wg.shako.dev:51820",
"public_key": "Bq9z..."
}Authenticate with Authorization: Bearer <API key> on https://api.shako.dev. Role: contributor or owner.
Path parameters
tenantstringrequired- The tenant's name, from GET /v1/tenants.
Request body
namestringrequired- The device's name. It is unique in the tenant.
public_keystringrequired- The device's WireGuard public key, in base64. The private key stays on the device.
Response
201 with the added device object.
Behavior
The answer has what the device's WireGuard config needs. The private key never leaves the device.
The errors. All the endpoints of Devices.