API Quick Start
Get started with the Lockwave API in five steps: create a token, list hosts, create a key, assign it, and verify sync.
API Quick Start
Get up and running with the Lockwave API in five steps.
Step 1: Create an API Token
Go to Profile → API Tokens in the dashboard and create a new token. Copy it and export it:
export LOCKWAVE_TOKEN="your-token-here"
Step 2: List Your Hosts
curl -s -H "Authorization: Bearer $LOCKWAVE_TOKEN" \
-H "Accept: application/json" \
https://lockwave.io/api/v1/hosts | jq
Step 3: Import an SSH Key
curl -s -X POST \
-H "Authorization: Bearer $LOCKWAVE_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"name":"deploy-key","mode":"import","public_key":"ssh-ed25519 AAAA... user@host"}' \
https://lockwave.io/api/v1/ssh-keys | jq
Step 4: Create an Assignment
curl -s -X POST \
-H "Authorization: Bearer $LOCKWAVE_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"host_user_id":"HOST_USER_UUID","ssh_key_id":"SSH_KEY_UUID"}' \
https://lockwave.io/api/v1/assignments | jq
Step 5: Verify Sync
Check the host status to confirm the daemon has synced the new key:
curl -s -H "Authorization: Bearer $LOCKWAVE_TOKEN" \
-H "Accept: application/json" \
https://lockwave.io/api/v1/hosts/HOST_UUID | jq '.data.status'
The key should appear in the host's authorized_keys file within one sync cycle.