Aggregate analytics
curl --request POST \
--url https://statusstack.com/api/v1/sources/analytics/aggregate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"date_range": {
"from": "2023-12-25",
"to": "2023-12-25"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
date_range: {from: '2023-12-25', to: '2023-12-25'}
})
};
fetch('https://statusstack.com/api/v1/sources/analytics/aggregate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://statusstack.com/api/v1/sources/analytics/aggregate"
payload = {
"source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"date_range": {
"from": "2023-12-25",
"to": "2023-12-25"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uptime_percentage": 123,
"incident_count": 123,
"average_response_time": 123,
"data_points": [
{}
]
}Sources
Aggregate analytics
Aggregate analytics data across multiple sources
POST
/
v1
/
sources
/
analytics
/
aggregate
Aggregate analytics
curl --request POST \
--url https://statusstack.com/api/v1/sources/analytics/aggregate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"date_range": {
"from": "2023-12-25",
"to": "2023-12-25"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
date_range: {from: '2023-12-25', to: '2023-12-25'}
})
};
fetch('https://statusstack.com/api/v1/sources/analytics/aggregate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://statusstack.com/api/v1/sources/analytics/aggregate"
payload = {
"source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"date_range": {
"from": "2023-12-25",
"to": "2023-12-25"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uptime_percentage": 123,
"incident_count": 123,
"average_response_time": 123,
"data_points": [
{}
]
}Authorizations
StatusStack authenticates requests with API keys, created via the dashboard with granular permissions (read, write, delete, admin, *).
API keys support version compatibility:
- v1 keys: Can only access v1 endpoints
- v2 keys: Can access both v1 and v2 endpoints
Available permissions:
read: View resources (GET requests)write: Create and update resources (POST, PUT requests)delete: Delete resources (DELETE requests)admin: Administrative access to all resources*: Wildcard permission (all actions allowed)
Was this page helpful?

