REST API Reference
{{ t('api_intro_extended') }}
{{ t('menu_auth') }}
{{ t('auth_desc_extended') }}
Authorization: Bearer <YOUR_API_TOKEN>
{{ t('auth_security_note') }}
{{ t('menu_limits') }}
{{ t('limits_desc') }}
- 60 req/min — {{ t('limit_standard') }}
- 120 req/min — {{ t('limit_pro') }}
{{ t('menu_errors') }}
| Code | Description |
|---|---|
| 401 Unauthorized | Неверный токен. |
| 429 Too Many Requests | Превышен лимит. |
{{ t('menu_list_mon') }}
GET
/api/v1/monitors{{ t('list_desc') }}
Python Example
import requests
resp = requests.get("https://upvisor.com/api/v1/monitors", headers={"Authorization": "Bearer TOKEN"})
print(resp.json())
{{ t('menu_create_mon') }}
POST
/api/v1/monitors{{ t('create_desc') }}
curl -X POST https://upvisor.com/api/v1/monitors \
-H "Authorization: Bearer TOKEN" \
-d '{"name": "Prod", "target": "db.prod", "check_type": "tcp", "port": 5432}'
Outgoing Webhooks
{{ t('wh_intro') }}
UpVisor ➔ {{ t('your_server') }}
{{ t('wh_concept') }}
{{ t('menu_security') }}
{{ t('sec_desc_extended') }}
Header: X-Upvisor-Signature (HMAC-SHA256)
Node.js Example
const crypto = require('crypto');
// Verify HMAC-SHA256 signature
const hmac = crypto.createHmac('sha256', process.env.WEBHOOK_SECRET);
const digest = 'sha256=' + hmac.update(req.rawBody).digest('hex');
if (digest !== req.headers['x-upvisor-signature']) throw new Error('Invalid!');
{{ t('menu_retries') }}
{{ t('retry_desc_extended') }}
- 10s, 60s, 5m, 30m (Max 5 attempts).
{{ t('menu_payload') }}
{{ t('payload_desc') }}
Incoming Heartbeat
{{ t('hb_intro_extended') }}
{{ t('your_script') }} ➔ UpVisor
{{ t('hb_concept_extended') }}
{{ t('menu_endpoint') }}
GET
https://upvisor.com/api/v1/beat/
{UUID}
Example: Bash
pg_dump db > file.sql && curl -fsS https://upvisor.com/api/v1/beat/{UUID}
Example: Python
import requests
requests.get("https://upvisor.com/api/v1/beat/{UUID}")