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
- Navigate to Settings → Webhooks
- Click Add Webhook
- Select your platform
- Paste your webhook URL
- Choose which events to subscribe to
- Optionally add a secret for payload verification
- Click Save and use Test to verify delivery
Slack
Teams (Workflow)
Discord
Custom
Create an Incoming Webhook in your Slack workspace:
- Go to api.slack.com/apps and create a new app
- Enable Incoming Webhooks in the app settings
- Click Add New Webhook to Workspace and select a channel
- Copy the webhook URL (format:
https://hooks.slack.com/services/...)
The recommended method for Microsoft Teams. Uses Power Automate:
- In Teams, go to the channel where you want alerts
- Click ··· → Workflows
- Search for “Post to a channel when a webhook request is received”
- Follow the setup wizard and copy the workflow URL (format:
https://prod-xx.westus.logic.azure.com/workflows/...)
The Workflow connector is Microsoft’s current recommended approach. The legacy Office 365 connector is deprecated.
- In Discord, open the channel settings
- Navigate to Integrations → Webhooks → New Webhook
- Give it a name and copy the URL (format:
https://discord.com/api/webhooks/...)
Any HTTPS endpoint that accepts a POST request with a JSON body. Cost Optix sends a standard JSON payload — see Payload Format below.
Event Types
Budget Events
| Event | Trigger |
|---|
budget.warning | Spend reaches the warning threshold (default 80%) |
budget.critical | Spend reaches the critical threshold (default 95%) |
budget.exceeded | Spend exceeds 100% of the budget |
Anomaly Events
| Event | Trigger |
|---|
anomaly.detected | A cost anomaly is detected |
Report Events
| Event | Trigger |
|---|
report.weekly | Weekly cost summary |
report.monthly | Monthly cost summary |
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
| Action | Limit |
|---|
| Test a webhook | 5 per webhook per 5 minutes |
| Create webhooks | 20 per organisation per hour |