Overview
Webhooks are how CostOptix tells you something happened. Every alert in the product (budgets, daily limits, anomalies, runaway AI sessions, expiring credentials) goes out by webhook. Webhooks are available on every plan. Supported destinations:- Slack
- Microsoft Teams (Workflow, recommended)
- Microsoft Teams (legacy connector, deprecated by Microsoft)
- Discord
- Any HTTPS endpoint (custom)
Setting up a webhook
- Go to Settings → Webhooks and click Add Webhook.
- Pick the destination and paste its webhook URL.
- Choose the events to subscribe to.
- Optionally add a secret so you can verify deliveries.
- Save, then click Test to send a test message.
- Slack
- Teams (Workflow)
- Discord
- Custom
- Go to api.slack.com/apps and create an app.
- Turn on Incoming Webhooks.
- Click Add New Webhook to Workspace and pick a channel.
- Copy the URL (
https://hooks.slack.com/services/...).
Events
Payload format
Slack, Teams and Discord get a formatted message. Custom endpoints get raw JSON, sent asPOST with Content-Type: application/json. Every payload has the same envelope:
Budget (budget.warning, budget.critical, budget.exceeded)
Budget (budget.warning, budget.critical, budget.exceeded)
breached_on is the projected breach date, or empty when none is projected. excluded_currencies lists plan currencies left out of an AI / LLM budget.Unit cost (unit_cost.changed)
Unit cost (unit_cost.changed)
reason is spike when a daily cost per unit jumps above its recent history, with expected and rise_percent. It is above_target when a month passes the metric’s target, with target and final (whether the month’s costs have settled) instead. scope is org, team or selection. Team metrics add team_id and team_name.Anomaly (anomaly.detected)
Anomaly (anomaly.detected)
type is spike or stopped. top_resources is included when resource detail is available.Daily limit (spend.daily_exceeded)
Daily limit (spend.daily_exceeded)
Runaway AI session (llm.runaway_session)
Runaway AI session (llm.runaway_session)
user_key is a pseudonymous ID, never an email address.Verifying deliveries
If you set a secret, every delivery carries anX-Webhook-Signature header: sha256= followed by the HMAC-SHA256 of the raw request body, using your secret as the key. Check it before trusting the payload:
Delivery and retries
- Each delivery is tried up to 3 times, waiting longer between attempts.
- A
4xxresponse is not retried, since it means the request itself was rejected. - Payloads are capped at 100 KB.
- The last 50 deliveries for each webhook, with status codes and responses, are under History in Settings → Webhooks.