LeanIX offers various APIs that allow you to read and manipulate data. In this guide, you will get an overview of our APIs and learn the key use cases for each API.
|REST APIs provide access to various resources, such as the Meta Model, Workspace settings, Users, Metrics, Surveys, and more. Use these APIs to integrate with systems that support RESTful interactions.
|Use the GraphQL API to work with your Fact Sheets and related data. Retrieve and update data in your Fact Sheets using GraphQL queries and mutations.
|Integrate with external platforms using the Integration API. Leverage the advantages of our custom LeanIX Data Interchange Format (LDIF) that the Integration API uses to process data.
For some scenarios, you can complete a task using several types of APIs.
LeanIX REST APIs provide access to various resources, such as the Meta Model, Workspace settings, Users, Metrics, Surveys, and more. Use these APIs to integrate with systems that support RESTful interactions.
In this section, you can find an overview of the most frequently used REST APIs.
The OpenAPI Explorer allows you to discover LeanIX REST APIs, send API requests, and view responses from APIs right in your browser.
To navigate to the OpenAPI Explorer from your Workspace, on the user menu, select Administration. Under Discovery & Integrations, select Developer Tools, and then select Browse API.
Your endpoint base URL (often referred to with the variable
base_url in our public scripts and tutorial examples) will vary depending the domain of your workspace. The simplest way to determine your endpoint base URL is to pull it directly from the URL displayed in your browser when navigating your workspace
Information about used applications, technologies, projects and more objects can be stored in the IT Inventory of LeanIX. LeanIX provides a Meta-Model called "Fact Sheets" out of the box. Via Pathfinder API you can interact with this Meta-Model.
|All Fact Sheets Types: Applications, IT Components, Projects, ...
<base_url>/services/pathfinder/v1, e.g. https://app.leanix.net/services/pathfinder/v1
MTM stands for Multi-Tenancy Manager. It is a central service of LeanIX to manage workspaces and user accounts. It also provides OAuth2 endpoints for authentication of users.
Not all resources with the MTM API are available to ADMINs. There are endpoints that are visible within the Swagger documentation which are only available to LeanIX employees. Such are marked as "Restricted to LeanIX internal use only." in the endpoint description.
Below is a list of the resources available to customers. Please note that this is not the exhaustive list.
|apiTokens:Manage api tokens
|notificationsBatches:User notification batches
|technicalUser:Manage technical user
Admins role cannot see all API Tokens in a workspace. API tokens are personalized identification tokens specific to a user. The user's credentials are part of the encryption of the token. This is also what binds API-tokens to a specific user, any updates performed by the API token will be performed in the user's name. It is by design that API tokens are not visible to other users, even Admins. If you have shared services (Integrations, webhooks, etc.) which use API-tokens which you would like multiple people to have access to please make use of the technical user functionality. The technical user functionality is designed with that use case in mind.
Who can see what:
- User X is only able to see their own API-tokens.
- Even the SUPERADMIN support user can only see our own tokens.
Additionally, the moment an Admin archived a user all issued API-tokens for that user become invalid immediately.
We have configured it in such a way that the tokens will expire after a specific time period due to inactivity.
Please see the highlighted image below for the specific endpoints available to ADMINs under workspaces:Manage workspaces:
<base_url>/services/mtm/v1, e.g. https://app.leanix.net/services/mtm/v1
Please do not use API tokens if you have central management as a requirement. We offer Technical users for such use cases. Technical user tokens can be generated by an administrator and will be manageable and visible by all administrators in our UI.
For user management, please always use the endpoint:
USA customers please utilize:
Also, see User Management
Webhooks allows you to receive information about events as they happen near real-time in LeanIX. You can then extend, customize, and integrate LeanIX with your own extensions or even with other applications.
<base_url>/services/webhooks/v1, e.g. https://app.leanix.net/services/webhooks/v1**
Webhooks allow an application in LeanIX to supply other applications with real-time information. In contrast to traditional APIs where to get up-to-date information, the app would need to send a request. This makes webhooks an efficient choice for providers and consumers.
What are events? Events in this context are actions that end users take within an application. Some examples are entering a response within an attribute such as the Description field, creating a new Fact Sheet, or even logging into LeanIX. When you need an event-driven integration, webhooks are the answer. One such use case is when you need to trigger notifications to be sent based on when a Fact Sheet (or an attribute/field on the Fact Sheet(s)) is updated, created, or deleted**.
Many systems offer a built-in user interface to allow end-users to easily create simple webhooks. LeanIX offers a user interface within the Administration area of your workspace in addition to an API endpoint.
To get an introduction to webhooks please see the "Getting Started Webhooks" documentation.
Build a Slack Bot using webhooks.
The technical suitability is updated on a Fact Sheet, this event can trigger a tag to be automatically added to the Fact Sheet. Please see the Azure Function Tutorial: TIME tutorial for an example of this implemented with Webhooks and Azure function.
Utilizing the responses from a LeanIX survey to calculate a particular score and the score can be automatically set to be associated with a Fact Sheet.
The Metrics add-on allows you to store time-series data in LeanIX. This data can come from various sources which are relevant to Business, Development or Operations.
<base_url>/services/metrics/v1, e.g. https://app.leanix.net/services/metrics/v1
With Metrics, you can store time series data in LeanIX and create interactive charts to display the data. In addition, the data can be linked to Fact Sheets presented on Dashboard or be displayed within the Reports area.
Metrics consist of several objects including measurements. Measurements contain data-points stored over time, which are related to the same topic. Each data-point is stored for a specific moment and has one or more values for that instance of time.
Metrics are very specific to cases when there are data points that are time based. One such example is when expenses or other costs need to be understood on the basis of time.
For more information please see Getting Started with Metrics.
With the Survey add-on, admins can design own questionnaires in LeanIX which they send out to get the answers from users. The results of the surveys are displayed in context of LeanIX and can be accessed via API.
GraphQL allows you to query the data on your Fact Sheets as well as mutate (e.g update, delete) the data. In addition, GraphQL is utilized to create custom reports, specifically to pull data from the workspace and present it using charts and other graphics.
Learn more about our GraphQL API.
Use the built-in GraphiQL tool available within your LeanIX Administration area when you need answers to your Fact Sheet data. In addition, the GraphiQL tool allows you to interactively develop and test queries and mutations. Which later can be utilized in scripts to automate work or custom reports.
To open the GraphiQL tool, in the administration area, select Developer Tools, then select GraphiQL.
To view detailed information, see Integration API.
The Integration API is extremely flexible and powerful. One of the main reasons is at the heart it is driven by a generic LeanIX Data Interchange Format (LDIF). This imparts many benefits, which include but are not limited to:
Complexity is minimized as developers no longer have to understand the LeanIX Meta-Model
No longer have to map logic inside a code
The Integration API can be utilized to build an integration between LeanIX and another vendor system. One major advantage is that the CRUD operations for any inbound (other vendor system to LeanIX ) is managed within LeanIX, which removes a great deal of complexity.
The ability to define variables, exceptions, use JUEL expressions to extract or import only particular values that meet what you define, is powerful.
In addition, there are other benefits imparted by the Integration API that are not specifically related to the LDIF structure:
Configuration for LeanIX is contained in every connector
Integration now possible even if the external system does not allow direct access
No need for a direct REST connection
Flexible error handling, no failure due to a single or even multiple data issues. Data that does not meet the requirements, is simply ignored
Cross-cutting concerns are part of the API and in each connector
It can also be used to import/export from your workspace. This can be useful in cases where the built in import/export functionality doesn't have the capability that is required. An example of such a case are attributes which exist on relations. At this time it is not possible to mass update attributes on relations using the UI.
The flexibility of the Integration API shines in more complex cases such as: when the data from the source system is not in a "clean" state. In this case the Integration API would be a good option due to its error handling capabilities. It is flexible and any errors can be ignored (this is not the case with built-in Inventory import/export or GraphQL). In addition, the Integration API supports the use of JUEL/RegEx which imparts the ability to transform the source data, for example you can utilize .sum() to add up costs and then file that into a cost attribute in LeanIX. Please see the Integration API documentation for detailed information.
- Build an integration with an external system for example ITSM Integration.
- Make one-off updates to your workspace which you would normally use in the import/export functionality via UI.
- Merge two or more separate physical workspaces. This might be necessary in case of an acquisition or merger.
The Integration API provides the ability to import/export data using a generic LeanIX Data Interchange Format (LDIF). LDIF is a JSON format with a very simple structure described in the following sections. In addition, building integrations between LeanIX and other vendor systems is simplified using the Integration API. One of the reason is because all mapping and processing of the incoming and outgoing data is done using "Data Processors" that are configured behind the API. For detailed information including use cases please see Integration API.