How do I automate agent deployment across multiple organizations?
If you manage multiple Nanitor organizations — for example as an MSP serving many customers — you can use the Organizations API to retrieve signup URLs programmatically and map them to your RMM platform for automated agent deployment.
The Problem
When onboarding many customer organizations, MSPs typically need to:
- Create each organization in Nanitor
- Find the signup URL for each organization (by navigating into it in the UI)
- Copy that URL into their RMM platform (Datto, NinjaOne, etc.) to deploy agents
This manual process becomes tedious when managing dozens of organizations. Starting with Nanitor 6.8.0, the Organizations API returns the signup_url field, allowing you to retrieve all signup URLs in a single API call.
Prerequisites
- Nanitor server version 6.8.0 or later
- An API key with read access (see REST API for how to create one)
- API service running on the Nanitor server
Retrieving Signup URLs via API
Export all organizations with their signup URLs
curl -s 'https://<your-nanitor-server>/system_api/organizations/' \
-H 'Authorization: Bearer <your-api-key>' | jq '.items[] | {name, id, slug, signup_url}'
Example response:
{
"name": "Acme Corp",
"id": 1,
"slug": "acme-corp",
"signup_url": "https://your-nanitor-server.com/signup/acme-corp"
}
{
"name": "Globex Industries",
"id": 2,
"slug": "globex-industries",
"signup_url": "https://your-nanitor-server.com/signup/globex-industries"
}
Export as CSV for spreadsheet or RMM import
curl -s 'https://<your-nanitor-server>/system_api/organizations/' \
-H 'Authorization: Bearer <your-api-key>' \
| jq -r '.items[] | [.name, .slug, .signup_url] | @csv'
This produces output like:
"Acme Corp","acme-corp","https://your-nanitor-server.com/signup/acme-corp"
"Globex Industries","globex-industries","https://your-nanitor-server.com/signup/globex-industries"
Get a specific organization's signup URL
curl -s 'https://<your-nanitor-server>/system_api/organizations/<org-id>' \
-H 'Authorization: Bearer <your-api-key>' | jq '.item.signup_url'
Mapping to RMM Platforms
The primary use case for this API is mapping Nanitor signup URLs to your RMM platform tenants (Datto RMM, NinjaOne, etc.) so that agent deployment is automated per customer.
Typical workflow
- Export Nanitor organizations using the API call above to get names, slugs, and signup URLs
- Match to RMM tenants by organization name or slug — the
slugfield is a URL-safe identifier you set when creating the organization - Store the signup URL in your RMM platform's site/tenant custom fields
- Configure deployment scripts in the RMM to use the stored signup URL when deploying the Nanitor agent to new devices
Example: Mapping to NinjaOne or Datto RMM
Most RMM platforms support custom fields per site or tenant. The approach is:
- Create a custom field in your RMM (e.g.,
nanitor_signup_url) - For each RMM tenant, populate it with the matching Nanitor signup URL from the API
- Reference that field in your agent deployment script
Agent Deployment Scripts
Once you have the signup URL mapped in your RMM, use it in deployment scripts.
Windows (SCCM, Intune, PDQ, or RMM script)
# $signupUrl comes from RMM custom field or API lookup
msiexec.exe /i "nanitor-agent.msi" ACCEPTEULA="yes" SIGNUP_URL="$signupUrl" /qn
For more Windows options, see How do I install/distribute the Nanitor Agent on Windows?.
Linux / macOS
# $SIGNUP_URL comes from RMM custom field or API lookup
curl -sS "$SIGNUP_URL" | sudo bash
For more details, see How do I install Nanitor Agent on Linux/BSD/Mac?.
Batch deployment via API lookup
If you prefer to look up signup URLs dynamically rather than pre-mapping them:
#!/bin/bash
# Deploy Nanitor agent to hosts across multiple organizations
# Usage: ./deploy_agents.sh <host-list-file>
# host-list-file format: one line per host as "hostname org_id"
NANITOR_API="https://your-nanitor-server.com/system_api"
API_KEY="your-api-key"
while read -r host org_id; do
signup_url=$(curl -s "${NANITOR_API}/organizations/${org_id}" \
-H "Authorization: Bearer ${API_KEY}" | jq -r '.item.signup_url')
if [ -z "$signup_url" ] || [ "$signup_url" = "null" ]; then
echo "ERROR: No signup URL for org ${org_id}, skipping ${host}"
continue
fi
echo "Deploying to ${host} (org: ${org_id})..."
ssh "$host" "curl -sS '${signup_url}' | sudo bash"
done < "$1"
See Also
- REST API — API key setup and basic usage
- Finding your Signup URL — manual UI-based approach
- Multi-Tenancy Options — overview of organization structures for MSPs
- How do I install Nanitor Agent on Linux/BSD/Mac?
- How do I install/distribute the Nanitor Agent on Windows?