Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.costoptix.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Cost Optix can deliver budget and anomaly alerts to your existing communication tools via webhooks. Webhooks are available on all plans. Supported platforms:
  • Slack
  • Microsoft Teams (Workflow — recommended)
  • Microsoft Teams (Legacy connector — deprecated)
  • Discord
  • Custom HTTP endpoint

Setting Up a Webhook

  1. Navigate to Settings → Webhooks
  2. Click Add Webhook
  3. Select your platform
  4. Paste your webhook URL
  5. Choose which events to subscribe to
  6. Optionally add a secret for payload verification
  7. Click Save and use Test to verify delivery

Webhook URLs by Platform

Create an Incoming Webhook in your Slack workspace:
  1. Go to api.slack.com/apps and create a new app
  2. Enable Incoming Webhooks in the app settings
  3. Click Add New Webhook to Workspace and select a channel
  4. Copy the webhook URL (format: https://hooks.slack.com/services/...)

Event Types

Budget Events

EventTrigger
budget.warningSpend reaches the warning threshold (default 80%)
budget.criticalSpend reaches the critical threshold (default 95%)
budget.exceededSpend exceeds 100% of the budget

Anomaly Events

EventTrigger
anomaly.detectedA cost anomaly is detected

Report Events

EventTrigger
report.weeklyWeekly cost summary
report.monthlyMonthly cost summary

Payload Format

All deliveries use POST with Content-Type: application/json.

Budget alert

{
  "event": "budget.warning",
  "timestamp": "2025-03-01T14:32:00Z",
  "organization_id": "org_abc123",
  "data": {
    "budget_name": "Production AWS",
    "budget_amount": 5000.00,
    "current_spend": 4100.00,
    "utilization_percent": 82.0,
    "predicted_spend": 5800.00,
    "days_remaining": 14,
    "account": "aws:123456789012",
    "budget_id": "bud_xyz789"
  }
}

Anomaly alert

{
  "event": "anomaly.detected",
  "timestamp": "2025-03-01T09:15:00Z",
  "organization_id": "org_abc123",
  "data": {
    "service_name": "Amazon EC2",
    "account": "123456789012",
    "provider": "aws",
    "date": "2025-03-01",
    "amount": 340.50,
    "expected": 210.00,
    "deviation_percent": 62.1,
    "type": "spike",
    "severity": "high"
  }
}
For Slack, Teams, and Discord, Cost Optix sends a formatted message — not raw JSON. Budget alerts include a colour-coded card with spend details. Custom webhooks receive the raw JSON above.

Payload Verification

If you set a webhook secret, Cost Optix includes an X-Webhook-Signature header on every delivery signed with HMAC-SHA256. Verify it on your endpoint:
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = 'sha256=' + crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Delivery & Retries

Cost Optix attempts delivery up to 3 times with exponential backoff on non-2xx responses. View the full delivery history for each webhook in Settings → Webhooks → History, including HTTP status codes and response bodies.

Rate Limits

ActionLimit
Test a webhook5 per webhook per 5 minutes
Create webhooks20 per organisation per hour