Using the Data Warehouse API
Overview
The SureView Data Warehouse API gives you direct, programmatic access to your Sureview Response alarm event data. Rather than relying solely on SureView's built-in reports, the Data Warehouse API allows your reporting teams to pull your data into the tools you already use (such as Microsoft Excel, Power BI, Tableau, or Crystal Reports) and build your own custom dashboards and analysis.
This is particularly useful for organisations that need to regularly extract and analyse large volumes of historical alarm data on their own terms.
Want to get started? The Data Warehouse API must be enabled for your account. Please contact SureView Support and we can activate it for you.
What Data Can I Access?
The API provides access to two core datasets:
Events
A summary of each alarm event handled by your team. Each record includes details such as:
| Field | Description |
|---|---|
EventId |
Unique identifier for the alarm event |
Created |
Timestamp for when the event was created |
Viewed |
Timestamp for when the event was first viewed |
Closed |
Timestamp for when the event was closed |
OverallDuration |
Total time from creation to close |
ResponseDuration |
Time spent in active response |
ParkedDuration |
Time the event was parked |
ProcessDuration |
Time spent in processing |
AreaId |
Internal identifier for the associated site/area |
SuiteAreaId |
Suite-specific area identifier |
AreaTitle |
Display name of the area |
AreaPath |
Full folder path of the area |
AreaReferenceId |
External reference ID for the area |
ViewedUserId |
ID of the operator who first viewed the event |
ViewedUserEmail |
Email of the operator who first viewed the event |
ViewedUsername |
Username of the operator who first viewed the event |
ViewedSuiteUserId |
Suite-specific user ID of the viewing operator |
ViewerNames |
Names of all operators who viewed the event |
ClosedUserId |
ID of the operator who closed the event |
ClosedUsername |
Username of the operator who closed the event |
ClosedUserEmail |
Email of the operator who closed the event |
ClosedSuiteUserId |
Suite-specific user ID of the closing operator |
CategoryId |
ID of the outcome category assigned to the event |
CategoryTitle |
Display name of the outcome category |
CategoryPath |
Full path of the outcome category |
CategoryNote |
Any note associated with the outcome category |
CaseId |
Any linked case reference |
AutoHandled |
Whether the event was handled automatically |
Timezone |
Timezone of the event |
Lat |
Latitude coordinate (where applicable) |
Long |
Longitude coordinate (where applicable) |
InvolvedParties |
Any parties recorded against the event |
AlarmTags |
Tags applied to the event |
RemovedTags |
Tags removed from the event |
ResponseTenantId |
Internal tenant identifier (Response platform) |
SuiteTenantId |
Internal tenant identifier (Suite platform) |
Event Records
A detailed log of every action taken during an event (e.g. alarms triggered, steps followed, notes added, notifications sent). Each record includes:
| Field | Description |
|---|---|
EventRecordId |
Unique identifier for this event record entry |
EventId |
The parent event this record belongs to |
EventTitle |
The name/title of the parent alarm event |
EventRecordTypeId |
ID of the record type |
EventRecordTypeDesc |
Description of the record type (e.g. alarm received, action taken) |
AlarmId |
Identifier of the alarm that triggered this record |
AlarmTitle |
Display name of the alarm |
AlarmPriority |
Priority level of the alarm |
DeviceId |
Identifier of the associated device |
DeviceTypeId |
ID of the device type |
DeviceTypeTitle |
Display name of the device type |
Input1 |
Device input value 1 |
Input2 |
Device input value 2 |
DeviceTypeEventNum |
Event number from the device type |
DeviceTypeEventDesc |
Description of the device type event |
ActionPlanStepId |
ID of the action plan step followed |
ActionPlanStepTitle |
Title of the action plan step |
ActionPlanTitle |
Title of the action plan |
ActionPlanActionTaken |
The action taken as part of the action plan |
PeripheralId |
Identifier of any associated peripheral device |
PeripheralTitle |
Display name of the peripheral |
PeripheralType |
Type of the peripheral |
Location |
Location information associated with this record |
EventUserId |
ID of the operator who generated this record |
EventUserUsername |
Username of the operator who generated this record |
EventUserFullName |
Full name of the operator who generated this record |
UserId |
ID of the user associated with this record |
SuiteUserId |
Suite-specific user ID |
UserUsername |
Username of the associated user |
UserFullName |
Full name of the associated user |
URL |
Any URL associated with this record |
DateTimeOnServer |
Server-side timestamp of the record |
Created |
Timestamp when this record was created |
Details |
Any additional notes or details captured |
AreaId |
ID of the area associated with this record |
SuiteAreaId |
Suite-specific area identifier |
AreaTitle |
Display name of the area |
AreaPath |
Full folder path of the area |
AssetId |
ID of any linked asset |
AssetTitle |
Display name of the linked asset |
NotificationRuleId |
ID of any associated notification rule |
NotificationRuleTitle |
Display name of the notification rule |
AlarmTagAdded |
Tag that was added during this record |
AlarmTagRemoved |
Tag that was removed during this record |
CanBulkCopy |
Whether this record can be bulk copied |
ResponseTenantId |
Internal tenant identifier (Response platform) |
SuiteTenantId |
Internal tenant identifier (Suite platform) |
How Far Back Can I Query?
The API supports date range filtering, but a single request is limited in two ways: it can cover a maximum of 90 days, and it can return a maximum of 100,000 records. Whichever limit is reached first causes the request to fail with a
400 Bad Request error rather than returning partial data. The available history will depend on your account's individual Data Retention settings (which defaults to 1 year).In practice, most accounts will hit the 100,000-record limit long before the 90-day one. A single week ofEventRecordscan exceed 100,000 rows for a high-volume account. Start with a narrow window (e.g. 3 days), confirm it succeeds, and only widen it once you're confident the record count will stay under the limit. See Errors and Rate Limits below for the exact failure conditions.
How Does Authentication Work?
To ensure only authorised users can access your organisation's data, the API uses two credentials that work together:
- API Key: A unique key that identifies your organisation's account.
- JWT Token: A short-lived access token that verifies your identity. You can set how long it remains valid when generating it.
⚠️ Important: Keep these credentials private. They provide full access to all alarm events and records for your account. Do not share them publicly or include them in code repositories.
Both credentials are available from within SureView Suite:
- Log in to SureView Suite.
- Go to Account Settings.
- Navigate to the Data Warehouse Access Configuration section.
- Here you can view, copy, or regenerate your API Key and JWT Token.
Regenerating your JWT Token:
- Click Regenerate next to the JWT token.
- Choose how many hours you want the token to remain valid.
- Click Save. Your new token will be ready to use.
Regenerating your API Key:
- Click Regenerate next to the API Key.
- Your new key is generated immediately.
If you do not see the Data Warehouse Access Configuration section in your Account Settings, please contact SureView Support to enable Data Warehouse access for your account.
Use Cases & Integrations
The Data Warehouse API is designed to work seamlessly with popular reporting and analytics tools:
- Microsoft Excel: Pull data directly into a spreadsheet using Excel's built-in Power Query feature. Set up a dynamic query to automatically refresh and pull the latest data on demand.
- Microsoft Power BI: Connect Power BI to the API to build rich, interactive dashboards.
- Tableau: Import your alarm event data into Tableau for advanced visualisation.
- Crystal Reports: Feed your data into Crystal Reports for structured reporting.
- Any tool that supports REST APIs: The API returns data in CSV or JSON format, making it compatible with a wide range of platforms and languages.
Getting Started
Enable Data Warehouse Access
Before you can use the API, Data Warehouse access needs to be enabled for your account. If you don't see a Data Warehouse Access Configuration section in your Suite Account Settings, contact SureView Support to get it turned on.
Getting Your Credentials
All requests to the API require two credentials. Both are available in SureView Suite
Account Settings > Data Warehouse Access Configuration.
API Key
A static key tied to your organisation's account. It does not expire unless you manually regenerate it. To create or replace one, click Regenerate next to the API Key field. This is passed on every request as the
X-Api-Key header.
JWT Token
A time-limited token used to verify your identity. When generating one you choose how long it stays valid, in hours. To create or replace one, click Regenerate next to the JWT Token field, set your preferred expiry, and click Save. This is passed on every request as the
Authorization header.Keep these credentials private. Together they grant full access to all alarm events and event records for your account. Do not share them in unsecured files or locations others can access.
The Endpoints
The API base URL is:
https://suite.sureviewops.com/datawarehouseapi/
Two endpoints are available:
| Endpoint | Description |
|---|---|
/Events |
A summary record for each alarm event |
/EventRecords |
A detailed log of every action taken within events |
Query Parameters
| Parameter | Description |
|---|---|
startDate |
Start of the date range to query. Format: YYYY-MM-DD. Required unless using lastUpdated. |
endDate |
End of the date range to query. Format: YYYY-MM-DD. Required unless using lastUpdated. |
lastUpdated |
Returns events updated since this datetime. Cannot be combined with startDate or endDate. |
fileType |
Output format. Omit for CSV (the default), or pass fileType=json for JSON output. |
A single request is limited to a maximum date range of 90 days and a maximum of 100,000 records - whichever is hit first will cause the request to fail. Most high-volume accounts will hit the 100,000-record limit well before the 90-day one, so treat 90 days as a theoretical ceiling rather than a practical target. If you are querying a high-volume account, start with shorter windows (1 to 7 days) and narrow further if you still see errors.
Errors and Rate Limits
The following status codes can be returned by the API when data retrieval was not successful:
| Status Code | Description |
|---|---|
| 400 |
Bad Request - Invalid Date Parameters. This is returned when a required parameter is missing, a parameter is not in a valid date format, the range between startDate and endDate is greater than 90 days, or the requested range would return more than 100,000 records. The response doesn't indicate which of these caused it, so check your request against all four. |
| 401 | Unauthorized. Returned if the API Key or JWT Token are missing or incorrectly added to the request, are malformed or don't belong to the same tenancy, or if the JWT Token has expired. |
| 429 | Too Many Requests. Returned when you exceed the number of requests allowed within a time frame. The current limit is 10 requests within any 10-minute period. If you receive a 429, wait before retrying rather than retrying immediately. |
| 500 | Internal Server Error. Returned if an error occurs within the API during the request. If this persists, please contact Customer Support. |
Planning a bulk export? At 10 requests per 10 minutes, pulling a large amount of history in small chunks takes real time - a year of data split into daily requests is 365 requests, which takes at least roughly 6 hours even with no errors. Any script or tool built against this API should pace its requests and back off (rather than retry immediately) when it receives a 429.
Making a Request
Pass both credentials as headers on every request:
| Header | Value |
|---|---|
X-Api-Key |
Your API Key |
Authorization |
Your JWT Token |
Example using curl:
curl -X GET \ "https://suite.sureviewops.com/datawarehouseapi/Events?startDate=2026-01-01&endDate=2026-01-07" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Authorization: YOUR_JWT_TOKEN"
This example uses a 7-day range as a safe starting point. Even 7 days can exceed 100,000 records for high-volume
EventRecords accounts, so check the response and narrow the range further if you receive a 400.By default the API returns a CSV file, which works directly with Excel, Power BI, and most other reporting tools. If you need JSON instead, add
fileType=json to the request URL.Connecting in Microsoft Excel (Power Query)
Here is how to connect Excel to the Data Warehouse API to pull a live, refreshable report of your alarm data:
Prerequisites
Before you begin, retrieve your API Key and JWT Token from Suite Account Settings (see the Authentication section above).
Step 1 – Open the "Get Data" Wizard
- Open a new, blank Excel workbook.
- Go to the Data tab on the ribbon.
-
Click Get Data > From Other Sources > From Web.
Step 2 – Enter the URL and Credentials
- In the dialogue box, click the Advanced option at the top.
-
In the URL field, enter the appropriate endpoint URL:Events:
https://suite.sureviewops.com/datawarehouseapi/Events?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD
Event Records:https://suite.sureviewops.com/datawarehouseapi/EventRecords?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD
(ReplaceYYYY-MM-DDwith your desired date range, e.g.2026-01-01and2026-01-07- see the note on the 100,000-record limit below before choosing a wider range)
-
Under HTTP request header parameters, add your two credentials:
Header Name Value X-Api-Key(Paste your API Key here) Authorization(Paste your JWT Token here) - Click OK.
Step 3 - Load or Transform the Data
- A preview window will appear showing your data.
- To load static data for the dates you specified: click Load — you're done!
-
To set up a dynamic query that automatically pulls a rolling window of recent data every time you refresh: click Transform Data and continue to the next steps.
Before you continue: Power Query does not automatically split a request or retry on an error, so the dynamic query below can only ever pull data as a single request. If your account's volume means that request would exceed 100,000 records, refreshing the query will fail with an error rather than returning partial data. Start with a short window (the example below uses 7 days) and only increase it once you've confirmed the record count comfortably stays under the limit. Repeated manual refreshes while you're testing this also count towards the API's rate limit of 10 requests per 10 minutes.
Step 4 - Set Up a Dynamic Date Range (Optional)
- In the Power Query Editor, click the Home tab.
- Click Advanced Editor.
- Delete all the existing code and replace it with the dynamic query script below.
- Update the placeholder values for
X-Api-KeyandAuthorizationwith your actual credentials. - Adjust the day range if needed.
-90is the hard ceiling, but most accounts will hit the 100,000-record limit long before that - start at-1and increase gradually, refreshing after each change to confirm it still loads successfully.
Dynamic Events Query:
let
Today = Date.From(DateTime.LocalNow()),
StartDate = Date.AddDays(Today, -1),
EndDateText = Date.ToText(Today, "yyyy-MM-dd"),
StartDateText = Date.ToText(StartDate, "yyyy-MM-dd"),
BaseUrl = "https://suite.sureviewops.com/datawarehouseapi/Events",
Source = Csv.Document(
Web.Contents(BaseUrl, [
Query=[startDate=StartDateText, endDate=EndDateText],
Headers=[#"X-Api-Key"="YOUR_API_KEY", Authorization="YOUR_JWT_TOKEN"]
]),
[Delimiter=",", Columns=36, Encoding=1252, QuoteStyle=QuoteStyle.Csv]
),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
Dynamic Event Records Query:
let
Today = Date.From(DateTime.LocalNow()),
StartDate = Date.AddDays(Today, -1),
EndDateText = Date.ToText(Today, "yyyy-MM-dd"),
StartDateText = Date.ToText(StartDate, "yyyy-MM-dd"),
BaseUrl = "https://suite.sureviewops.com/datawarehouseapi/EventRecords",
Source = Csv.Document(
Web.Contents(BaseUrl, [
Query=[startDate=StartDateText, endDate=EndDateText],
Headers=[#"X-Api-Key"="YOUR_API_KEY", Authorization="YOUR_JWT_TOKEN"]
]),
[Delimiter=",", Columns=47, Encoding=1252, QuoteStyle=QuoteStyle.Csv]
),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
- Click Done.
Step 5 - Load and Refresh
- Back in the Power Query Editor, click Close & Load on the Home tab.
- Your data will appear in a new Excel sheet as a formatted table.
- To refresh the data at any time, go to the Data tab and click Refresh All - this will re-run the query and pull the latest data.
⚠️ Note: Refreshing will overwrite any manual changes made directly to the data cells. Keep any custom analysis in a separate sheet.
Security Notice - Protecting Your Credentials
Your API Key and JWT Token provide full access to your organisation's alarm data. When embedding them in an Excel workbook or any other tool, please keep the following in mind:
- Treat the Excel file like a password do not share it externally or store it in publicly accessible locations (e.g. shared drives without access controls).
- Consider storing credentials in a protected sheet rather than directly in the query script, so they can be updated easily without editing the query code, and can be hidden from casual view.
- Regenerate your credentials at any time from Suite Account Settings if you believe they may have been compromised or shared unintentionally.
- JWT Tokens have a configurable expiry setting a shorter validity window (e.g. 24 hours) limits exposure if a token is accidentally shared.
Frequently Asked Questions
Q: Who can access the Data Warehouse API?
Data Warehouse access must be enabled for your account by SureView. Once enabled, users with Administrator permissions in SureView Suite can access the credentials needed to connect. Contact SureView Support to get started.
Q: What format does the API return data in? The API supports two output formats:
- CSV (default): If no format is specified, the API returns a
.csvfile - ideal for direct use in Excel, Power BI, or other spreadsheet tools.- JSON: Developers integrating the API into their own systems or scripts can request JSON output by adding
fileType=jsonto their query. This is the more typical format for programmatic use.
Q: How much data can I retrieve at once?
A single request is capped at 90 days and 100,000 records - whichever limit you hit first will return a 400 error. Most high-volume accounts hit the 100,000-record limit well before 90 days, so start with a narrow window (e.g. 1 or 2 days) and only widen it once you've confirmed the record count stays under the limit.
Q: What happens if my request would return more than 100,000 records?
The request fails with a 400 error rather than returning a partial or truncated result. Split your date range into smaller windows, request each one separately, and combine the results.
Q: Is there a rate limit on the API?
Yes. You can make up to 10 requests within any 10-minute period; exceeding this returns a 429 error. If you're pulling a large amount of history in narrow chunks to stay under the 100,000-record limit, make sure your process paces its requests and waits before retrying after a 429, rather than retrying immediately.
Q: My JWT Token has expired. What do I do?
Log back in to SureView Suite, go to Account Settings > Data Warehouse Access Configuration, and click Regenerate next to the JWT Token. Set your preferred expiry and save it, then update your query or tool with the new token.
Q: Can I use this with tools other than Excel?
Yes. The API is a standard REST API that any tool or developer with HTTP request capabilities can connect to. It has been successfully used with Power BI, Tableau, Crystal Reports, and custom scripts.
Comments
0 commentsPlease sign in to leave a comment.