Skip to content

SDK Quick Start

Get up and running with the UnboundBytes API in under 5 minutes. This guide covers authentication, making your first request, and common operations.

  • An UnboundBytes account with at least one device paired
  • An API key or JWT token (see Authentication)

No installation needed. Use any HTTP client.

Terminal window
export API_KEY="key_your_api_key_here"
export TENANT_ID="ten_your_tenant_id"
export BASE_URL="https://api.unboundbytes.com/v1"
Terminal window
curl -s "$BASE_URL/hosts" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" | jq '.data[] | "\(.hostname) - \(.status)"'
  1. Choose an app from the catalog
  2. Select a target device
  3. Create the deployment
Terminal window
# List app templates
curl -s "$BASE_URL/app-templates" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" | jq '.data'
# Create a deployment
curl -s -X POST "$BASE_URL/deployments" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "my-vaultwarden",
"appId": "app_vaultwarden",
"deviceId": "dev_abc123"
}' | jq
Terminal window
# Create a backup
curl -s -X POST "$BASE_URL/hosts/dev_abc123/backups" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" \
-H "Content-Type: application/json" | jq
# List backups
curl -s "$BASE_URL/hosts/dev_abc123/backups" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" | jq '.data'
Terminal window
# Create a tunnel
curl -s -X POST "$BASE_URL/hosts/dev_abc123/tunnels" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"targetPort": 8080, "protocol": "http"}' | jq
# Check tunnel health
curl -s "$BASE_URL/tunnels/tun_xyz789/health" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" | jq
Terminal window
# Check HTTP status code
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
"$BASE_URL/hosts/dev_nonexistent" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID")
if [ "$HTTP_STATUS" = "429" ]; then
echo "Rate limited. Check Retry-After header."
elif [ "$HTTP_STATUS" = "404" ]; then
echo "Device not found."
fi

List endpoints return paginated results. Use limit and offset query parameters:

// Fetch all devices with pagination
let offset = 0;
const limit = 50;
const allDevices: unknown[] = [];
while (true) {
const res = await fetch(`${BASE_URL}/hosts?limit=${limit}&offset=${offset}`, { headers: HEADERS });
const page = await res.json();
allDevices.push(...page.data);
if (!page.meta?.pagination?.hasMore) break;
offset += limit;
}
console.log(`Total devices: ${allDevices.length}`);

Subscribe to events for real-time notifications:

Terminal window
curl -s -X POST "$BASE_URL/webhooks" \
-H "x-api-key: $API_KEY" \
-H "x-ub-tenant-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.example.com/webhooks/unboundbytes",
"events": ["device.offline", "deployment.failed", "backup.completed"],
"secret": "whsec_your_signing_secret"
}' | jq

See the Webhooks API for the full list of available events.