{"success":true,"data":{"name":"ThruAI Public API","version":"1.13.0","description":"Programmatic access to ThruAI platform for AI agent account provisioning, agent management, telephony, email, SMS, billing, knowledge base, workflows, campaigns, and A2P 10DLC compliance.","documentation":{"llms_txt":"/llms.txt","llms_full_txt":"/llms-full.txt","quickstart":"/api/v1/public/quickstart","guides":"/api/v1/public/docs","ai_plugin":"/.well-known/ai-plugin.json","agents_json":"/agents.json","openapi_json":"/openapi.json"},"changelog":[{"version":"1.13.0","date":"2026-03-16","changes":["Added email domain with public API routes for email domain management, email sending, and email thread/message retrieval","Email endpoints: GET /email-domains, POST /email-domains, POST /email-domains/:id/verify, DELETE /email-domains/:id, POST /emails/send, GET /email-threads, GET /email-threads/:id, GET /email-threads/:id/messages","Added email:read and email:write to default API key permissions","Added knowledge domain with crawl, query, and chunks endpoints to API contract","Added POST /agents/quickstart to agents domain for one-shot agent creation","Added GET /analytics/agents/:id and GET /analytics/recommendations to analytics domain","Added POST /billing/charge to billing domain for direct usage charges","Added PATCH /webhooks/:id to webhooks domain for updating webhook subscriptions","Added MCP tools: list_email_domains, add_email_domain, verify_email_domain, delete_email_domain, configure_agent_email, send_agent_email","Added update_webhook tool for modifying existing webhook subscriptions (URL, events, enabled status)","Expanded webhook event types to include all emitted events: call.started, call.failed, workflow.triggered, agent.updated, a2p.brand.status_changed, a2p.campaign.status_changed","Wired A2P compliance tools into Claude agent for conversational SMS compliance setup","Wired email management tools into Claude agent for branded email setup without dashboard"]},{"version":"1.12.0","date":"2026-03-09","changes":["S2S telephony calls now support real-time interruption — agent audio stops instantly when the caller speaks","Twilio media stream buffer is cleared on barge-in, eliminating 0.5-2s of stale agent audio after interruption","Stale audio deltas from OpenAI Realtime are now discarded during the cancellation window, preventing post-interrupt audio leaks","Interruption handling is now unified across traditional (STT→LLM→TTS) and S2S pipelines"]},{"version":"1.11.1","date":"2026-03-09","changes":["Added noiseReduction default (near_field) to /capabilities S2S pipeline discovery","Fixed /agents/:id/simulate background_noise scenario to check s2sConfig.noiseReduction (was incorrectly checking voiceSettings)","Telephony calls now receive noise reduction parity with browser sessions via unified config pipeline","Added PUT /telephony/credentials for BYOC Twilio credential configuration (validates against Twilio API)","Added GET /telephony/numbers/external for discovering numbers in an external Twilio account","Added POST /telephony/numbers/import for importing existing Twilio numbers with automatic webhook configuration","Fixed phone number import to persist twilioAccountSid and voiceWebhookUrl for per-number credential resolution"]},{"version":"1.11.0","date":"2026-03-09","changes":["Added memoryPolicy field on agents for data classification, namespace scoping, retention, and policy hooks","Enhanced /agents/:id/preview with riskScore, riskLevel, missingSafetyVariables, and hardFail mode","Added POST /agents/:id/simulate for scenario-based readiness testing (wrong_party, failed_verification, opt_out, etc.)","Added GET /profile for autonomous agent session bootstrapping (identity, permissions, actions, resources, quickStart)","Added roadmap section to /capabilities with planned features and deprecations"]},{"version":"1.10.0","date":"2026-03-09","changes":["Added metadata compatibility matrix to /capabilities for deterministic field-name resolution across resources","Enhanced /compliance/a2p/status with substatus, estimatedWindow, and machine-actionable nextActions[] array","Added X-Trace-Id and X-Parent-Id header propagation for end-to-end request correlation","Added traceId to all response meta objects for cross-resource event stitching","Added Idempotency-Key header support on all mutating endpoints (24h TTL, X-Idempotent-Replayed indicator)","Added POST /webhooks/:id/replay for replaying failed deliveries by ID or time window","Added memory policy controls to agent config: memoryPolicy with verification gating, namespace scoping, data classification, and policy hooks","Enhanced POST /agents/:id/preview with risk scoring, hard-fail validation, and safety variable detection","Added POST /agents/:id/simulate for safe scenario testing (wrong-party, failed-verification, interruption, opt-out)","Added autonomous mode profile to /capabilities with strict contracts, mandatory preflight, deterministic retries","Added roadmap and deprecation schedule to /capabilities for programmatic version tracking"]},{"version":"1.9.0","date":"2026-03-06","changes":["Added compliance domain for A2P 10DLC registration via API and MCP","Endpoints: GET /compliance/a2p/status, GET /compliance/a2p/config, POST /compliance/a2p/brands/validate, POST /compliance/a2p/brands, GET /compliance/a2p/brands/:id, POST /compliance/a2p/brands/:id/refresh, POST /compliance/a2p/campaigns/validate, POST /compliance/a2p/campaigns, POST /compliance/a2p/campaigns/:id/refresh, POST /compliance/a2p/campaigns/:id/phone-numbers","Brand registration returns unique Application ID (BRN-xxx) immediately on submission","Status endpoint returns actionable blockingReasons[] and nextAction for AI agent guidance","Added compliance:read and compliance:write to default API key permissions","Added webhook events: a2p.brand.status_changed, a2p.campaign.status_changed","Added MCP tools: get_a2p_status, get_a2p_config, submit_a2p_brand, refresh_a2p_brand, submit_a2p_campaign, refresh_a2p_campaign, link_phone_to_campaign"]},{"version":"1.8.0","date":"2026-02-15","changes":["Added tools domain for custom webhook-based function calling during live voice conversations","Tool endpoints: POST /tools (create), GET /tools (list), GET /tools/:id (get), PATCH /tools/:id (update), DELETE /tools/:id (delete), POST /tools/:id/test (test)","Tools are webhook endpoints that agents invoke in real-time during calls — distinct from webhooks which are post-event notifications","Added tools:read and tools:write to default API key permissions","Tools support HMAC signature verification, custom headers, configurable timeout (1-30s), and flexible response formats"]},{"version":"1.7.0","date":"2026-02-10","changes":["Added GET /webhooks/:id/deliveries endpoint to retrieve webhook delivery logs","Delivery logs include status (pending/sent/failed/retrying), HTTP status code, response time, error messages, and retry information","Supports pagination via limit and offset query parameters (max 100 per page)","Enables tracking of webhook reliability and debugging delivery issues"]},{"version":"1.6.0","date":"2026-02-10","changes":["Added webhooks domain to API contract with 5 endpoints for real-time event notifications","Webhook endpoints: POST /webhooks (create), GET /webhooks (list), GET /webhooks/:id (get), DELETE /webhooks/:id (delete), POST /webhooks/:id/test (test)","Added webhooks:read and webhooks:write to default API key permissions","Added providers:read to UI permission selectors (was missing from frontend)","Added webhooks:read to UI permission selectors (was write-only before)","All API keys created after this version will have webhook permissions by default"]},{"version":"1.5.0","date":"2026-02-10","changes":["Added interruptionSettings to POST /agents and PATCH /agents/:id for configuring barge-in behavior (traditional pipeline)","Fields: enabled, sensitivityMs (100-2000), minSilenceMs (100-3000), bargeInDuringGreeting, bargeInConfidence (0-1), echoConfidence (0-1), falseInterruptionTimeoutMs (500-5000)","Added s2sTurnDetection to POST /agents and PATCH /agents/:id for configuring Voice Activity Detection (S2S pipeline)","Fields: type (server_vad|semantic_vad), threshold (0-1), prefixPaddingMs (0-2000), silenceDurationMs (200-3000), eagerness (low|medium|high)","All new fields are optional and use sensible defaults if omitted","Settings take effect immediately for new calls without requiring agent redeployment","See AI_AGENT_API_GUIDE.md for tuning guides and use case recommendations"]},{"version":"1.4.0","date":"2026-02-09","changes":["BREAKING: GET /campaigns/:id/stats response structure changed from flat to nested","Response now: { campaignId, stats: { total, queued, inProgress, completed, failed, suppressed }, percentComplete, successRate }","Old flat structure removed: { total, pending, inProgress, completed, failed, suppressed, percentComplete, successRate }","Field renamed: \"pending\" → \"queued\" (in stats object) for consistency with backend terminology","Both percentComplete and successRate now calculated server-side using shared logic","Migration: Access stats via nested structure (e.g., response.stats.completed instead of response.completed)"]},{"version":"1.3.0","date":"2026-02-09","changes":["Added GET /docs endpoint listing all available API guides","Added GET /docs/:slug endpoint serving full guide content as markdown (no auth required)","Guides available: getting-started, agent-design, workflows, ai-agent-integration, migration","Supports Accept: text/markdown header for raw markdown responses"]},{"version":"1.2.1","date":"2026-02-09","changes":["Added strict request validation - unknown fields now rejected with 400 error (prevents typos like \"agentID\" from being silently ignored)","Added contextual error messages - errors now include resource IDs (\"Agent 'AGT-123' not found\" vs \"Agent not found\")","Added production-safe debug endpoints: GET /_debug/schemas, /_debug/campaigns/:id, /_debug/version","Schema documentation now available at /_debug/schemas to prevent field name typos","Campaign state inspection at /_debug/campaigns/:id to diagnose \"success but nothing happens\" issues"]},{"version":"1.2.0","date":"2026-02-08","changes":["BREAKING: Campaign progress endpoint now returns flat structure with pending (was queued) and successRate fields","Added GET /campaigns/:id/progress endpoint for real-time campaign monitoring","Added successRate calculation: (completed / totalAttempted) * 100","Unified workflow type definitions to prevent schema drift"]},{"version":"1.1.0","date":"2026-02-08","changes":["Added GET / discovery endpoint for full API self-description","Added X-Request-Id passthrough for agent tracing","Added X-API-Version response header on all responses","Added provider discovery endpoints (GET /providers, voices, models, stt-models)","Added changelog to API contract for programmatic version tracking"]},{"version":"1.0.0","date":"2025-01-01","changes":["Initial public API release with agents, calls, telephony, billing, workflows, campaigns, and feedback"]}],"baseUrl":"https://thru.ai","basePath":"/api/v1/public","authentication":{"type":"bearer","headerName":"Authorization","format":"Bearer sk_live_...","obtainedVia":"2-step API flow (no auth required): POST /accounts/provision → email verification code sent → POST /accounts/verify with code → returns apiKey. No web signup or dashboard needed."},"rateLimits":{"provisioning":{"maxRequests":5,"windowMs":3600000,"description":"5 requests per hour per IP"},"authenticated":{"description":"Standard rate limits based on subscription plan"}},"responseEnvelope":{"success":"boolean","data":"T | null","error":"{ code: string, message: string } | null","meta":"{ requestId: string, timestamp: string, pagination?: { page, pageSize, total, hasMore } }"},"errorCodes":{"TWILIO_AUTH_ERROR":{"status":502,"description":"Twilio authentication failed","source":"telephony"},"TWILIO_PERMISSION_DENIED":{"status":502,"description":"Twilio account lacks required permissions","source":"telephony"},"RATE_LIMITED":{"status":429,"description":"Rate limit exceeded (may originate from telephony or payment providers)","source":"telephony/payment"},"BILLING_REQUIRED":{"status":402,"description":"Billing setup required or insufficient balance","source":"telephony"},"INVALID_NUMBER":{"status":400,"description":"Invalid phone number","source":"telephony"},"NOT_FOUND":{"status":404,"description":"Resource not found (may originate from telephony or general route lookups)","source":"telephony/general"},"TELEPHONY_ERROR":{"status":502,"description":"Unexpected telephony error","source":"telephony"},"PAYMENT_FAILED":{"status":402,"description":"Payment method declined","source":"payment"},"STRIPE_INVALID_REQUEST":{"status":400,"description":"Invalid payment request","source":"payment"},"STRIPE_AUTH_ERROR":{"status":502,"description":"Payment provider authentication failed","source":"payment"},"STRIPE_UNAVAILABLE":{"status":502,"description":"Payment provider temporarily unavailable","source":"payment"},"STRIPE_PERMISSION_DENIED":{"status":502,"description":"Payment provider permission denied","source":"payment"},"PAYMENT_ERROR":{"status":502,"description":"Unexpected payment error","source":"payment"},"DOMAIN_NOT_VERIFIED":{"status":400,"description":"Email domain is not verified — verify via POST /email-domains/:id/verify before sending","source":"email"},"EMAIL_PROVIDER_ERROR":{"status":502,"description":"Unexpected email provider error","source":"email"},"VALIDATION_ERROR":{"status":400,"description":"Request validation failed","source":"validation"},"RESOURCE_CONFLICT":{"status":409,"description":"Record already exists (duplicate)","source":"database"},"RELATED_NOT_FOUND":{"status":404,"description":"Referenced record not found","source":"database"},"DATABASE_ERROR":{"status":500,"description":"Database error","source":"database"},"SERVICE_UNAVAILABLE":{"status":503,"description":"Database temporarily unavailable","source":"database"},"UPSTREAM_UNAVAILABLE":{"status":502,"description":"An upstream service is temporarily unavailable (network-level failure)","source":"network"},"INTERNAL_ERROR":{"status":500,"description":"Unexpected error (fallback)"},"UNAUTHORIZED":{"status":401,"description":"Authentication required","source":"authentication"},"FORBIDDEN":{"status":403,"description":"Insufficient permissions","source":"authentication"},"USER_EXISTS":{"status":409,"description":"A user with this email already exists","source":"provisioning"},"SLUG_TAKEN":{"status":409,"description":"Organization slug already taken","source":"provisioning"},"INVALID_CODE":{"status":401,"description":"Invalid or expired verification code","source":"provisioning"},"CODE_EXPIRED":{"status":401,"description":"Verification code has expired","source":"provisioning"},"CREATE_FAILED":{"status":500,"description":"Failed to create resource","source":"general"},"FETCH_FAILED":{"status":500,"description":"Failed to fetch resource","source":"general"},"UPDATE_FAILED":{"status":500,"description":"Failed to update resource","source":"general"},"DELETE_FAILED":{"status":500,"description":"Failed to delete resource","source":"general"},"TRIGGER_FAILED":{"status":500,"description":"Failed to trigger workflow execution","source":"workflows"},"PUBLISH_FAILED":{"status":500,"description":"Failed to publish workflow","source":"workflows"},"UNPUBLISH_FAILED":{"status":500,"description":"Failed to unpublish workflow","source":"workflows"},"SUBSCRIPTION_EXISTS":{"status":400,"description":"Organization already has an active subscription","source":"billing"},"MISSING_EMAIL":{"status":400,"description":"No billing or owner email found","source":"billing"},"INVALID_PLAN":{"status":400,"description":"Specified plan not found","source":"billing"},"NO_CUSTOMER":{"status":400,"description":"No billing customer exists","source":"billing"},"BRAND_NOT_FOUND":{"status":404,"description":"A2P brand registration not found","source":"compliance"},"BRAND_NOT_APPROVED":{"status":400,"description":"Brand must be approved before this action","source":"compliance"},"BRAND_EXISTS":{"status":409,"description":"Organization already has a brand registration","source":"compliance"},"CAMPAIGN_NOT_FOUND":{"status":404,"description":"A2P campaign not found","source":"compliance"},"CAMPAIGN_NOT_APPROVED":{"status":400,"description":"Campaign must be approved before adding phone numbers","source":"compliance"},"TWILIO_NOT_CONFIGURED":{"status":400,"description":"No Twilio credentials configured — use PUT /telephony/credentials to set up BYOC","source":"telephony"},"TWILIO_AUTH_FAILED":{"status":401,"description":"Twilio credential validation failed — check Account SID and Auth Token","source":"telephony"},"TWILIO_ACCOUNT_SUSPENDED":{"status":403,"description":"Twilio account is suspended — contact Twilio support","source":"telephony"},"NUMBER_CONFLICT":{"status":409,"description":"Phone number belongs to a different organization","source":"telephony"},"STRIPE_NOT_CONFIGURED":{"status":503,"description":"Payment processing not configured","source":"billing"},"TELEPHONY_NOT_CONFIGURED":{"status":400,"description":"No phone numbers configured for organization","source":"telephony"},"NO_ACTIVE_NUMBERS":{"status":400,"description":"No active phone numbers available","source":"telephony"},"NUMBER_EXISTS":{"status":409,"description":"Phone number already provisioned","source":"telephony"},"INVALID_AGENT":{"status":400,"description":"Agent not found or does not belong to organization","source":"agents"},"INVALID_WORKFLOW":{"status":400,"description":"Workflow not found or does not belong to organization","source":"workflows"},"WORKFLOW_NOT_PUBLISHED":{"status":400,"description":"Workflow is not published","source":"workflows"},"API_KEY_MISSING":{"status":401,"description":"API key required","source":"authentication"},"INVALID_API_KEY":{"status":401,"description":"Invalid API key","source":"authentication"},"INVALID_API_KEY_FORMAT":{"status":401,"description":"API key format is invalid","source":"authentication"},"API_KEY_REVOKED":{"status":401,"description":"API key has been revoked","source":"authentication"},"API_KEY_EXPIRED":{"status":401,"description":"API key has expired","source":"authentication"},"RATE_LIMIT_EXCEEDED":{"status":429,"description":"Too many requests","source":"general"},"INVALID_STATE":{"status":400,"description":"Resource is in an invalid state for the requested operation","source":"general"}},"domains":{"discovery":{"description":"API self-description and discovery","endpoints":[{"method":"GET","path":"/","auth":false,"safe":true,"description":"Returns the full API contract including all endpoints, error codes, and authentication requirements"},{"method":"GET","path":"/capabilities","auth":false,"safe":true,"description":"Machine-readable capability discovery: endpoint availability, provider matrix, pipeline modes, feature status, required scopes, and operational limits"}]},"docs":{"description":"API documentation and guides (no auth required)","endpoints":[{"method":"GET","path":"/docs","auth":false,"safe":true,"description":"List all available API guides with slugs and descriptions"},{"method":"GET","path":"/docs/:slug","auth":false,"safe":true,"description":"Get full guide content by slug. Supports Accept: text/markdown for raw markdown."}]},"health":{"description":"API health check","endpoints":[{"method":"GET","path":"/health","auth":false,"safe":true,"description":"Health check endpoint"}]},"accountProvisioning":{"description":"Create accounts entirely via API — NO authentication required for these endpoints. No web signup or dashboard needed.","endpoints":[{"method":"POST","path":"/accounts/provision","auth":false,"description":"Step 1 (NO AUTH): Send email and org name to receive a 6-digit verification code via email"},{"method":"POST","path":"/accounts/verify","auth":false,"description":"Step 2 (NO AUTH): Submit the emailed code to create account and receive API key (sk_live_...)"}]},"accountInfo":{"description":"Retrieve organization details","endpoints":[{"method":"GET","path":"/accounts/me","auth":true,"permission":"billing:read","safe":true,"description":"Get current organization info"}]},"profile":{"description":"Autonomous agent session bootstrapping — returns identity, permissions, available actions, resource counts, and next-step guidance","endpoints":[{"method":"GET","path":"/profile","auth":true,"safe":true,"description":"Get caller identity, granted permissions, action map, resource counts, and contextual quickStart guidance"}]},"agents":{"description":"Create and manage AI agents","endpoints":[{"method":"GET","path":"/agents","auth":true,"permission":"agents:read","safe":true,"description":"List all agents"},{"method":"GET","path":"/agents/:id","auth":true,"permission":"agents:read","safe":true,"description":"Get agent by ID"},{"method":"POST","path":"/agents","auth":true,"permission":"agents:write","description":"Create a new agent"},{"method":"PATCH","path":"/agents/:id","auth":true,"permission":"agents:write","description":"Update an agent"},{"method":"DELETE","path":"/agents/:id","auth":true,"permission":"agents:write","description":"Delete an agent"},{"method":"GET","path":"/agents/:id/telephony","auth":true,"permission":"agents:read","safe":true,"description":"List phone numbers assigned to agent"},{"method":"POST","path":"/agents/:id/telephony","auth":true,"permission":"agents:write","description":"Assign phone number to agent"},{"method":"DELETE","path":"/agents/:id/telephony/:phoneNumberId","auth":true,"permission":"agents:write","description":"Remove phone number from agent"},{"method":"POST","path":"/agents/:id/preview","auth":true,"permission":"agents:read","safe":true,"description":"Preview variable substitution for agent prompts"},{"method":"POST","path":"/agents/:id/preflight","auth":true,"permission":"agents:read","safe":true,"description":"Validate agent configuration before launch: prompt integrity, provider readiness, template placeholders, voice quality score, and compliance status"},{"method":"POST","path":"/agents/:id/simulate","auth":true,"permission":"agents:read","safe":true,"description":"Run scenario simulation (wrong_party, failed_verification, interruption, opt_out, silence, etc.) to test agent readiness without making real calls"},{"method":"POST","path":"/agents/quickstart","auth":true,"permission":"agents:write","description":"One-shot agent creation with sensible defaults — creates agent, searches for a phone number, provisions it, and assigns it in a single call"}]},"telephony":{"description":"Search, provision, import, and manage phone numbers. Supports BYOC (Bring Your Own Carrier) — use your own Twilio credentials.","endpoints":[{"method":"PUT","path":"/telephony/credentials","auth":true,"permission":"telephony:write","description":"Configure BYOC Twilio credentials (validates against Twilio API)"},{"method":"GET","path":"/telephony/numbers","auth":true,"permission":"telephony:read","safe":true,"description":"List phone numbers"},{"method":"GET","path":"/telephony/numbers/external","auth":true,"permission":"telephony:read","safe":true,"description":"Discover numbers in your Twilio account (for import)"},{"method":"POST","path":"/telephony/numbers/search","auth":true,"permission":"telephony:read","description":"Search available numbers to purchase"},{"method":"POST","path":"/telephony/numbers/provision","auth":true,"permission":"telephony:write","description":"Purchase and provision a new phone number"},{"method":"POST","path":"/telephony/numbers/import","auth":true,"permission":"telephony:write","description":"Import an existing number from your Twilio account"},{"method":"DELETE","path":"/telephony/numbers/:id","auth":true,"permission":"telephony:write","description":"Release a phone number"},{"method":"PATCH","path":"/telephony/numbers/:id","auth":true,"permission":"telephony:write","description":"Update phone number config"}]},"calls":{"description":"View call records, transcripts, and initiate outbound calls","endpoints":[{"method":"GET","path":"/calls","auth":true,"permission":"calls:read","safe":true,"description":"List call records"},{"method":"GET","path":"/calls/:id","auth":true,"permission":"calls:read","safe":true,"description":"Get call by ID"},{"method":"GET","path":"/calls/:id/transcript","auth":true,"permission":"calls:read","safe":true,"description":"Get call transcript"},{"method":"GET","path":"/calls/:id/debug","auth":true,"permission":"calls:read","safe":true,"description":"Get call debug timeline and troubleshooting"},{"method":"POST","path":"/calls/outbound","auth":true,"permission":"calls:write","description":"Initiate outbound call"}]},"analytics":{"description":"Usage, cost, and per-agent performance analytics with AI-powered recommendations","endpoints":[{"method":"GET","path":"/analytics/usage","auth":true,"permission":"analytics:read","safe":true,"description":"Get usage analytics"},{"method":"GET","path":"/analytics/costs","auth":true,"permission":"analytics:read","safe":true,"description":"Get cost analytics"},{"method":"GET","path":"/analytics/agents/:id","auth":true,"permission":"agents:read","safe":true,"description":"Get per-agent analytics including call metrics, sentiment, resolution rate, trends, and turn-taking analysis"},{"method":"GET","path":"/analytics/recommendations","auth":true,"permission":"agents:read","safe":true,"description":"AI-powered prompt improvement recommendations based on call patterns (requires Anthropic API key)"}]},"billing":{"description":"Subscription and invoice management","endpoints":[{"method":"GET","path":"/billing/plans","auth":true,"permission":"billing:read","safe":true,"description":"List available plans"},{"method":"POST","path":"/billing/checkout","auth":true,"permission":"billing:write","description":"Create checkout session"},{"method":"POST","path":"/billing/portal","auth":true,"permission":"billing:write","description":"Create billing portal session"},{"method":"GET","path":"/billing/subscription","auth":true,"permission":"billing:read","safe":true,"description":"Get subscription status"},{"method":"GET","path":"/billing/payment-methods","auth":true,"permission":"billing:read","safe":true,"description":"List payment methods"},{"method":"GET","path":"/billing/invoices","auth":true,"permission":"billing:read","safe":true,"description":"List invoices"},{"method":"GET","path":"/billing/invoices/:id","auth":true,"permission":"billing:read","safe":true,"description":"Get invoice by ID"},{"method":"POST","path":"/billing/charge","auth":true,"permission":"billing:write","description":"Create a direct usage charge against the default payment method"}]},"workflows":{"description":"Build and manage call workflows","endpoints":[{"method":"GET","path":"/workflows","auth":true,"permission":"workflows:read","safe":true,"description":"List workflows"},{"method":"GET","path":"/workflows/:id","auth":true,"permission":"workflows:read","safe":true,"description":"Get workflow by ID"},{"method":"POST","path":"/workflows","auth":true,"permission":"workflows:write","description":"Create workflow"},{"method":"PATCH","path":"/workflows/:id","auth":true,"permission":"workflows:write","description":"Update workflow"},{"method":"DELETE","path":"/workflows/:id","auth":true,"permission":"workflows:write","description":"Delete workflow"},{"method":"POST","path":"/workflows/:id/publish","auth":true,"permission":"workflows:write","description":"Publish workflow"},{"method":"POST","path":"/workflows/:id/unpublish","auth":true,"permission":"workflows:write","description":"Unpublish workflow"},{"method":"POST","path":"/workflows/:id/trigger","auth":true,"permission":"workflows:write","description":"Trigger workflow execution"},{"method":"GET","path":"/workflows/:id/executions","auth":true,"permission":"workflows:read","safe":true,"description":"List workflow executions"}]},"campaigns":{"description":"Outbound calling campaigns","endpoints":[{"method":"GET","path":"/campaigns","auth":true,"permission":"campaigns:read","safe":true,"description":"List campaigns"},{"method":"GET","path":"/campaigns/:id","auth":true,"permission":"campaigns:read","safe":true,"description":"Get campaign by ID"},{"method":"POST","path":"/campaigns","auth":true,"permission":"campaigns:write","description":"Create campaign"},{"method":"PATCH","path":"/campaigns/:id","auth":true,"permission":"campaigns:write","description":"Update campaign"},{"method":"DELETE","path":"/campaigns/:id","auth":true,"permission":"campaigns:write","description":"Delete campaign"},{"method":"POST","path":"/campaigns/:id/start","auth":true,"permission":"campaigns:write","description":"Start campaign"},{"method":"POST","path":"/campaigns/:id/pause","auth":true,"permission":"campaigns:write","description":"Pause campaign"},{"method":"GET","path":"/campaigns/:id/contacts","auth":true,"permission":"campaigns:read","safe":true,"description":"List campaign contacts"},{"method":"POST","path":"/campaigns/:id/contacts","auth":true,"permission":"campaigns:write","description":"Add contacts to campaign"},{"method":"GET","path":"/campaigns/:id/stats","auth":true,"permission":"campaigns:read","safe":true,"description":"Get campaign statistics with real-time progress, success rate, and contact status breakdown"}]},"sms":{"description":"Send and receive SMS messages, manage conversations and opt-outs","endpoints":[{"method":"POST","path":"/sms","auth":true,"permission":"telephony:write","description":"Send an SMS message (RESTful alias)"},{"method":"POST","path":"/sms/messages","auth":true,"permission":"telephony:write","description":"Send an SMS message"},{"method":"POST","path":"/sms/send","auth":true,"permission":"telephony:write","description":"Send an SMS message (alias for POST /sms/messages)"},{"method":"GET","path":"/sms/messages","auth":true,"permission":"telephony:read","safe":true,"description":"List SMS messages"},{"method":"GET","path":"/sms/messages/:id","auth":true,"permission":"telephony:read","safe":true,"description":"Get SMS message by ID"},{"method":"GET","path":"/sms/conversations","auth":true,"permission":"telephony:read","safe":true,"description":"List SMS conversations"},{"method":"GET","path":"/sms/conversations/:id/messages","auth":true,"permission":"telephony:read","safe":true,"description":"Get SMS conversation messages"},{"method":"GET","path":"/sms/opt-outs","auth":true,"permission":"telephony:read","safe":true,"description":"List SMS opt-outs"}]},"email":{"description":"Manage email domains and agent email configuration. Add custom domains, verify DNS, configure branded agent email addresses, send emails, and browse conversation threads. Requires a verified domain via Resend.","endpoints":[{"method":"GET","path":"/email-domains","auth":true,"permission":"email:read","safe":true,"description":"List all email domains with verification status and DNS records"},{"method":"POST","path":"/email-domains","auth":true,"permission":"email:write","description":"Add a custom email domain. Returns DNS records to configure at your registrar."},{"method":"POST","path":"/email-domains/:id/verify","auth":true,"permission":"email:write","description":"Trigger DNS verification for a domain after adding required records"},{"method":"DELETE","path":"/email-domains/:id","auth":true,"permission":"email:write","description":"Delete an email domain and clean up agent configurations"},{"method":"POST","path":"/emails/send","auth":true,"permission":"email:write","description":"Send an email from an agent or the organization. Requires a verified domain."},{"method":"GET","path":"/emails","auth":true,"permission":"email:read","safe":true,"description":"List all emails"},{"method":"GET","path":"/email-threads","auth":true,"permission":"email:read","safe":true,"description":"List email conversation threads with pagination and optional status filter"},{"method":"GET","path":"/email-threads/:id","auth":true,"permission":"email:read","safe":true,"description":"Get a specific email thread by ID"},{"method":"GET","path":"/email-threads/:id/messages","auth":true,"permission":"email:read","safe":true,"description":"Get messages within an email thread"}]},"knowledge":{"description":"Knowledge base management for RAG (Retrieval-Augmented Generation). Crawl websites, query the knowledge base with semantic search, and manage knowledge chunks.","endpoints":[{"method":"POST","path":"/knowledge/crawl","auth":true,"permission":"agents:write","description":"Crawl a website URL and index content into the knowledge base. Optionally link to an agent for RAG."},{"method":"POST","path":"/knowledge/query","auth":true,"permission":"agents:read","safe":true,"description":"Semantic search against the knowledge base. Returns ranked chunks with similarity scores."},{"method":"GET","path":"/knowledge/chunks","auth":true,"permission":"agents:read","safe":true,"description":"List knowledge chunks with pagination. Optionally filter by agent or crawl ID."}]},"feedback":{"description":"Submit and track bug reports, feature requests, and general feedback","endpoints":[{"method":"POST","path":"/feedback","auth":true,"permission":"feedback:write","description":"Submit feedback"},{"method":"GET","path":"/feedback","auth":true,"permission":"feedback:read","safe":true,"description":"List submitted feedback"},{"method":"GET","path":"/feedback/:id","auth":true,"permission":"feedback:read","safe":true,"description":"Get feedback by ID"},{"method":"PATCH","path":"/feedback/:id","auth":true,"permission":"feedback:write","description":"Respond to feedback"}]},"providers":{"description":"Discover available LLM, TTS, and STT providers, voices, and models","endpoints":[{"method":"GET","path":"/providers","auth":true,"permission":"providers:read","safe":true,"description":"List all providers grouped by type (llm, tts, stt)"},{"method":"GET","path":"/providers/:providerId/voices","auth":true,"permission":"providers:read","safe":true,"description":"List available voices for a TTS provider"},{"method":"GET","path":"/providers/:providerId/models","auth":true,"permission":"providers:read","safe":true,"description":"List available models for a provider (LLM or STT)"},{"method":"GET","path":"/providers/:providerId/stt-models","auth":true,"permission":"providers:read","safe":true,"description":"List STT models for a provider"}]},"webhooks":{"description":"Subscribe to real-time event notifications via HTTPS webhooks. Supported events: call.started, call.completed, call.failed, transcript.ready, workflow.triggered, workflow.completed, agent.updated, a2p.brand.status_changed, a2p.campaign.status_changed.","endpoints":[{"method":"POST","path":"/webhooks","auth":true,"permission":"webhooks:write","description":"Create webhook subscription for real-time events (call.started, call.completed, call.failed, transcript.ready, workflow.triggered, workflow.completed, agent.updated, a2p.brand.status_changed, a2p.campaign.status_changed)"},{"method":"GET","path":"/webhooks","auth":true,"permission":"webhooks:read","safe":true,"description":"List all webhook subscriptions"},{"method":"GET","path":"/webhooks/:id","auth":true,"permission":"webhooks:read","safe":true,"description":"Get webhook subscription details"},{"method":"GET","path":"/webhooks/:id/deliveries","auth":true,"permission":"webhooks:read","safe":true,"description":"List webhook delivery attempts with status, timing, and error details"},{"method":"PATCH","path":"/webhooks/:id","auth":true,"permission":"webhooks:write","description":"Update webhook subscription (URL, events, enabled status, description)"},{"method":"DELETE","path":"/webhooks/:id","auth":true,"permission":"webhooks:write","description":"Delete webhook subscription"},{"method":"POST","path":"/webhooks/:id/test","auth":true,"permission":"webhooks:write","description":"Send test webhook delivery with sample payload"},{"method":"PATCH","path":"/webhooks/:id","auth":true,"permission":"webhooks:write","description":"Update webhook subscription (url, events, secret, description, enabled)"},{"method":"POST","path":"/webhooks/:id/replay","auth":true,"permission":"webhooks:write","description":"Replay failed deliveries by ID or time window for exactly-once recovery"}]},"tools":{"description":"Define custom webhook-based tools that agents can call during live voice conversations. Unlike webhooks (post-event notifications), tools are invoked in real-time by the agent during a call. Workflow: 1) POST /tools to create, 2) PATCH /agents/:id with enabledTools array to attach, 3) agent invokes tools automatically during calls. Works on both browser and phone calls. Supports HMAC signature verification, custom headers, and configurable timeouts.","endpoints":[{"method":"POST","path":"/tools","auth":true,"permission":"tools:write","description":"Create a custom webhook tool. The tool becomes available to agents via enabledTools."},{"method":"GET","path":"/tools","auth":true,"permission":"tools:read","safe":true,"description":"List all custom tools for the organization"},{"method":"GET","path":"/tools/:id","auth":true,"permission":"tools:read","safe":true,"description":"Get tool details by ID"},{"method":"PATCH","path":"/tools/:id","auth":true,"permission":"tools:write","description":"Update tool configuration (URL, parameters, secret, headers, timeout). Tool name cannot be changed."},{"method":"DELETE","path":"/tools/:id","auth":true,"permission":"tools:write","description":"Delete a custom tool. Returns warnings if agents still reference it."},{"method":"POST","path":"/tools/:id/test","auth":true,"permission":"tools:write","description":"Test tool by sending a sample request to the webhook URL"}]},"compliance":{"description":"A2P 10DLC registration for SMS compliance. US carriers require brand and campaign registration before sending SMS. Flow: 1) POST /compliance/a2p/brands to register your business, 2) Poll status until approved (1-7 business days), 3) POST /compliance/a2p/campaigns to register use case, 4) Link phone numbers to approved campaign. Subscribe to a2p.brand.status_changed and a2p.campaign.status_changed webhook events for automatic status updates.","endpoints":[{"method":"GET","path":"/compliance/a2p/status","auth":true,"permission":"compliance:read","safe":true,"description":"Get overall A2P compliance status with actionable blockingReasons[] and nextAction guidance"},{"method":"GET","path":"/compliance/a2p/config","auth":true,"permission":"compliance:read","safe":true,"description":"Get available industry verticals, use cases, and brand types for registration"},{"method":"POST","path":"/compliance/a2p/brands/validate","auth":true,"permission":"compliance:read","description":"Dry-run validation for brand registration. Returns field-level errors and suggestions without submitting to Twilio/TCR"},{"method":"POST","path":"/compliance/a2p/brands","auth":true,"permission":"compliance:write","description":"Submit brand registration (sole_proprietor or standard). Returns Application ID (BRN-xxx) immediately"},{"method":"GET","path":"/compliance/a2p/brands/:id","auth":true,"permission":"compliance:read","safe":true,"description":"Get brand registration details by Application ID (BRN-xxx)"},{"method":"POST","path":"/compliance/a2p/brands/:id/refresh","auth":true,"permission":"compliance:write","description":"Poll Twilio for latest brand registration status"},{"method":"POST","path":"/compliance/a2p/campaigns/validate","auth":true,"permission":"compliance:read","description":"Dry-run validation for campaign registration. Checks schema, brand approval status, and message samples"},{"method":"POST","path":"/compliance/a2p/campaigns","auth":true,"permission":"compliance:write","description":"Submit A2P campaign (requires approved brand). Returns campaign ID (CMP-xxx)"},{"method":"POST","path":"/compliance/a2p/campaigns/:id/refresh","auth":true,"permission":"compliance:write","description":"Poll Twilio for latest campaign status"},{"method":"POST","path":"/compliance/a2p/campaigns/:id/phone-numbers","auth":true,"permission":"compliance:write","description":"Link a phone number to an approved campaign for A2P-compliant SMS sending"}]}}},"error":null,"meta":{"requestId":"4d45cf10-c6bf-47a9-9d73-5cf5b2884327","traceId":"4d45cf10-c6bf-47a9-9d73-5cf5b2884327","timestamp":"2026-05-20T04:13:21.827Z"}}