Liongard Environment Management
Overview
Environments in Liongard represent customer organizations or sites being monitored. Each environment serves as the top-level container for all inspection activity, discovered systems, detections, and metrics associated with a particular client. Proper environment management is essential for organized MSP service delivery.
Environment Fields
Core Fields
| Field | Type | Required | Description | |-------|------|----------|-------------| | ID | int | System | Auto-generated unique identifier | | Name | string | Yes | Environment display name | | Description | string | No | Optional description text | | Status | string | No | Active or Inactive (default: Active) | | Visible | boolean | No | Visibility in UI (default: true) | | Tier | string | No | Service tier classification | | CreatedOn | datetime | System | Creation timestamp | | UpdatedOn | datetime | System | Last update timestamp |
Extended Fields
| Field | Type | Description | |-------|------|-------------| | AgentCount | int | Number of agents associated | | LaunchpointCount | int | Number of configured inspections | | SystemCount | int | Number of discovered systems | | DetectionCount | int | Number of active detections |
API Patterns
List All Environments (v1)
GET /api/v1/environments?page=1&pageSize=100
X-ROAR-API-KEY: {api_key}
Response:
{
"Data": [
{
"ID": 1234,
"Name": "Acme Corporation",
"Description": "Primary client environment",
"Status": "Active",
"Visible": true,
"Tier": "Premium",
"CreatedOn": "2023-01-15T10:00:00Z",
"UpdatedOn": "2024-02-01T14:30:00Z"
}
],
"TotalRows": 150,
"HasMoreRows": true,
"CurrentPage": 1,
"TotalPages": 2,
"PageSize": 100
}
List Environments (v2)
The v2 endpoint supports POST-based filtering with conditions:
POST /api/v2/environments
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Pagination": {
"Page": 1,
"PageSize": 100
},
"conditions": [
{
"path": "Status",
"op": "eq",
"value": "Active"
}
],
"fields": ["ID", "Name", "Status", "Tier"],
"orderBy": [
{
"path": "Name",
"direction": "asc"
}
]
}
Get Environment by ID
GET /api/v1/environments/{environmentId}
X-ROAR-API-KEY: {api_key}
Response:
{
"ID": 1234,
"Name": "Acme Corporation",
"Description": "Primary client environment",
"Status": "Active",
"Visible": true,
"Tier": "Premium",
"CreatedOn": "2023-01-15T10:00:00Z",
"UpdatedOn": "2024-02-01T14:30:00Z",
"AgentCount": 2,
"LaunchpointCount": 15,
"SystemCount": 47,
"DetectionCount": 3
}
Get Environment Count
GET /api/v1/environments/count
X-ROAR-API-KEY: {api_key}
Response:
{
"Count": 150
}
This is a lightweight endpoint useful for health checks and dashboard summaries.
Create Environment
POST /api/v1/environments
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Name": "New Company Inc",
"Description": "Managed services client",
"Status": "Active",
"Visible": true,
"Tier": "Standard"
}
Response:
{
"ID": 5678,
"Name": "New Company Inc",
"Description": "Managed services client",
"Status": "Active",
"Visible": true,
"Tier": "Standard",
"CreatedOn": "2024-02-15T09:00:00Z",
"UpdatedOn": "2024-02-15T09:00:00Z"
}
Update Environment
PUT /api/v1/environments/{environmentId}
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Name": "New Company Inc - Updated",
"Description": "Premium managed services client",
"Tier": "Premium"
}
Delete Environment
DELETE /api/v1/environments/{environmentId}
X-ROAR-API-KEY: {api_key}
Warning: Deleting an environment removes all associated launchpoints, systems, detections, and historical inspection data. This action cannot be undone.
Environment Groups
Overview
Environment Groups (v2) provide logical grouping of environments for organizational purposes. Groups help MSPs manage large numbers of clients by category, region, or service level.
List Environment Groups
GET /api/v2/environment-groups
X-ROAR-API-KEY: {api_key}
Response:
{
"Data": [
{
"ID": 10,
"Name": "Tier 1 - Premium",
"Description": "Premium service level clients",
"EnvironmentCount": 25
},
{
"ID": 11,
"Name": "Tier 2 - Standard",
"Description": "Standard service level clients",
"EnvironmentCount": 75
}
]
}
Create Environment Group
POST /api/v2/environment-groups
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Name": "East Coast Clients",
"Description": "Clients in the eastern US region"
}
Update Environment Group
PUT /api/v2/environment-groups/{groupId}
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Name": "East Coast Clients - Updated",
"Description": "All eastern US and Canada clients"
}
Delete Environment Group
DELETE /api/v2/environment-groups/{groupId}
X-ROAR-API-KEY: {api_key}
Note: Deleting a group does not delete the environments within it. They are simply ungrouped.
Related Entities
Get Launchpoints for Environment
GET /api/v1/launchpoints?environmentId={environmentId}&page=1&pageSize=100
X-ROAR-API-KEY: {api_key}
Get Systems for Environment
GET /api/v1/systems?environmentId={environmentId}&page=1&pageSize=100
X-ROAR-API-KEY: {api_key}
Get Agents for Environment
GET /api/v1/agents?environmentId={environmentId}
X-ROAR-API-KEY: {api_key}
Get Detections for Environment
POST /api/v1/detections
X-ROAR-API-KEY: {api_key}
Content-Type: application/json
{
"Pagination": {
"Page": 1,
"PageSize": 100
},
"conditions": [
{
"path": "EnvironmentID",
"op": "eq",
"value": 1234
}
]
}
Integration Mappings
Environments can be mapped to external systems (PSA tools, RMM platforms) for cross-platform correlation:
GET /api/v1/environments/{environmentId}/integrationmappings
X-ROAR-API-KEY: {api_key}
Bulk Operations
Bulk Status Update
To update multiple environments at once, iterate with rate limiting:
async function bulkUpdateStatus(environmentIds, status) {
const results = [];
for (const id of environmentIds) {
const result = await fetch(
`https://${instance}.app.liongard.com/api/v1/environments/${id}`,
{
method: 'PUT',
headers: {
'X-ROAR-API-KEY': process.env.LIONGARD_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({ Status: status })
}
);
results.push({ id, success: result.ok });
// Respect rate limits
await sleep(200);
}
return results;
}
Export All Environments
async function exportAllEnvironments() {
const environments = [];
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await fetch(
`https://${instance}.app.liongard.com/api/v1/environments?page=${page}&pageSize=500`,
{
headers: { 'X-ROAR-API-KEY': process.env.LIONGARD_API_KEY }
}
);
const data = await response.json();
environments.push(...data.Data);
hasMore = data.HasMoreRows;
page++;
}
return environments;
}
Common Workflows
New Client Onboarding
- Create environment - Add the new customer organization
- Assign to group - Place in appropriate environment group
- Set tier - Configure service tier for SLA tracking
- Deploy agent - Install agent on client infrastructure
- Configure launchpoints - Set up inspectors for rel