The X-API-KEY is a private security key used to connect applications, scripts, servers, or agents with MonitorHub securely. Think of it like a password for your MonitorHub API access.
You can use the API key to:
No.
The API key works even without the MonitorHub Agent.
You can still:
You additionally get:
Add your API key inside request headers. MonitorHub checks the key before allowing access.
x-api-key: YOUR_API_KEYcurl -X GET https://api.monitorhubs.com/api/v1/monitors \ -H "x-api-key: YOUR_API_KEY"
fetch("https://api.monitorhubs.com/api/v1/monitors", {
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY"
}
})
.then(res => res.json())
.then(data => console.log(data));import requests
response = requests.get(
"https://api.monitorhubs.com/api/v1/monitors",
headers={
"x-api-key": "YOUR_API_KEY"
}
)
print(response.json())monitorhub-agent --api-key YOUR_API_KEY
or in config.json:
{
"apiKey": "YOUR_API_KEY"
}Keep your API key private.
Do NOT:
Anyone with your API key may be able to access your MonitorHub resources.
You can generate a new API key anytime from:
Generating a new key may disable the old one for security reasons.