Seabhac.io API Server
The Seabhac.io API Server provides secure, programmatic access to your organization's monitoring schedules, job execution history, alert configurations, and performance metrics.
Authentication
All API requests (except for the /health endpoint) require an API key to authenticate and authorize the request. API keys are linked to your Organization.
Creating an API Key
To generate an API key:
- Log in to the Seabhac.io Web Dashboard.
- Navigate to Organization Settings.
- Scroll down to the API Keys section.
- Click the button to create a new API key and provide a descriptive name for it.
- Copy the API key immediately and store it securely.
Using your API Key
Include your API key in the X-Api-Key HTTP header with every request to the API server.
Example:
curl -H "X-Api-Key: your_api_key_here" https://api.seabhac.io/v1/schedules
Rate Limiting
API keys have monthly usage limits. If you exceed your organization's monthly limit, the API will respond with a 429 Too Many Requests status code. You can view your current usage and limits in the Organization Settings page.
API Endpoints
The API is versioned and currently serves v1. All endpoints return JSON responses.
Schedules
Schedules represent your configured monitoring targets and their intervals.
-
GET /v1/schedules
Returns a list of all schedules associated with your organization. -
GET /v1/schedules/:id
Returns details for a specific schedule.
Jobs
Jobs represent the individual executions or runs of a particular schedule.
-
GET /v1/schedules/:id/jobs
Returns a list of jobs executed for the specified schedule.
Query Parameters:limit(optional): Number of records to return. Default is50, maximum is500.offset(optional): Number of records to skip for pagination. Default is0.
-
GET /v1/schedules/:id/jobs/:job_id
Returns details for a specific job run.
Alerts
GET /v1/schedules/:id/alerts
Returns a list of alert rules configured for a specific schedule.
Metrics
Metrics endpoints provide aggregated monitoring data over a specified time range.
Available metric endpoints for a schedule:
GET /v1/schedules/:id/metrics/httpGET /v1/schedules/:id/metrics/dnsGET /v1/schedules/:id/metrics/sslGET /v1/schedules/:id/metrics/email_authGET /v1/schedules/:id/metrics/pageloadGET /v1/schedules/:id/metrics/ssh
Query Parameters:
Both query parameters must be formatted in RFC3339 (e.g., 2023-10-01T12:00:00Z).
from(optional): The start time for the metrics data.to(optional): The end time for the metrics data.
Example Usage
Here are a few practical examples of how to interact with the API using curl.
1. List all schedules
Retrieve all monitoring schedules for your organization.
curl -X GET \
-H "X-Api-Key: your_api_key_here" \
"https://api.seabhac.io/v1/schedules"
2. Fetch recent jobs for a schedule
Get the 10 most recent job executions for a specific schedule, skipping the first 5.
curl -X GET \
-H "X-Api-Key: your_api_key_here" \
"https://api.seabhac.io/v1/schedules/123e4567-e89b-12d3-a456-426614174000/jobs?limit=10&offset=5"
3. Retrieve HTTP Metrics for a specific time range
Get HTTP response time metrics and status distributions for the last 24 hours. (Make sure to URL-encode the RFC3339 timestamps if necessary).
curl -X GET \
-H "X-Api-Key: your_api_key_here" \
"https://api.seabhac.io/v1/schedules/123e4567-e89b-12d3-a456-426614174000/metrics/http?from=2023-10-01T00:00:00Z&to=2023-10-02T00:00:00Z"
Health Check
An unauthenticated endpoint is available to check the general availability of the API server.
GET /health
curl -X GET https://api.seabhac.io/health