Twilio Message Failure Cohort Audit
Pricing
$50.00 / 1,000 delivered twilio failure cohorts
Twilio Message Failure Cohort Audit
Batch Twilio Message records into service-day failure cohorts. Returns messagingServiceSid, creationDayUtc, failedCount, undeliveredCount, totalOutboundObserved, observedFailureSharePct, and errorCodeCounts. $0.05 per delivered cohort with at least one outbound failure.
Pricing
$50.00 / 1,000 delivered twilio failure cohorts
Rating
0.0
(0)
Developer
Nathaniel Standridge
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Features
Share
Batch reduced Twilio Message records to get messagingServiceSid, creationDayUtc, failedCount, undeliveredCount, totalOutboundObserved, observedFailureSharePct, and errorCodeCounts. Each service-day with a supplied outbound failure costs $0.05 when delivered. Use these rows to assign incidents and track recurring failure cohorts.
Twilio Messaging Insights already offers dashboards, delivery/error filtering, and alerts. Use it when the native view meets your needs. This Actor's narrow benefit is a consistent cross-service dataset row for each affected day that can be imported into a spreadsheet or incident workflow without putting a Twilio token into the Actor.
Prepare the input
Get authorized pages of the Twilio Message list API, following next_page_uri when needed. Before pasting, project each Message to only sid, messaging_service_sid, direction, date_created, status, and optional error_code (integer or null). The exact API JSON names are snake_case. Pass reduced rows directly in the messages array. Existing workflows can still send serialized JSON in messagesJson. Use one input mode per run. Remove phone numbers, body text, sender/recipient, account SID, token, names, and other fields before pasting. The Actor accepts at most 2,000 rows and 512,000 UTF-8 bytes. Example:
[{"sid": "SM00000000000000000000000000000001","messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","direction": "outbound-api","date_created": "Tue, 03 Nov 2026 12:00:00 +0000","status": "failed","error_code": 30007}]
Set periodStart and periodEnd to UTC midnights for a half-open creation window of at most 31 days. Every pasted row must have date_created inside it; reject or resolve source records that lack it before running this audit. Set exportedAt to the declared time the status snapshot was obtained, at or after the window's end. The Actor cannot verify that every API page or account message was supplied, nor that statuses are still current. Twilio's list endpoint sorts and filters on date_sent; this audit groups by date_created so unsent rows with a null date_sent can be included. Filter the reduced records by date_created yourself.
The examples/input.json has two affected service-days, one unaffected service-day, one inbound row, and one identical pagination duplicate. See the examples/output.json and examples/summary.json.
Interpret the counts
Each paid row's totalOutboundObserved is the distinct supplied outbound rows for its service and UTC creation day. failedCount and undeliveredCount are kept separate. deliveredCount is confirmed delivered; readCount is a separate recipient-read status. sentUnconfirmedCount is upstream carrier acceptance, not confirmed delivery. pendingCount covers accepted, scheduled, queued, and sending. Canceled and deprecated partial-delivery status have separate counts. observedFailureSharePct uses only the supplied distinct outbound rows as its denominator; it is not an account-wide delivery rate. The top ten observed error-code counts are labels only, with remaining codes and missing codes counted separately. Twilio warns that error-code values can change and should not drive programmatic decisions.
Identical Message SIDs are collapsed before grouping. A SID with conflicting fields is rejected, without any paid delivery. Inbound messages are excluded and counted in the free summary. OUTPUT also reports source rows, unique rows, affected/unaffected cohorts, source limits, and planned/delivered counts. maxCohorts defaults to 25 (maximum 50); if more affected service-days qualify, the input is rejected before billing rather than silently truncated.
Pricing and delivery
The proposed pay-per-event price is $0.05 per delivered affected service-day row. An empty or invalid input, a service-day without a failure, and a delivery blocked before a dataset write have no dataset-item charge. OUTPUT is free. If the run charge cap cannot cover every planned row, the dataset stays empty and OUTPUT reports incomplete with charge_limit. A frozen source-derived plan and checkpoint guard same-run restarts against duplicate dataset writes and native charges. Actual platform cost, contribution, and independent buyer demand remain unmeasured until private cloud qualification and a complete usage window.
Local validation
uv sync --frozen --all-groupsuv run --frozen python -B tools/generate_release_fixtures.pyuv run --frozen python -B tools/local_smoke.pyuv run --frozen pytest -qdocker build -t twilio-message-failure-cohort-audit .
Cloud exports can be checked with tools/validate_cloud.py <directory> <cloud-cases.json> <case-name>. The coordinator's resurrection export is compared with a sibling full export from the same run ID. A successful run status alone is insufficient for billing or output qualification.
Connect a workflow
Connect an MCP client to https://mcp.apify.com/?actors=natstandridge/twilio-message-failure-cohort-audit. Pass the UTC period, snapshot timestamp, and an array of reduced messages in one call.
In n8n’s HTTP Request node, select POST, attach your Apify Bearer credential, and choose a JSON body. Use this URL and body, replacing the synthetic values with your projection. The response is the dataset row array.
https://api.apify.com/v2/actors/natstandridge~twilio-message-failure-cohort-audit/run-sync-get-dataset-items
{"periodStart":"2026-11-03T00:00:00Z","periodEnd":"2026-11-04T00:00:00Z","exportedAt":"2026-11-05T00:00:00Z","messages":[{"sid":"SM00000000000000000000000000000001","messaging_service_sid":null,"direction":"outbound-api","date_created":"Tue, 03 Nov 2026 12:00:00 +0000","status":"failed","error_code":30007}]}
In Make, use Apify → Run an Actor with that JSON, wait for completion, and pass the run’s defaultDatasetId to Get Dataset Items.