API Reference
API Endpoints
Complete reference for all tracer API endpoints.
API Endpoints
Complete reference for the tracer REST API.
Base URL: https://api.tracer/v1
Monitors
List Monitors
GET /monitorsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
type | string | Filter by type: url, api, tcp, dns, heartbeat |
status | string | Filter by status: active, paused |
page | number | Page number (default: 1) |
per_page | number | Items per page (default: 20, max: 100) |
Example:
curl -X GET "https://api.tracer/v1/monitors?type=url&status=active" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"success": true,
"data": [
{
"id": "mon_abc123",
"name": "Production API",
"type": "url",
"url": "https://api.example.com/health",
"interval": 60,
"status": "active",
"locations": ["us-east", "eu-west"],
"created_at": "2024-01-15T10:00:00Z"
}
],
"meta": {
"total": 15,
"page": 1,
"per_page": 20
}
}Create Monitor
POST /monitorsRequest Body (URL Monitor):
{
"name": "Production API",
"type": "url",
"url": "https://api.example.com/health",
"method": "GET",
"interval": 60,
"timeout": 30,
"locations": ["us-east", "eu-west"],
"headers": {
"Authorization": "Bearer token"
},
"assertions": [
{
"type": "status_code",
"operator": "equals",
"value": 200
}
]
}Request Body (TCP Monitor):
{
"name": "Database Check",
"type": "tcp",
"host": "db.example.com",
"port": 5432,
"interval": 60,
"timeout": 10,
"locations": ["us-east"],
"tls": {
"enabled": false
}
}Get Monitor
GET /monitors/:idResponse:
{
"success": true,
"data": {
"id": "mon_abc123",
"name": "Production API",
"type": "url",
"url": "https://api.example.com/health",
"interval": 60,
"status": "active",
"last_run": {
"id": "run_xyz789",
"status": "success",
"duration_ms": 245,
"completed_at": "2024-01-15T10:30:00Z"
},
"stats": {
"uptime_24h": 99.9,
"avg_response_ms": 230
}
}
}Update Monitor
PUT /monitors/:idRequest Body:
{
"name": "Updated Name",
"interval": 120,
"status": "paused"
}Delete Monitor
DELETE /monitors/:idResponse:
{
"success": true,
"data": {
"id": "mon_abc123",
"deleted": true
}
}Trigger Run
POST /monitors/:id/runResponse:
{
"success": true,
"data": {
"run_id": "run_xyz789",
"status": "queued",
"locations": ["us-east", "eu-west"]
}
}Get Monitor Runs
GET /monitors/:id/runsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter: success, failed |
from | string | Start date (ISO 8601) |
to | string | End date (ISO 8601) |
location | string | Filter by location |
Journeys
List Journeys
GET /journeysCreate Journey
POST /journeysRequest Body:
{
"name": "Login Flow",
"description": "Tests the user login process",
"interval": 300,
"timeout": 60,
"locations": ["us-east"],
"steps": [
{
"type": "goto",
"url": "https://app.example.com/login"
},
{
"type": "fill",
"selector": "#email",
"value": "[email protected]"
},
{
"type": "fill",
"selector": "#password",
"value": "{{PASSWORD}}"
},
{
"type": "click",
"selector": "button[type='submit']"
},
{
"type": "expect_visible",
"selector": ".dashboard"
}
],
"variables": {
"PASSWORD": "test123"
}
}Get Journey
GET /journeys/:idUpdate Journey
PUT /journeys/:idDelete Journey
DELETE /journeys/:idTrigger Journey Run
POST /journeys/:id/runGet Journey Runs
GET /journeys/:id/runsRun Journeys by Tag
POST /journeys/run-tag/:tagRun all journeys with a specific tag (useful for CI/CD):
curl -X POST "https://api.tracer/v1/journeys/run-tag/smoke" \
-H "Authorization: Bearer YOUR_API_KEY"Runs
Get Run Details
GET /runs/:idResponse:
{
"success": true,
"data": {
"id": "run_xyz789",
"monitor_id": "mon_abc123",
"status": "success",
"location": "us-east",
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:30:01Z",
"duration_ms": 245,
"metrics": {
"dns_ms": 15,
"connect_ms": 45,
"tls_ms": 80,
"ttfb_ms": 190,
"download_ms": 55
},
"assertions": [
{
"type": "status_code",
"expected": 200,
"actual": 200,
"passed": true
}
]
}
}Get Run Steps (Journeys)
GET /runs/:id/stepsGet Run Artifacts
GET /runs/:id/artifactsReturns URLs to download screenshots and traces.
Alerts
List Alerts
GET /alertsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | triggered, acknowledged, resolved |
severity | string | critical, high, medium, low |
Get Alert
GET /alerts/:idAcknowledge Alert
POST /alerts/:id/acknowledgeRequest Body:
{
"note": "Looking into this issue"
}Resolve Alert
POST /alerts/:id/resolveRequest Body:
{
"note": "Fixed by deploying v2.1.0"
}Alert Channels
List Channels
GET /alert-channelsCreate Channel
POST /alert-channelsSlack Channel:
{
"name": "Ops Alerts",
"type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/..."
}
}Email Channel:
{
"name": "Email Alerts",
"type": "email",
"config": {
"recipients": ["[email protected]"]
}
}Webhook Channel:
{
"name": "PagerDuty",
"type": "webhook",
"config": {
"url": "https://events.pagerduty.com/...",
"headers": {
"Authorization": "Token ..."
}
}
}Alert Rules
List Rules
GET /alert-rulesCreate Rule
POST /alert-rulesRequest Body:
{
"name": "Critical Failures",
"type": "consecutive_failures",
"threshold": 3,
"severity": "critical",
"channels": ["chan_abc123"],
"apply_to": {
"monitors": ["mon_xyz789"],
"tags": ["production"]
}
}Organization
Get Organization
GET /organizationList Members
GET /organization/membersInvite Member
POST /organization/inviteRequest Body:
{
"email": "[email protected]",
"role": "member"
}Remove Member
DELETE /organization/members/:idUsage & Billing
Get Current Usage
GET /billing/usageResponse:
{
"success": true,
"data": {
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"usage": {
"monitors": {
"used": 15,
"limit": 20
},
"browser_runs": {
"used": 650,
"limit": 1000
},
"api_runs": {
"used": 2100,
"limit": 5000
}
}
}
}Get Plans
GET /billing/plansWebhooks
Test Webhook
POST /webhooks/:id/testSends a test event to your webhook endpoint.
All timestamps are in UTC and use ISO 8601 format.