twilio-debugging-observability
Debug Twilio integrations and set up production observability. Covers the Console Debugger, Monitor Alerts API, Event Streams for error log streaming, status callback tracking, common error codes, and a systematic debugging workflow. Use this skill whenever a Twilio integration produces errors, messages fail to deliver, calls drop unexpectedly, or you need to set up monitoring for a production deployment.
What this skill does
## Overview
Twilio provides several layers of debugging and observability: the Console Debugger for interactive troubleshooting, the Monitor REST API for programmatic alert queries, Event Streams for real-time error streaming, and status callbacks for per-resource delivery tracking. This skill covers the systematic approach to diagnosing issues and setting up production monitoring.
---
## Prerequisites
- Twilio account with `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` -- see `twilio-iam-auth-setup`
- SDK: `pip install twilio requests` / `npm install twilio`
- For Event Streams: a publicly accessible HTTPS endpoint or AWS Kinesis stream
---
## Quickstart
Check for recent errors on your account using the Monitor Alerts API.
**Python**
```python
import os
from twilio.rest import Client
client = Client(os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"])
alerts = client.monitor.alerts.list(log_level="error", limit=10)
for alert in alerts:
print(f"{alert.date_created}: [{alert.error_code}] {alert.alert_text}")
```
**Node.js**
```node
const twilio = require("twilio");
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
const alerts = await client.monitor.alerts.list({ logLevel: "error", limit: 10 });
alerts.forEach(a => {
console.log(`${a.dateCreated}: [${a.errorCode}] ${a.alertText}`);
});
```
---
## Key Patterns
### 1. Systematic Debugging Workflow
When something fails, work through these layers in order:
```
1. Check status callbacks FIRST
(Did your endpoint receive delivery/call status? What error code?)
|
2. Check the resource directly via REST API
(GET /Messages/{sid} or /Calls/{sid} — current state + error_code)
|
3. Check number reputation / sender registration
(Is the number spam-flagged? Is A2P 10DLC registered? Toll-free verified?)
|
4. Check the Console Debugger for webhook/TwiML errors
(Console > Monitor > Errors — shows HTTP request/response details)
|
5. Check your webhook endpoint
(Is it reachable? Responding within 15s? Returning valid TwiML/200?)
|
6. Query Monitor Alerts API or Event Streams
(For patterns across many messages/calls, or historical analysis)
```
**Why status callbacks first:** Status callbacks tell you the exact error code for the specific message or call that failed. The Console Debugger aggregates errors across your account and may not surface the one you're looking for. Start specific, then broaden.
**Number reputation checklist:**
- SMS 30007 (carrier filtering) → Check A2P 10DLC registration status, content for spam triggers
- SMS 30034 → Sender not registered for A2P 10DLC — register brand + campaign
- Calls going to voicemail / "Spam Likely" → Check STIR/SHAKEN attestation, Voice Integrity status (see `twilio-numbers-senders`)
- Toll-free SMS blocked → Check toll-free verification status
**Rule of thumb:** If status callbacks show `delivered` but the user says they didn't receive it, the issue is on the carrier/device side (not Twilio). If the Console Debugger shows no errors at all, the problem is in your application (webhook, TwiML, business logic).
### 2. Console Debugger
The [Console Debugger](https://console.twilio.com/us1/monitor/logs/debugger) shows errors and warnings for your account in real time.
Each entry includes:
- The exact error or warning that occurred
- Potential causes and suggested solutions
- The full HTTP request and response for the associated webhook
**Configure a Debugger webhook** for real-time alerting:
Console > Monitor > Logs > Debugger > (gear icon) > set Callback URL
Debugger webhook POST parameters:
| Parameter | Description |
|---|---|
| `Sid` | Debugger event identifier |
| `AccountSid` | Account that generated the event |
| `Level` | `Error` or `Warning` |
| `Timestamp` | ISO 8601 time |
| `Payload` | JSON: `resource_sid`, `error_code`, `more_info`, `webhook` (full request/response) |
**Python (Flask) -- debugger webhook handler**
```python
import json, os
from flask import Flask, request
from twilio.request_validator import RequestValidator
app = Flask(__name__)
validator = RequestValidator(os.environ["TWILIO_AUTH_TOKEN"])
@app.route("/debugger", methods=["POST"])
def debugger_event():
sig = request.headers.get("X-Twilio-Signature", "")
if not validator.validate(request.url, request.form, sig):
return "Forbidden", 403
level = request.form.get("Level")
payload = json.loads(request.form.get("Payload", "{}"))
error_code = payload.get("error_code")
resource_sid = payload.get("resource_sid")
msg = payload.get("more_info", {}).get("msg", "")
print(f"[{level}] Error {error_code} on {resource_sid}: {msg}")
return "", 204
```
**Node.js (Express) -- debugger webhook handler**
```node
const express = require("express");
const twilio = require("twilio");
const app = express();
app.use(express.urlencoded({ extended: false }));
app.post("/debugger", (req, res) => {
const valid = twilio.validateRequest(
process.env.TWILIO_AUTH_TOKEN,
req.headers["x-twilio-signature"],
`https://${req.headers.host}${req.originalUrl}`,
req.body
);
if (!valid) return res.status(403).send("Forbidden");
const payload = JSON.parse(req.body.Payload || "{}");
const { error_code, resource_sid } = payload;
const msg = payload.more_info?.msg || "";
console.log(`[${req.body.Level}] Error ${error_code} on ${resource_sid}: ${msg}`);
res.sendStatus(204);
});
```
### 3. Monitor Alerts API
The Monitor REST API (`monitor.twilio.com/v1/Alerts`) provides programmatic access to error and warning logs. Individual alert instances include the full HTTP request and response data.
**Python -- query alerts with date filtering**
```python
from datetime import datetime, timedelta
# Alerts from the last 24 hours
start = datetime.utcnow() - timedelta(days=1)
alerts = client.monitor.alerts.list(
start_date=start,
log_level="error",
limit=50
)
for alert in alerts:
print(f"{alert.date_created} [{alert.error_code}]")
# Fetch full details including HTTP request/response
detail = client.monitor.alerts(alert.sid).fetch()
print(f" Request URL: {detail.request_url}")
print(f" Response body: {detail.response_body}")
```
**Node.js -- query alerts with date filtering**
```node
const startDate = new Date(Date.now() - 24 * 60 * 60 * 1000);
const alerts = await client.monitor.alerts.list({
startDate,
logLevel: "error",
limit: 50,
});
for (const alert of alerts) {
console.log(`${alert.dateCreated} [${alert.errorCode}]`);
const detail = await client.monitor.alerts(alert.sid).fetch();
console.log(` Request URL: ${detail.requestUrl}`);
console.log(` Response body: ${detail.responseBody}`);
}
```
**Retention:** Enterprise accounts: 13 months. Free accounts: 30 days.
### 4. Monitor Events API
The Events resource (`monitor.twilio.com/v1/Events`) tracks all changes to Twilio resources -- phone number provisioning, account settings, recording access, API key creation, and more.
**Python -- audit recent account changes**
```python
events = client.monitor.events.list(limit=20)
for event in events:
print(f"{event.event_date}: {event.event_type}")
print(f" Resource: {event.resource_type} ({event.resource_sid})")
print(f" Actor: {event.actor_type} ({event.actor_sid}) from {event.source_ip_address}")
```
Each event captures: event type, resource, actor (who triggered it), source (API / Console / Twilio admin), and IP address.
**Use cases:**
- Audit who changed a phone number's webhook URL
- Track API key creation and deletion
- Detect unexpected configuration changes
- Feed events into a SIEM for security monitoring
### 5. Event Streams for Error Log Streaming
For production monitoring, stream errors to your infrastructure in real time using Event Streams. The Twilio SDK does not wrap Event Streams -- use `requests` / `fetch` directly.
**Python -- set Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.