Mass Deployment
Provision hundreds of nodes with a single command
Overview
The Deploy Token lets you provision Flowtriq nodes programmatically without logging into the dashboard. Generate a workspace deploy token, then use it in your automation (Ansible, Terraform, cloud-init, bash scripts) to register nodes and receive API keys in one step.
Each node created via the deploy token is billed instantly on your workspace's current billing term. If you're on a trial, nodes are free until the trial ends. Any active promo codes or discounts on your subscription apply automatically to new nodes.
Step 1: Generate a Deploy Token
Go to Settings → Workspace and find the Mass Deployment Token card. Click Generate Deploy Token.
Your token is a 64-character hex string. Treat it like a password. Anyone with the token can create nodes in your workspace and increase your bill.
Security: Store your deploy token in environment variables or a secrets manager. Never commit it to version control. Revoke it immediately from Settings if compromised.
Step 2: Deploy Nodes via API
Send a POST request to /api/deploy with your token in the Authorization header:
curl -s https://flowtriq.com/api/deploy \
-H "Authorization: Bearer YOUR_DEPLOY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-prod-3",
"ip": "203.0.113.10",
"location": "US-East",
"os": "Ubuntu 24.04",
"interface": "eth0"
}'
Request fields
| Field | Required | Description |
| name | Yes | Unique node name within your workspace |
| ip | Yes | IPv4 or IPv6 address of the server |
| location | No | Data center or region label |
| os | No | Operating system |
| interface | No | Network interface to monitor (default: eth0) |
Response
{
"ok": true,
"node_uuid": "a1b2c3d4-...",
"api_key": "64-char-hex-api-key-for-this-node",
"name": "web-prod-3",
"ip": "203.0.113.10"
}
The api_key in the response is the node's unique API key for sending data to Flowtriq. Use it to configure the agent on that server.
Step 3: One-Liner Auto-Deploy
Run this single command as root on any Linux server. It registers the node, installs ftagent, writes the config file, enables the systemd service, and starts monitoring — all in one shot:
# Full deploy: register + install + configure + enable + start
bash -c 'R=$(curl -sf https://flowtriq.com/api/deploy \
-H "Authorization: Bearer $FLOWTRIQ_DEPLOY_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$(hostname)\",\"ip\":\"$(curl -s ifconfig.me)\"}") \
&& eval $(echo "$R" | python3 -c "import sys,json;d=json.load(sys.stdin);print(\"API_KEY=\"+d[\"api_key\"]+\" NODE_UUID=\"+d[\"node_uuid\"])") \
&& pip install ftagent --break-system-packages -q \
&& mkdir -p /etc/ftagent /var/lib/ftagent/pcaps \
&& echo "{\"api_key\":\"$API_KEY\",\"api_base\":\"https://flowtriq.com/api/v1\",\"node_uuid\":\"$NODE_UUID\",\"interface\":\"eth0\",\"pcap_path\":\"/var/lib/ftagent/pcaps\"}" > /etc/ftagent/config.json \
&& chmod 600 /etc/ftagent/config.json \
&& ftagent --install-service \
&& systemctl enable ftagent \
&& systemctl start ftagent \
&& echo "Done — node registered and ftagent running"'
What this does, step by step:
- Calls the deploy API with the server's hostname and public IP to register the node
- Extracts the
api_key and node_uuid from the API response
- Installs
ftagent from pip
- Creates
/etc/ftagent/config.json with the API key, node UUID, and default settings
- Installs the systemd service unit via
ftagent --install-service
- Enables the service (starts on boot) and starts it immediately
Python 3.11+ note: On newer distros (Ubuntu 23.04+, Debian 12+, Fedora 38+), pip requires the --break-system-packages flag to install globally (already included above). Alternatively, use a virtualenv: python3 -m venv /opt/ftagent && /opt/ftagent/bin/pip install ftagent
Custom interface? If your server's primary interface isn't eth0, edit /etc/ftagent/config.json after deployment and restart: systemctl restart ftagent
Ansible Playbook
Deploy across your entire fleet with Ansible:
# deploy-flowtriq.yml
- hosts: all
vars:
flowtriq_token: "{{ lookup('env', 'FLOWTRIQ_DEPLOY_TOKEN') }}"
tasks:
- name: Register node with Flowtriq
uri:
url: https://flowtriq.com/api/deploy
method: POST
headers:
Authorization: "Bearer {{ flowtriq_token }}"
Content-Type: application/json
body_format: json
body:
name: "{{ inventory_hostname }}"
ip: "{{ ansible_default_ipv4.address }}"
os: "{{ ansible_distribution }} {{ ansible_distribution_version }}"
location: "{{ datacenter | default('') }}"
status_code: 200
register: flowtriq_result
- name: Install ftagent
pip:
name: ftagent
extra_args: --break-system-packages
- name: Create config directory
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- /etc/ftagent
- /var/lib/ftagent/pcaps
- name: Write ftagent config
copy:
content: |
{"api_key":"{{ flowtriq_result.json.api_key }}","api_base":"https://flowtriq.com/api/v1","node_uuid":"{{ flowtriq_result.json.node_uuid }}","interface":"eth0","pcap_path":"/var/lib/ftagent/pcaps"}
dest: /etc/ftagent/config.json
mode: '0600'
- name: Install systemd service
command: ftagent --install-service
- name: Enable and start ftagent
systemd:
name: ftagent
enabled: true
state: started
daemon_reload: true
Cloud-Init / User Data
Add this to your cloud-init or EC2/GCP user data to auto-register on boot:
#!/bin/bash
# cloud-init / user-data script
DEPLOY_TOKEN="your-deploy-token-here"
# Register with Flowtriq and capture API key
RESULT=$(curl -sf https://flowtriq.com/api/deploy \
-H "Authorization: Bearer $DEPLOY_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$(hostname)\",\"ip\":\"$(curl -s ifconfig.me)\",\"os\":\"$(lsb_release -ds 2>/dev/null || cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2 | tr -d '\"')\"}")
API_KEY=$(echo "$RESULT" | python3 -c "import sys,json;print(json.load(sys.stdin)['api_key'])")
NODE_UUID=$(echo "$RESULT" | python3 -c "import sys,json;print(json.load(sys.stdin)['node_uuid'])")
# Install agent and write config
pip install ftagent --break-system-packages -q
mkdir -p /etc/ftagent /var/lib/ftagent/pcaps
echo "{\"api_key\":\"$API_KEY\",\"api_base\":\"https://flowtriq.com/api/v1\",\"node_uuid\":\"$NODE_UUID\",\"interface\":\"eth0\",\"pcap_path\":\"/var/lib/ftagent/pcaps\"}" > /etc/ftagent/config.json
chmod 600 /etc/ftagent/config.json
# Install service, enable on boot, and start
ftagent --install-service
systemctl enable ftagent
systemctl start ftagent
Bash Loop (Bulk Register)
Register multiple servers from a CSV or list:
#!/bin/bash
# servers.txt: name,ip
# web-prod-1,203.0.113.10
# web-prod-2,203.0.113.11
while IFS=, read -r name ip; do
echo "Registering $name ($ip)..."
curl -s https://flowtriq.com/api/deploy \
-H "Authorization: Bearer $FLOWTRIQ_DEPLOY_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\":\"$name\",\"ip\":\"$ip\"}" | jq '{name:.name, api_key:.api_key}'
done < servers.txt
Error Codes
| HTTP | Error | Meaning |
| 401 | Invalid deploy token | Token is wrong, revoked, or missing |
| 400 | Node name / IP required | Missing required fields |
| 402 | Payment failed | No active subscription or payment issue |
| 409 | Duplicate name | A node with that name already exists |
Billing
- During trial: Nodes created via deploy token are free. Billing starts when your trial ends and you subscribe.
- Active subscription: Each new node is prorated and added to your current billing cycle immediately. If you're on monthly billing at $9.99/node, that's what each new node costs. If you're on annual at $7.99/node/month, the annual rate applies.
- Promo codes: Any active discount on your Stripe subscription applies automatically to new nodes.
- Removing nodes: Delete nodes from the dashboard to reduce your next invoice. Removals are prorated.
Revoking the Token
Go to Settings → Workspace and click Revoke. The token stops working immediately. You can generate a new one at any time. Revoking a token does not affect nodes that were already created with it.