--- title: "Get started with the Lansweeper API | Lansweeper Platform" slug: "get-started-with-the-lansweeper-api" description: "Get started with the Lansweeper Platform Data API. Create a personal access token, send your first GraphQL query, and find the Developer Portal docs." tags: ["Lansweeper Platform", "Integrations"] status: "update" updated: 2026-11-03T14:08:24Z published: 2026-11-03T14:08:24Z canonical: "docs.lansweeper.com/get-started-with-the-lansweeper-api" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lansweeper.com/llms.txt > Use this file to discover all available pages before exploring further. # Get started with the Lansweeper API Plan availability: Available on Pro and Enterprise plans The Lansweeper API can refer to the Data API, Platform API, or Device Recognition API. This article focuses on the Data API, which gives scripts access to asset data in your Lansweeper site. Use it to build custom integrations or pull data into reporting tools. For the full reference, see the [Lansweeper Developer Portal](https://developer.lansweeper.com/). ## What the Data API is The Data API is a GraphQL API. You send every request as a `POST` to a single endpoint, with a JSON body that contains your query: ``` https://api.lansweeper.com/api/v2/graphql ``` The Data API returns the IT, OT, and cloud asset data in the sites your API client can access. If you use Lansweeper Classic, link your installation to a Lansweeper Platform site first. The Data API reads the data that the linked installation syncs to that site. The Data API follows your plan. If your plan doesn't include a feature in Lansweeper Platform, the Data API doesn't return that feature's data either. Depending on the data, the request returns an error or leaves that data out of the response. ## What you can do with the Data API - **Query asset data**: list the sites you can access, retrieve assets with filters and pagination, get the full details of a single asset, and export large asset sets in bulk. - **Run actions**: request an IT Agent scan or delete assets. - **Subscribe to webhooks**: get notified when assets are created, updated, or deleted, when a new data source is added to the site, or when an export completes. Common uses include syncing assets to a CMDB or service desk, feeding software asset management and security tools, and building custom reports. No-code alternatives To connect Lansweeper to another tool without writing code, browse the [Explore the Marketplace](/docs/connect-integrations) articles or build a workflow with [Flow Builder](/docs/what-is-flow-builder). To query your data from an AI assistant, use the [Lansweeper MCP server](/docs/explore-lansweeper-mcp-server). ## Prerequisites - A Lansweeper Platform site on a Pro or Enterprise plan. - The **API Client Admin** role or the **View API clients** permission. - A tool that can send HTTP requests, such as cURL, Postman, or a scripting language. ## Choose an authentication method Every request needs an API client. Lansweeper Platform supports 2 types: | Detail | Personal access token (PAT) | OAuth | | --- | --- | --- | | Best for | Scripts and internal tools that you run yourself | Applications that other Lansweeper users connect to their own sites | | How it works | You generate a token and send it with every request | Users authorize your application, which exchanges an authorization code for an access token | | Expiry | You set the expiry date when you create the token | Access tokens expire, and your application renews them with a refresh token | | Request header | `Authorization: Token <your-token>` | `Authorization: Bearer <access-token>` | If you're building your first integration, start with a PAT. ## Create a personal access token 1. Sign in to Lansweeper Platform. 2. Select your profile picture, then select **Account settings**. 3. Select **Developer tools** > **API clients** > **Create API client**. 4. Select **Personal Access Token (PAT)**, then select **Next step**. 5. Enter the API client name and integration, set the expiry date, and select the sites the token can access. 6. Select **Create**. 7. Copy the token and store it somewhere safe. Copy the token now Lansweeper doesn't store the token, so you can't view it again after you close the dialog. If you lose it, select the token under **Developer tools**, then select **Refresh token**. To set up an OAuth client instead, follow the [OAuth section of the Developer Portal quickstart](https://developer.lansweeper.com/docs/data-api/get-started/quickstart#oauth/). ## Send your first request To check that your token works, list the sites it can access. Replace `YOUR_TOKEN` with your PAT: ``` curl --request POST "https://api.lansweeper.com/api/v2/graphql" \ --header "Authorization: Token YOUR_TOKEN" \ --header "Content-Type: application/json" \ --data '{"query": "{ authorizedSites { sites { id name } } }"}' ``` In Windows Command Prompt, use this equivalent command: ``` curl --request POST "https://api.lansweeper.com/api/v2/graphql" ^ --header "Authorization: Token YOUR_TOKEN" ^ --header "Content-Type: application/json" ^ --data-raw "{ \"query\": \"{ authorizedSites { sites { id name } } }\"}" ``` The response returns the ID and name of each site. Most other queries need a site ID, so note the one you want to use: ``` { "data": { "authorizedSites": { "sites": [ { "id": "401dxxxx-xxxx-xxxx-xxxx-xxxxxxxx48ca", "name": "Main office" } ] } } } ``` From here, use the `assetResources` query to retrieve assets from that site. The [getting data guide](https://developer.lansweeper.com/docs/data-api/guides/getting-data/) on the Developer Portal shows how to choose fields, filter, and paginate. ## Data API limits The Data API limits how much you can request, so plan your integration around these values: | Limit | Value | | --- | --- | | Requests per minute | 150 | | Synchronous requests per hour | 2,000 | | Bulk exports per hour | 100, with 1 export running at a time | | Webhook notifications per hour | 2,000 | | Fields (element paths) per request | 30 | | Filter conditions per request | 100 | | Response size | 4 MB per response or page | If you go over the per-minute limit, wait before you retry. Any request sent while you're blocked resets the counter. For the full list, see [Data API restrictions](https://developer.lansweeper.com/docs/data-api/get-started/restrictions/). ## Find more on the Developer Portal The [Lansweeper Developer Portal](https://developer.lansweeper.com/) holds the technical documentation for building on Lansweeper: - **Data API**: the [quickstart](https://developer.lansweeper.com/docs/data-api/get-started/quickstart/), guides for querying data, actions, and webhooks, and the full [type reference](https://developer.lansweeper.com/docs/data-api/reference/types/). - **Platform API**: for software vendors who want to embed Lansweeper discovery in their own product. If your organization already has a Lansweeper subscription, use the Data API instead. - **Device Recognition API**: documentation for building integrations with Lansweeper Device Recognition. A paid Lansweeper Platform plan that includes features the Free plan doesn't, such as creating dashboards and exporting views. For what each plan includes, see https://www.lansweeper.com/pricing/. Compare with the Free and Enterprise plans.The highest Lansweeper Platform plan. Some features are available only on Enterprise. For what each plan includes, see https://www.lansweeper.com/pricing/. Compare with the Free and Pro plans.The GraphQL API for Lansweeper Platform that gives scripts and integrations access to the asset data in your sites. Documented on the Lansweeper Developer Portal. A container in Lansweeper Platform that groups the assets from a single customer's network environment. Your site is also where you use Lansweeper Platform's features, such as dashboards, reports, diagrams, vulnerability data, and Lens Chat. A site can have more than one connected installation, such as multiple Network Discovery hubs. A lightweight agent installed as a service on an asset to scan it. Used with Lansweeper Platform only. The Lansweeper Classic equivalent is LsAgent. A credential created in Lansweeper Platform under Developer tools that authenticates requests to the Data API. It can be a personal access token (PAT) or an OAuth client.