Insights & updates from our experts
Overview
Connects to Lansweeper via the Lansweeper GraphQL Data API to read sites, installations, asset types, and assets from your Lansweeper environment.
Prerequisites
- A Lansweeper account with API access.
- An OAuth application registered in Lansweeper. See the Quickstart guide for setup instructions. Use the Get OAuth Refresh Token action to obtain the Refresh Token.
Authentication
Uses OAuth 2.0 refresh token flow. Configure the connection with the Client ID, Client Secret, and Refresh Token from your Lansweeper OAuth application.
Triggers
None. Outbound only.
Actions
Get OAuth Refresh Token
Exchanges an OAuth 2.0 authorization code for access and refresh tokens.
Input:
client_id(required) — OAuth application client IDclient_secret(required) — OAuth application client secretcallback_url(required) — redirect URI used in the authorization requestauthorization_code(required) — authorization code received from Lansweeper
Output:
response(required) — full HTTP response from the token endpointstatus— HTTP status code (200 for success, 400/401 for errors)body— raw response body (JSON-encoded token response)headers— response headers as{ name, value }entriesrefresh_token— refresh token from the response body; empty string if the request failed
Use case: obtain the long-lived refresh token used to configure a Lansweeper connection.
Example Output: success:
{
"response": {
"status": 200,
"body": "{"access_token":"eyJhbGciOi...","token_type":"Bearer","expires_in":3600,"refresh_token":"def502..."}",
"headers": [
{"name": "content-type", "value": "application/json"},
{"name": "x-rate-limit", "value": "100"}
]
},
"refresh_token": "def502..."
}
Example Output: error:
{
"response": {
"status": 400,
"body": "{"error":"invalid_grant","error_description":"Invalid authorization code"}",
"headers": [
{"name": "content-type", "value": "application/json"}
]
},
"refresh_token": ""
}
Get Sites
Returns all sites your OAuth application can access.
Input: None.
Output: List of sites, each with site_id and site_name.
Use case: discover available sites or validate access.
Get Installations
Returns all installations for a specified site. Each installation is a Lansweeper server or data source.
Input:
site_id(required) — unique identifier of the site
Output: List of installations with ID, name, FQDN, type, asset count, and sync status.
Use case: discover installations within a site, or scope asset queries by installation.
Example Input:
{
"site_id": "12345678-1234-1234-1234-123456789012"
}
Example Output:
{
"installations": [
{
"installation_id": "11111111-1111-1111-1111-111111111111",
"site_id": "12345678-1234-1234-1234-123456789012",
"name": "Main Server",
"fqdn": "lansweeper.example.com",
"type": "OnPremise",
"total_assets": 1500,
"sync_server_status": "Online"
}
]
}
Get Asset Types
Returns all asset type names for a site (e.g. Computer, Printer, Network Device).
Input:
site_id(required) — unique identifier of the site
Output: Array of asset type name strings.
Use case: discover available asset types, or scope Get Assets by type.
Example Input:
{
"site_id": "12345678-1234-1234-1234-123456789012"
}
Example Output:
{
"asset_types": ["Computer", "Printer", "Network Device", "Mobile Device"]
}
Get Assets
Returns paginated assets for a site, with filtering by asset type, installation, IP address presence, and last-seen date.
Input:
site_id(required) — unique identifier of the siteimport_type(optional, default:all) —all,ip_only, orselected_types_onlyasset_types(conditional) — asset type names to filter by; required whenimport_typeisselected_types_onlyinstallation_handling(optional, default:all) —allorselected_onlyinstallation_ids(conditional) — installation IDs to filter by; required wheninstallation_handlingisselected_onlycutoff_time(optional) — return assets last seen after this time; defaults to 30 days ago
Output: Paginated list of assets including name, type, IP address, last-seen timestamps, manufacturer, model, OS, installed software, hardware specs, and user associations (encrypted).
Use case: asset inventory, device discovery, compliance monitoring, or ITSM integration.
Example Input — defaults:
{
"site_id": "12345678-1234-1234-1234-123456789012"
}
Example Input — selected installations:
{
"site_id": "12345678-1234-1234-1234-123456789012",
"import_type": "all",
"installation_handling": "selected_only",
"installation_ids": ["11111111-1111-1111-1111-111111111111"]
}
Example Input — selected asset types:
{
"site_id": "12345678-1234-1234-1234-123456789012",
"import_type": "selected_types_only",
"asset_types": ["Computer", "Server", "Laptop"]
}
Example Input — custom cutoff time:
{
"site_id": "12345678-1234-1234-1234-123456789012",
"cutoff_time": "2024-01-01T00:00:00Z"
}
Rate Limiting
Lansweeper enforces these limits on Data API queries (see API restrictions):
- Up to 150 requests per minute; exceeding this triggers a one-minute cooldown.
- Up to 2000 synchronous requests per hour.
- Up to 30 element paths per
assetResourcesquery. - Up to 100 filter conditions per query.
- Up to 4 MB response size per page.
| HTTP status | Connector behaviour |
|---|---|
| 429 Too Many Requests | Retry after Retry-After seconds (60 s default if header absent) |
| 503 Service Unavailable | Retry with backoff |
| 401 / 403 | Fail immediately; credential or permission issue |
| Other 4xx | Fail immediately with error from Lansweeper |
Best Practices
- Incremental syncs: Set
cutoff_timeon Get Assets to the timestamp of your last successful sync. Use the maxlast_seenfrom that run as the nextcutoff_time. - Narrow by asset type: Use
import_type = selected_types_onlywithasset_types = [...]to reduce payload and GraphQL query cost. - Narrow by installation: In multi-installation environments, call Get Installations first, then pass selected IDs via
installation_handling = selected_only+installation_idson Get Assets. - Discover IDs at runbook start: Call Get Sites → Get Installations → Get Asset Types early. Avoid hard-coding site or installation GUIDs.
- Refresh token: Run Get OAuth Refresh Token once during connection setup; store the token in the connection's Refresh Token field.
Common Use Cases
- CMDB sync: mirror Lansweeper assets into Xurrent's CMDB on a schedule.
- Incident enrichment: on incident creation, look up the affected host's asset details (IP, OS, installed software, hardware model).
- Licensing audit: pull
softwaresarrays across all assets to reconcile installed vs. licensed software. - Hardware lifecycle: filter by
warranty_dateoros_end_of_support_dateto identify assets due for refresh. - Change management: route change approvals using
state_nameandmanufacturer/model.























