API Reference
Complete reference for the Rustrak REST API.
Base URL
http://your-server:8080/apiAuthentication
All API requests require authentication via Bearer token:
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:8080/api/projectsCreate tokens in Settings → API Tokens in the dashboard.
Responses
All responses are JSON. Successful responses return the requested data. Errors return:
{
"error": "Error message"
}Projects
List projects
GET /api/projectsResponse:
{
"data": [
{
"id": 1,
"name": "my-app",
"slug": "my-app",
"sentry_key": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2024-01-15T10:30:00Z"
}
]
}Get project
GET /api/projects/{id}Create project
POST /api/projects
Content-Type: application/json
{
"name": "my-app"
}Update project
PATCH /api/projects/{id}
Content-Type: application/json
{
"name": "new-name"
}Delete project
DELETE /api/projects/{id}Issues
List issues
GET /api/projects/{project_id}/issues
GET /api/projects/{project_id}/issues?state=open
GET /api/projects/{project_id}/issues?state=resolved
GET /api/projects/{project_id}/issues?state=mutedResponse:
{
"data": [
{
"id": 1,
"short_id": "MY-APP-1",
"type": "TypeError",
"message": "Cannot read property 'name' of null",
"state": "open",
"event_count": 42,
"first_seen": "2024-01-10T08:00:00Z",
"last_seen": "2024-01-15T14:30:00Z"
}
]
}Get issue
GET /api/issues/{id}Update issue state
PATCH /api/issues/{id}
Content-Type: application/json
{
"state": "resolved"
}States: open, resolved, muted
Delete issue
DELETE /api/issues/{id}Events
List events for issue
GET /api/issues/{issue_id}/eventsResponse:
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2024-01-15T14:30:00Z",
"environment": "production",
"release": "1.0.0",
"user": {
"id": "123",
"email": "user@example.com"
}
}
]
}Get event
GET /api/events/{id}Returns full event data including:
- Stack traces
- Breadcrumbs
- Tags
- Context
- Request data
Tokens
List tokens
GET /api/tokensResponse (tokens are masked):
{
"data": [
{
"id": 1,
"token": "a1b2...****",
"description": "CI/CD Pipeline",
"created_at": "2024-01-15T10:30:00Z"
}
]
}Create token
POST /api/tokens
Content-Type: application/json
{
"description": "My Token"
}Response (full token shown once):
{
"id": 1,
"token": "a1b2c3d4e5f67890a1b2c3d4e5f67890a1b2c3d4",
"description": "My Token",
"created_at": "2024-01-15T10:30:00Z"
}Delete token
DELETE /api/tokens/{id}Notification Channels
List channels
GET /api/alert-channelsResponse:
[
{
"id": 1,
"name": "Slack Alerts",
"channel_type": "slack",
"config": { "webhook_url": "https://hooks.slack.com/..." },
"is_enabled": true,
"failure_count": 0,
"last_success_at": "2024-01-15T14:30:00Z",
"created_at": "2024-01-15T10:00:00Z"
}
]Create channel
POST /api/alert-channels
Content-Type: application/json
{
"name": "Slack Alerts",
"channel_type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/services/..."
},
"is_enabled": true
}Channel types: webhook, email, slack
Update channel
PATCH /api/alert-channels/{id}
Content-Type: application/json
{
"name": "Updated Name",
"is_enabled": false
}Delete channel
DELETE /api/alert-channels/{id}Test channel
POST /api/alert-channels/{id}/testResponse:
{
"success": true,
"message": "Test notification sent successfully"
}Alert Rules
List rules for project
GET /api/projects/{project_id}/alert-rulesResponse:
[
{
"id": 1,
"project_id": 1,
"name": "Notify on new issues",
"alert_type": "new_issue",
"is_enabled": true,
"conditions": {},
"cooldown_minutes": 5,
"channel_ids": [1, 2],
"created_at": "2024-01-15T10:00:00Z"
}
]Create rule
POST /api/projects/{project_id}/alert-rules
Content-Type: application/json
{
"name": "Notify on new issues",
"alert_type": "new_issue",
"channel_ids": [1, 2],
"is_enabled": true,
"cooldown_minutes": 5
}Alert types: new_issue, regression, unmute
Update rule
PATCH /api/projects/{project_id}/alert-rules/{rule_id}
Content-Type: application/json
{
"name": "Updated Name",
"is_enabled": false,
"channel_ids": [1]
}Delete rule
DELETE /api/projects/{project_id}/alert-rules/{rule_id}Get alert history
GET /api/projects/{project_id}/alert-history
GET /api/projects/{project_id}/alert-history?limit=50Response:
[
{
"id": 1,
"alert_type": "new_issue",
"channel_type": "slack",
"channel_name": "Slack Alerts",
"status": "sent",
"created_at": "2024-01-15T14:30:00Z",
"sent_at": "2024-01-15T14:30:01Z"
}
]Health
Health check
GET /healthResponse:
{
"status": "ok"
}Readiness check
GET /health/readyResponse:
{
"status": "ok",
"database": "connected"
}Event Ingestion
SDKs send events to:
POST /api/{project_id}/envelope/Authentication via DSN sentry_key or X-Sentry-Auth header.
This endpoint accepts Sentry envelope format and is not meant for direct use—use a Sentry SDK instead.
Error Codes
| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server error |
Last updated on