Skip to main content

Developer Documentation

Integrate Sentinel's AI-powered revenue intelligence into your applications.

API Reference

Complete API documentation with interactive examples

Webhooks

Real-time event notifications for your integrations

Quick Start

1. Authentication

All API requests require authentication. Include your API token in the Authorization header:

curl -X GET "https://api.sentinel.dev/api/deals" \
  -H "Authorization: Bearer your_api_token" \
  -H "Content-Type: application/json"

2. List Deals

// Response
{
  "success": true,
  "data": [
    {
      "id": "clx123abc",
      "name": "Acme Corp",
      "stage": "negotiation",
      "value": 50000,
      "riskLevel": "Low",
      "riskScore": 0.25
    }
  ]
}

3. Webhook Events

Configure webhooks to receive real-time notifications:

EventDescription
deal.createdNew deal added to pipeline
deal.stage_changedDeal moved to a different stage
deal.at_riskDeal flagged as high risk
deal.closed_wonDeal successfully closed
deal.closed_lostDeal lost

4. Webhook Payload

// Webhook payload example
{
  "id": "evt_abc123",
  "event": "deal.stage_changed",
  "timestamp": "2025-01-25T12:00:00Z",
  "data": {
    "id": "clx123abc",
    "name": "Acme Corp",
    "oldStage": "proposal",
    "newStage": "negotiation",
    "value": 50000
  }
}

// Verify webhook signature
const signature = req.headers["x-webhook-signature"];
const expectedSig = crypto
  .createHmac("sha256", webhookSecret)
  .update(JSON.stringify(payload))
  .digest("hex");

if (signature === expectedSig) {
  // Webhook is authentic
}