API Reference

EdLog provides two webhook endpoints for ingesting events. Both endpoints accept the same event structure but use different authentication methods.

Primary Webhook Endpoint

Send Event via /ingest

POST /ingest

The main endpoint for sending events to EdLog. Uses API key authentication via Authorization header.

Authentication:

Authorization: Bearer YOUR_API_KEY

Required Fields:

{
  "project_key": "string - Must match the project associated with the API key",
  "type": "string - Event category (e.g., deployment, uptime, error, metric)",
  "name": "string - Specific event name (e.g., deploy_started, http_check)",
  "timestamp": "ISO8601 - When the event occurred",
  "attributes": {} // Object with custom key-value pairs
}

Optional Fields:

{
  "severity": "info|warn|error|critical",
  "channel": "string - Sub-channel identifier",
  "correlation_id": "string - Links related events",
  "source": "string - Origin system/host",
  "labels": ["array", "of", "tags"]
}

Success Response (201 Created):

{
  "status": "accepted",
  "event_id": 12345,
  "message": "Event received and processed successfully",
  "quota_used": 150,
  "quota_limit": 10000,
  "rate_limit_remaining": 95
}

Error Responses:

401 Unauthorized - Missing or invalid API key:

{
  "status": "error",
  "message": "Invalid API key"
}

429 Too Many Requests - Rate limit exceeded:

{
  "status": "error",
  "message": "Rate limit exceeded. Please wait before sending more events.",
  "rate_limit": 100,
  "current_usage": 100,
  "retry_after": 60
}

402 Payment Required - Quota exceeded:

{
  "status": "error",
  "message": "Monthly quota exceeded. Upgrade your plan or wait for next month.",
  "quota_limit": 10000,
  "quota_used": 10000,
  "quota_reset_at": "2024-02-01T00:00:00Z"
}

Alternative API Endpoint

Send Event via API

POST /api/v1/webhooks

Alternative endpoint that accepts project key in the request body or header.

Authentication Options:

  • Include project_key in request body, OR
  • Set X-Project-Key header

Response Headers:

This endpoint includes rate limit information in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1640995200
X-Burst-Limit: 100
X-Burst-Remaining: 95
X-Burst-Reset: 1640995260

Notifications API

List Notification Services

GET /api/v1/notifications

Get configured notification services for your account.

Requires API authentication (user token, not project API key).

Send Test Notification

POST /api/v1/notifications/:id/send_message

Send a message through a specific notification service.

Request Body:

{
  "subject": "Test Alert",
  "body": "This is a test message from EdLog"
}

Rate Limiting

EdLog enforces rate limits to ensure fair usage and system stability:

  • Per-minute limit: 100 events per minute per project (burst protection)
  • Monthly quota: Configurable per project (default 10,000 events)

Note: The /ingest endpoint validates rate limits before processing. The /api/v1/webhooks endpoint returns rate limit information in response headers.

Complete Example

Sending a Deployment Event

curl -X POST https://your-edlog-domain.com/ingest \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_key": "api-server",
    "type": "deployment",
    "name": "deploy_finished",
    "timestamp": "2024-01-15T10:30:00Z",
    "severity": "info",
    "channel": "github",
    "correlation_id": "deploy-123",
    "attributes": {
      "version": "v2.1.0",
      "environment": "production",
      "deployed_by": "github-actions",
      "commit_sha": "abc123def456",
      "duration_seconds": 145,
      "status": "success"
    },
    "labels": ["production", "auto-deploy"]
  }'

What happens next:

  1. Event is validated and stored
  2. ProcessWebhookEventJob runs asynchronously to evaluate tile rules
  3. Matching tiles update their state based on rules
  4. Real-time update broadcasts via ActionCable
  5. Dashboard reflects changes immediately