API
Netwrix Change Tracker provides a comprehensive REST API that customers can use to integrate with the platform programmatically. This is particularly useful for customers who run multiple instances of Netwrix Change Tracker in multiple regions, as they can use the API to pull data from each instance and build global reports.
Authentication
All API endpoints require authentication. See Authentication for an example script.
API Reference
For an interactive reference of all Netwrix Change Tracker Hub API endpoints, see the Netwrix Change Tracker Hub API Reference. This reference comes from the Change Tracker Hub (the central management server) OpenAPI 3.0 spec and covers all available endpoints with request/response schemas.
The raw OpenAPI 3.0 spec (YAML) is also available for download.
Available Endpoints
The following API endpoints are available in Netwrix Change Tracker:
-
Agents – Pull data on agent statuses, configurations, and group memberships using the agentsRanked endpoint. Use this API to retrieve detailed information about all agents in your environment, including their group memberships and applied tracking templates.
-
Register Agents – Agents normally use this API to register with the Hub, but you can also use it to register proxied devices accessed through a proxy agent.
-
Credentials – Manage authentication credentials that Change Tracker uses to connect to various systems and services. This API provides endpoints for creating, retrieving, updating, and deleting credentials for different credential types including Shell, Database, FTP, Cloud, ESX, ITSM, and Splunk.
API Usage Best Practices
When working with the Change Tracker API, consider the following best practices:
-
Rate Limiting: Implement appropriate rate limiting in your applications to avoid overwhelming the API.
-
Error Handling: Always implement proper error handling in your code to gracefully handle API errors.
-
Authentication: Store API credentials securely and never expose them in client-side code.
-
Data Filtering: When retrieving large datasets, use the available filtering parameters to limit how much data the endpoint returns.
-
Pagination: For endpoints that return large collections, implement pagination to improve performance.
Example Usage
The following example shows how to use the API with PowerShell:
# Set up a session variable for the Admin user
$myWebSession = GetAdminUserSession
# Define the API endpoint
$uri = "https://changetracker.example.com/api/agentsRanked"
# Define the request body
$requestBody = @{
DeviceFilter = @{
GroupNames = @()
AgentDeviceIds = @()
AgentDisplayNames = @()
ExcludeProxiedDevices = $false
OnlineStatuses = @("Online")
}
GetAgentGroupDetails = $true
GetRelatedTemplates = $true
} | ConvertTo-Json
# Make the API request
$result = Invoke-RestMethod -Method Post -ContentType application/json -Uri $uri -WebSession $myWebSession -Body $requestBody
See the Available Endpoints section for documentation pages covering each API endpoint.