How to configure a Web API tile
The Web API plugin allows you to query any REST API that returns JSON and visualize the results directly in a dashboard. This is useful when there isn’t a dedicated SquaredUp plugin available for your data source.
Web API tiles are configured via the tile editor the same as every other data source, however the complexity of the configuration itself can vary significantly depending on the API you are accessing.
In some circumstances, the information you provided when configuring the data source may well suffice to return the data you need. In others, you may be required to include an endpoint, payload, query parameters, headers or paging details.
This guide explains how to configure a basic HTTP request using the HTTP Request data stream in the Web API tile.
Before you begin
Before creating a tile, ensure a Web API data source has already been successfully configured by an administrator.
You will also need to know the full endpoint path and, where applicable, the following details:
- Any required query parameters
- Any required headers
- Whether the request requires a payload (POST requests)
- Whether pagination is required to return the full dataset
Adding a Web API tile
- Open your dashboard.
- Click Add and select Data . The tile editor opens.
- On the Data Source tab, select your Web API instance.
- On the Data Stream tab, select HTTP request.
Configuring a HTTP request
After selecting the data stream, use the Parameters tab to configure how SquaredUp queries your API endpoint. This includes defining the request method, endpoint path, and any additional parameters required by the API such as headers, query parameters, paging behavior.
The steps you must complete to configure the request are entirely dependent on how the API you are querying is designed. You may see data returned immediately after entering the endpoint path, or you may require additional configuration before a successful response is returned.
For detailed information on each configuration setting, see Web API data stream parameters.
View the request details
Before jumping into configuration, it's a great idea to open the Troubleshooting panel by clicking Open troubleshooting
at the top of the parameters panel.This panel allows you to clearly view the Response you're getting from your API, as well as the shape of your Request as you configure it.
Configure the endpoint
Use the Basics sub-tab to configure the request method and endpoint URL of the request. The Base URL you entered when configuring the data source is automatically populated in the address (unless you are using a Collection with more than one base URL).
To configure the endpoint:
- Method:
Select GET or POST from the dropdown to the left of the URL. - Enter a path:
Optionally, enter an endpoint path after the URL. - Click Apply to update the URL and resend the request.
(POST) Provide a payload
If you selected POST as the request method when configuring the request endpoint, you can supply the JSON request payload on the Body sub-tab.
After clicking Apply, you can see that your payload has been added to the Body of your request on Request tab of the Troubleshooting panel.
To provide a payload:
- Body:
Enter a JSON payload. This must match the shape expected by your API. - Click Apply.
Configure query parameters
If you need to provide query parameters in the URL of the request, enter these on the Parameters sub-tab. These are appended to the end of a request URL after a ?.
After clicking Apply, you can view the updated shape of your request URL on Request tab of the Troubleshooting panel.
For example:https://api.example.com/incidents?status=open&limit=10
To configure query parameters:
- Click Add header .
- Enter the
key:valuepair to be used. - Optionally, encrypt the
valueby clicking the encrypt icon . - Repeat steps 1-3 for each header required.
- Click Apply.
Configure headers
If your request requires metadata such as authentication details or content type information, configure this on the Headers sub-tab.
After clicking Apply, you can view the updated shape of your request headers on Request tab of the Troubleshooting panel.
Common headers include:
Authorization: Bearer <token>Content-Type: application/json
To configure headers:
- Click Add header .
- Enter the
key:valuepair to be used. - Optionally, encrypt the
valueby clicking the encrypt icon . - Repeat steps 1-3 for each header required.
- Click Apply.
Configure paging
Some APIs return results in smaller chunks (“pages”) instead of returning the entire dataset in a single response. If pagination is required, configure the Paging tab to define how SquaredUp should retrieve these additional pages of data.
You can often use the Response tab of the Troubleshooting panel to determine how to configure paging for the request.
For example, in the following image the response body has a parameter named next which contains a link to the next page of results. Therefore, to configure paging:
- Mode: Select Next URL.
- NextURL: Select Body and enter next.
To configure paging:
- Configure the basic pagination details for the request:
- Configure the fields that display for your selected Mode:
- Click Apply.
Transform the response
Response transformation allows you to integrate SquaredUp with even more APIs by transforming response data to fit the needs of your visualizations.
Use the transform tab to specify the path to the data and to optionally apply scripting to the dataset that is returned.
Specify the path to the data in the returned JSON. Choose from:
- Path: Enter the exact JSON path to select the portion of the response you want to use. For example,
results
orresults[0].value - Script: Use a custom JavaScript snippet to transform the response. See data transformation examples for detailed use cases.
To return data from your script, you can use one of the following syntax options:
result = data.map(a => a.name)return data.map(a => a.name)Normalizing an inconsistent API response
This script drills into nested objects, extracts only the useful fields, and outputs a clean array of simple objects. Ideal for visualizations that cannot consume deeply nested structures.
Response JSON:
{
"meta": { "timestamp": "2025-01-01" },
"response": {
"records": [
{
"attributes": { "id": 1, "info": { "value": 10 } },
"status": "ok"
},
{
"attributes": { "id": 2, "info": { "value": 20 } },
"status": "ok"
}
]
}
}
Script:
result = data.response.records.map(r => ({
id: r.attributes.id,
value: r.attributes.info.value,
status: r.status
}));Output JSON:
[
{ "id": 1, "value": 10, "status": "ok" },
{ "id": 2, "value": 20, "status": "ok" }
]Reshaping API output from multiple nested collections
This example flattens a hierarchical projects > tasks structure into a single list, allowing tables or charts to display all tasks with their related project names.
Response JSON:
{
"projects": [
{
"name": "Alpha",
"tasks": [
{ "taskId": 1, "hours": 5 },
{ "taskId": 2, "hours": 3 }
]
},
{
"name": "Beta",
"tasks": [
{ "taskId": 3, "hours": 4 }
]
}
]
}
Script:
return data.projects.flatMap(project =>
project.tasks.map(t => ({
project: project.name,
taskId: t.taskId,
hours: t.hours
}))
);
Output JSON:
[
{ "project": "Alpha", "taskId": 1, "hours": 5 },
{ "project": "Alpha", "taskId": 2, "hours": 3 },
{ "project": "Beta", "taskId": 3, "hours": 4 }
]Parsing CSV returned inside JSON
This script converts a CSV string into an array of objects (one per row) so the data can be visualized like any other structured dataset.
Response JSON:
{
"csv": "time,value\n2024-01-01,10\n2024-01-02,15"
}
Script:
const lines = data.csv.trim().split("\n");
const [header, ...rows] = lines;
const cols = header.split(",");
result = rows.map(line => {
const values = line.split(",");
return Object.fromEntries(cols.map((c, i) => [c, values[i]]));
});
Output JSON:
[
{ "time": "2024-01-01", "value": "10" },
{ "time": "2024-01-02", "value": "15" }
]
Adding totals, averages, and ratios
This script calculates new metrics like revenue and averages.
Response JSON:
{
"sales": [
{ "region": "NA", "units": 120, "price": 5 },
{ "region": "EU", "units": 150, "price": 4 }
]
}
Script:
return data.sales.map(s => ({
region: s.region,
revenue: s.units * s.price,
units: s.units,
price: s.price,
averageRevenuePerUnit: (s.units * s.price) / s.units
}));
Output JSON:
[
{
"region": "NA",
"revenue": 600,
"units": 120,
"price": 5,
"averageRevenuePerUnit": 5
},
{
"region": "EU",
"revenue": 600,
"units": 150,
"price": 4,
"averageRevenuePerUnit": 4
}
]
Complete the tile configuration
From here the standard configuration flow returns and you can configure the tile as any other.
You can:
- Use the Timeframe tab to apply a timeframe to the data if you supplied an expression during the request config.
- Filter | Group | Sort the returned data to perform further aggregation.
- Configure the returned Columns or configure a custom column from the data.
- Configure a Visualization, Monitor and KPI as required.
HTTP request examples
The following examples show how to configure a HTTP request to query an API. Note that these are for demonstration only and the information you must provide depends on the API.
GET request configuration
This example configuration fetches a list of users from a public API with optional filters.
- Basics tab, configure the following:
- Type:
GET - URL:
https://api.example.com(read-only) - Path:
/v1/users
- Type:
- On the Parameters tab, configure the following, this defines the following for the resulting request URL
https://api.example.com/v1/users?status=active&limit=50: - On the Headers tab, configure the following:
- On the Response tab, configure the following:
- Response Preview: Click Send to display JSON such as
{ "data": [ { "id": 1, "name": "Alice" }, { "id": 2, "name": "Bob" } ], "total": 2 } - Select data:
- Path
data
- Expand Inner Objects: Toggle on to view full user details
- Response Preview: Click Send to display JSON such as
POST request configuration
This example configuration sends a query in a POST request to return a list of users from an API.
- On the Basics tab, configure the following:
- Type:
POST - URL:
https://api.example.com(read-only) - Path:
/v1/sales/query
- Type:
- On the Body tab, configure the following:
Body: This request asks the API to return aggregated sales metrics for a specific date range and region{ "startDate": "2025-11-01", "endDate": "2025-11-07", "region": "North America", "metrics": ["totalSales", "averageOrderValue", "transactions"] }
- On the Parameters tab, leave the fields empty, as query parameters are included in the request body for this API.
- On the Headers tab, configure the following:
- On the Response tab, configure the following:
- Response Preview: Click Send to display JSON such as
{ "status": "success", "data": { "summary": { "totalSales": 157340.25, "averageOrderValue": 78.12, "transactions": 2014 }, "dailyBreakdown": [ { "date": "2025-11-01", "totalSales": 22000.50 }, { "date": "2025-11-02", "totalSales": 24350.00 }, { "date": "2025-11-03", "totalSales": 18000.75 } ] } } - Select data:
- Path
data.dailyBreakdown
- Expand inner objects: Toggle on to view nested objects like
summaryanddailyBreakdown
- Response Preview: Click Send to display JSON such as