Skip to Content
ReferenceAPI Reference

API Reference

Complete reference for the Rustrak REST API.

Base URL

http://your-server:8080/api

Authentication

All API requests require authentication via Bearer token:

curl -H "Authorization: Bearer YOUR_TOKEN" \ http://localhost:8080/api/projects

Create tokens in SettingsAPI 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/projects

Response:

{ "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=muted

Response:

{ "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}/events

Response:

{ "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/tokens

Response (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}

Health

Health check

GET /health

Response:

{ "status": "ok" }

Readiness check

GET /health/ready

Response:

{ "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

StatusMeaning
200Success
201Created
400Bad request
401Unauthorized
404Not found
429Rate limited
500Server error
Last updated on