ProtectedProviderReturns the name of this provider for use in error messages. Override in subclasses to provide a more descriptive name.
Convenience gate: true when this provider supports inbound push in ANY form
(subscription-managed or inbound-parse), false otherwise. Lets callers cleanly
short-circuit — if (provider.SupportsPush) { ... } — instead of probing individual
operations.
Derived from GetSubscriptionCapabilities so it stays in lockstep with actual
capability: providers that support push return capabilities and thereby report
SupportsPush === true for free; providers that don't return undefined and report
false. Subclasses normally do NOT override this — override
GetSubscriptionCapabilities instead.
Archives a message. Override in subclasses that support this operation.
Parameters for archiving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Twilio does not support creating draft messages
Parameters for creating a draft (not used)
Optionalcredentials: TwilioCredentialsOptional credentials (not used for Twilio)
Points a phone number's inbound-SMS webhook (smsUrl) at the consumer's endpoint,
making Twilio deliver inbound SMS notifications there. The number must belong to the
authenticated account.
Fail-fast: CreateSubscriptionParams.NotificationUrl must be https and
CreateSubscriptionParams.Identifier (an E.164 number like +15551234567 or a
phone-number SID like PN...) must be provided.
Identifier (target number/SID) and NotificationUrl (webhook target)
Optionalcredentials: TwilioCredentialsOptional account credentials override for this request
Promise
Deletes a message. Override in subclasses that support this operation.
Parameters for deleting the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Clears a phone number's inbound-SMS webhook, so Twilio stops delivering inbound SMS notifications for it. Idempotent from the consumer's perspective: a not-found (HTTP 404 / Twilio code 20404) is treated as success.
SubscriptionID = the phone-number SID returned by CreateSubscription
Optionalcredentials: TwilioCredentialsOptional account credentials override for this request
Promise
Downloads an attachment from a message. Override in subclasses that support this operation.
Parameters for downloading the attachment
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Forward a message using Twilio Note: Twilio doesn't have a native "forward" concept, so we implement it as a new message that includes the content of the original message
Parameters for forwarding a message
Optionalcredentials: TwilioCredentialsOptional credentials override for this request.
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Gets messages from Twilio
Parameters for fetching messages
Optionalcredentials: TwilioCredentialsOptional credentials override for this request.
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Gets a single message by ID. Override in subclasses that support this operation.
Parameters for retrieving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Returns Twilio's subscription capabilities. Twilio is an INLINE-payload, inbound-parse
provider: webhooks never expire (no renewal), only created notifications are
delivered, no endpoint-validation handshake is performed, management is supported
(pointing/clearing a number's smsUrl), and the full message is delivered inline.
Returns the list of operations supported by the Twilio provider. Twilio is a messaging provider (SMS, WhatsApp, Messenger) and does not support mailbox operations like folders, archiving, or attachments.
Lists attachments on a message. Override in subclasses that support this operation.
Parameters for listing attachments
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Lists folders/mailboxes available in the provider. Override in subclasses that support this operation.
Parameters for listing folders
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Marks message(s) as read or unread. Override in subclasses that support this operation.
Parameters for marking messages
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Moves a message to a different folder. Override in subclasses that support this operation.
Parameters for moving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Parses and verifies an inbound Twilio SMS webhook. Pure: no Twilio client, no network.
Safe on hostile/garbage input — never throws; returns Success: false with a 400
suggested status when the body cannot be parsed at all.
Twilio posts application/x-www-form-urlencoded. The X-Twilio-Signature header is
verified via the SDK's validateRequest(authToken, signature, url, params) using the
account Auth Token (the "Messaging webhook signature" secret). The parsed notification
is ALWAYS returned even when the signature is invalid — the flag is set so the consumer
can decide — but an unparseable body is the 400 case.
INLINE mode: the webhook carries the full message, so NormalizedNotification.Message
is populated and consumers need not re-fetch. MessageSid is also surfaced in
NormalizedNotification.MessageIDs as a still-useful pointer.
Transport-neutral capture of the inbound webhook request
Optionalcredentials: TwilioCredentialsOptional account credentials override (for signature verification)
Promise
Renews an existing subscription before it expires. The caller MUST pass credentials for the same account/app registration used to create the subscription. Override in subclasses that support this operation.
Parameters identifying the subscription and the new expiration
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Reply to a message using Twilio
Parameters for replying to a message
Optionalcredentials: TwilioCredentialsOptional credentials override for this request.
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Searches messages using a query string. Override in subclasses that support this operation.
Parameters for searching messages
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Sends a single message using Twilio
The message to send
Optionalcredentials: TwilioCredentialsOptional credentials override for this request.
If not provided, uses environment variables.
Set credentials.disableEnvironmentFallback = true to require explicit credentials.
Checks if this provider supports a specific operation.
The operation to check
true if the operation is supported
Implementation of the Twilio provider for sending and receiving messages (SMS, WhatsApp, Facebook Messenger)