Using LogicMonitor's REST API
Last updated on 09 January, 2025Recommendation: Use LogicMonitor REST API v3 to programmatically leverage the latest features and enhancements. LogicMonitor does not add new features endpoints to earlier API versions. If you are leveraging earlier versions of the API, see About REST API v2 or About REST API v1.
For more information regarding LogicMonitor’s sunset updates of the REST API, see Updates for LogicMonitor REST API v1, v2, and v3 in the Community.
The LogicMonitor REST API will allow you to programmatically query and manage your LogicMonitor resources: dashboards, devices, reports, services, alerts, collectors, datasources, SDTs and more.
Base URL
The base URL for making REST API requests is:
https://ACCOUNTNAME.logicmonitor.com/santaba/rest
Here, you must replace ACCOUNTNAME
with your LogicMonitor account name.
Supported API Versions
LogicMonitor REST APIs are available in three versions: v3, v2, and v1. You must consider the following guidelines to decide the version you want to use:
- We follow Semantic versioning, but only major version is allowed in requests (the most recent minor / patch versions will always be returned)
- All the updates and enhancements will be done to version 3 ONLY.
- Version can be specified in an X-Version header, or in the URL as a query parameter. You can make v3 requests by including a ‘?v=3’ query parameter or by including a ‘X-Version:3’ header.
To access the latest v3 APIs, see v3 Swagger Documentation.
Authentication
Each request sent to the LogicMonitor server must be made over HTTPS, and must also be authenticated. All data is received as JSON. LogicMonitor REST API currently supports three authentication methods:
- Bearer token
- LMv1
- Basic authentication
Note: Basic Authentication is only supported in v1 of the API, and may not be available with future versions of the API. Therefore, we highly recommend that you make REST API requests with API token based authentication (LMv1 and Bearer token).
For more information, see REST API Authentication.
Rate Limit
Rate limits are imposed for requests to LogicMonitor REST API. Limits vary per endpoint and method combination. For a listing of default rate limits, details on pulling rate limit information from response headers, and several cross-language examples of how to adjust scripts to accommodate rate limits, see REST API Rate Limit.
Status Codes and Error Codes
With each API version that we rolled out, we have evolved and improved the Status codes and Error codes. To access the list, see Status codes and Error codes.
Change Log
LogicMonitor REST APIs are constantly evolving. To track all the updates done to our APIs, see Change Log.
Supported HTTP Methods
LogicMonitor REST API use the globally-used HTTP verbs or methods. They are POST, GET, PUT, PATCH, and DELETE. These methods correspond to Create, Read/Retrieve, Update, and Delete (aka CRUD) operations, respectively.
- POST– POST APIs are typically used to create new subordinate resources. LogicMonitor REST API use POST method to add API tokens, Dashboard groups, and so on. For example, POST/dashboard/groups and POST/setting/alert/chains.
- GET– Use the GET request to read/retrieve resource information. You can use the GET method to get a representation of your resource’s content and data. For example, GET/alert/alerts/{id} and GET/dashboard/groups/{id}.
- PUT– Use the PUT method to update a resource by completely replacing its content. Consistent with REST standards, any properties not specified in a PUT request will revert back to their default values. Examples of PUT requests are PUT/setting/alert/chains/{id} and PUT/setting/recipientgroups/{id}.
- PATCH– Use the PATCH method to update/modify resource content. In your PATCH request you must specify the updates you want to make to the resource. For example, PATCH/report/reports/{id} and PATCH/setting/roles/{id}.
- DELETE– Use the DELETE method to delete a resource identified by a URI. The resource is removed entirely. For example, DELETE/sdt/sdts/{id} and DELETE/setting/recipientgroups/{id}.
Auto-throttling of External GET APIs
To ensure a consistent and reliable experience with LogicMonitor REST API, LogicMonitor has implemented auto-throttling mechanism for the external GET
API calls. When the server resource usage reaches critically high levels, only the external GET
API calls are automatically throttled and users receive the “1000 - Server is busy
” error. Once the server resource usage returns to normal, the throttling is lifted, and the external GET
API calls are once again permitted automatically.
Note: During auto-throttling, the POST
, PATCH
, PUT
, and DELETE
external API calls continue unaffected.
Recommendation: When you get the “1000 - Server is busy
” error, you can manually retry making the GET
call after a few seconds. If you are making the GET
API call using an automation script, you can add a retry mechanism to retry making the GET
API call after some delay.
LogicMonitor SDK
In addition to the REST APIs, LogicMonitor also supports Python and GO SDKs. You must authenticate yourself before using the GO and Python SDK. To authenticate yourself, you can either use an LMv1Auth or a Bearer token. To get the downloadable v3 SDK files, see LogicMonitor v3 SDK.
Additional APIs
LogicMonitor supports some API endpoints that are not included in the LogicMonitor REST API Swagger file. This section highlights such APIs and provides guidance to further explore them.
Logs Ingest APIs
The Logs Ingest APIs enable you to send custom logs directly to your LogicMonitor account. The received events are mapped to resources in LogicMonitor before they are further processed or stored. For more information, see Sending Logs to Ingestion API.