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:

  1. Log in to the Seabhac.io Web Dashboard.
  2. Navigate to Organization Settings.
  3. Scroll down to the API Keys section.
  4. Click the button to create a new API key and provide a descriptive name for it.
  5. 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.

Jobs

Jobs represent the individual executions or runs of a particular schedule.

Alerts

Metrics

Metrics endpoints provide aggregated monitoring data over a specified time range.

Available metric endpoints for a schedule:

Query Parameters:
Both query parameters must be formatted in RFC3339 (e.g., 2023-10-01T12:00:00Z).


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.

curl -X GET https://api.seabhac.io/health