API
REST API for querying analytics data and managing your Sealmetrics account programmatically.
| Specification | Value |
|---|---|
| Base URL | https://my.sealmetrics.com/api/v1 |
| Protocol | HTTPS only |
| Format | JSON |
| Authentication | API Key or JWT Bearer token |
| Rate Limits | Per-plan (see Rate Limits) |
| Documentation | /docs (Swagger UI) |
Quick Start
curl -X GET "https://my.sealmetrics.com/api/v1/stats/overview?site_id=YOUR_SITE_ID&period=7d" \
-H "X-API-Key: sm_your_api_key_here"
Response:
{
"data": {
"entrances": 12543,
"page_views": 28976,
"engaged_entrances": 7234,
"bounce_rate": 42.3,
"conversions": 156,
"revenue": 12450.00,
"microconversions": 892
}
}
API Sections
Analytics Data
| Endpoint | Method | Description |
|---|---|---|
/stats/overview | GET | Dashboard overview with all key metrics |
/stats/pages | GET | Page metrics with pagination |
/stats/mediums | GET | Traffic by UTM medium |
/stats/sources | GET | Traffic by UTM source |
/stats/campaigns | GET | Traffic by UTM campaign |
/stats/terms | GET | Traffic by UTM term |
/stats/contents | GET | Traffic by UTM content |
/stats/referrers | GET | Referrer domain traffic |
/stats/geo/countries | GET | Geographic breakdown |
/stats/devices | GET | Device, browser, OS breakdown |
Site Management
| Endpoint | Method | Description |
|---|---|---|
/sites | GET, POST | List and create sites |
/sites/{id} | GET, PATCH, DELETE | Manage specific site |
/sites/{id}/domains | GET, POST, DELETE | Authorized domains |
/sites/{id}/utm-mappings | GET, POST, PATCH, DELETE | UTM parameter mappings |
/sites/{id}/pixel | GET | Get tracking pixel code |
/sites/{id}/pixel/status | GET | Check pixel installation |
Organizations
| Endpoint | Method | Description |
|---|---|---|
/organizations | GET, POST | List and create organizations |
/organizations/{slug} | GET, PATCH, DELETE | Manage specific organization |
/organizations/{slug}/members | GET, POST, PATCH, DELETE | Team member management |
/organizations/{slug}/sites | GET | List organization sites |
/organizations/{slug}/invitations | GET, POST, DELETE | Manage invitations |
Authentication
| Endpoint | Method | Description |
|---|---|---|
/auth/token | POST | Login with email/password |
/auth/refresh | POST | Refresh access token |
/auth/logout | POST | Logout current session |
/auth/me | GET | Get current user info |
/auth/sessions | GET, DELETE | Manage active sessions |
/auth/forgot-password | POST | Request password reset |
/auth/reset-password | POST | Reset password with token |
API Tokens
| Endpoint | Method | Description |
|---|---|---|
/api-tokens | GET, POST | List and create API tokens |
/api-tokens/{id} | GET, DELETE | Get or revoke token |
/api-tokens/scopes | GET | List available scopes |
Segments
| Endpoint | Method | Description |
|---|---|---|
/segments | GET, POST | List and create saved segments |
/segments/{id} | GET, PUT, DELETE | Manage specific segment |
/segments/{id}/duplicate | POST | Duplicate a segment |
Webhooks
| Endpoint | Method | Description |
|---|---|---|
/webhooks | GET, POST | List and create webhook endpoints |
/webhooks/{id} | GET, PATCH, DELETE | Manage specific webhook |
/webhooks/{id}/test | POST | Send test webhook |
/webhooks/{id}/rotate-secret | POST | Rotate webhook secret |
/webhooks/{id}/deliveries | GET | List delivery history |
/webhooks/event-types | GET | List available event types |
Alerts
| Endpoint | Method | Description |
|---|---|---|
/alerts/rules | GET, POST | List and create alert rules |
/alerts/rules/{id} | GET, PATCH, DELETE | Manage alert rule |
/alerts/rules/{id}/test | POST | Test alert rule |
/alerts/history | GET | Get alert history |
/alerts/stats | GET | Get alert statistics |
Bulk Exports
| Endpoint | Method | Description |
|---|---|---|
/exports | GET, POST | List and create export jobs |
/exports/{id} | GET, DELETE | Get or cancel export |
/exports/estimate | POST | Estimate export size |
/exports/stream | POST | Stream small export directly |
/exports/download/{token} | GET | Download export file |
BigQuery Integration
| Endpoint | Method | Description |
|---|---|---|
/integrations/bigquery | GET, POST, PATCH, DELETE | Configure BigQuery integration |
/integrations/bigquery/setup | POST | Create BigQuery tables |
/integrations/bigquery/sync | POST | Trigger manual sync |
/integrations/bigquery/backfill | POST | Backfill historical data |
/integrations/bigquery/logs | GET | List sync logs |
/integrations/bigquery/schema | GET | Get table schema |
IP Allowlist
| Endpoint | Method | Description |
|---|---|---|
/ip-allowlist/settings | GET, PUT | Manage allowlist settings |
/ip-allowlist/patterns | GET, POST | List and add IP patterns |
/ip-allowlist/patterns/{id} | PATCH, DELETE | Manage specific pattern |
/ip-allowlist/patterns/bulk | POST | Add multiple patterns |
/ip-allowlist/check | POST | Validate an IP address |
/ip-allowlist/export | GET | Export patterns |
/ip-allowlist/import | POST | Import patterns |
/ip-allowlist/audit | GET | Access audit log |
Common Query Parameters
These parameters are available on most analytics endpoints:
| Parameter | Type | Description | Example |
|---|---|---|---|
site_id | string | Required. Site identifier | my-site |
period | string | Time period shortcut | today, 7d, 30d, 90d |
start_date | date | Start date (YYYY-MM-DD) | 2025-01-01 |
end_date | date | End date (YYYY-MM-DD) | 2025-01-31 |
segment | string | Apply saved segment filters | paid-traffic |
country | string | Filter by country (ISO 2) | ES, US |
utm_source | string | Filter by UTM source | google |
utm_medium | string | Filter by UTM medium | cpc |
utm_campaign | string | Filter by UTM campaign | brand-2025 |
compare | string | Comparison mode | previous, yoy |
page | int | Page number (default: 1) | 1 |
page_size | int | Results per page (default: 50) | 100 |
sort_by | string | Sort field | entrances, revenue |
sort_order | string | Sort direction | asc, desc |
Period Shortcuts
| Value | Description |
|---|---|
today | Current day |
yesterday | Previous day |
7d | Last 7 days |
30d | Last 30 days |
90d | Last 90 days |
12m | Last 12 months |
this_week | Current week |
last_week | Previous week |
this_month | Current month |
last_month | Previous month |
this_quarter | Current quarter |
last_quarter | Previous quarter |
this_year | Current year |
last_year | Previous year |
wtd | Week to date |
mtd | Month to date |
qtd | Quarter to date |
ytd | Year to date |
Response Format
All successful responses wrap data in a data field:
{
"data": {
// Response payload
}
}
Paginated responses include pagination metadata:
{
"data": [...],
"total": 156,
"page": 1,
"page_size": 50,
"has_next": true,
"has_prev": false
}
Error Responses
All errors return JSON with this structure:
{
"error": {
"code": "error_code",
"message": "Human-readable description"
}
}
| HTTP Code | Error Code | Description |
|---|---|---|
| 400 | bad_request | Invalid parameters |
| 401 | unauthorized | Missing or invalid authentication |
| 403 | forbidden | Valid auth but insufficient permissions |
| 404 | not_found | Resource does not exist |
| 409 | conflict | Resource already exists |
| 429 | rate_limit_exceeded | Too many requests |
| 500 | internal_error | Server error |
Documentation
- Quick Start - First API call in 5 minutes
- Authentication - API keys and JWT tokens
- Stats Endpoints - Analytics data endpoints
- Sites - Site management
- Organizations - Team management
- Segments - Saved segments
- Exports - Bulk data exports
- Webhooks - Webhook subscriptions
- BigQuery Integration - Export to Google BigQuery
- IP Allowlist - Restrict access by IP
- Rate Limits - Limits per plan tier