Twilio
Let an agent text your customers without a phone bill surprise. It reads messages and phone numbers, sends an SMS under a daily ceiling, and redacts or deletes messages, and each send can wait for a person.
- host
- api.twilio.com
- connect
- API key, per user
Send sms
twilio-send-sms
Redact message
twilio-redact-message
Delete message
twilio-delete-message
Rename phone number
twilio-rename-phone-number
Reads and writes in Twilio. Writes are off until you switch them on.
Each one is a named operation from the pack. Reads change nothing.
Writes
Send sms
read backtwilio-send-sms
Send one SMS to one phone number, from one of the account's numbers (from) or through a Messaging Service (messaging_service_sid); give one of the two, or Twilio refuses it. The message is sent to a person and costs money: Twilio bills each segment (160 GSM-7 or 70 UCS-2 characters) at the destination's rate. Counted as one message, not by segment or price; the price is filled in on the message after it is sent.
Redact message
read backtwilio-redact-message
Remove the text of one message and keep its record (to, from, status, price, dates). This cannot be undone.
Delete message
read backtwilio-delete-message
Delete one message record and its body from the account's logs. This cannot be undone.
Rename phone number
read backtwilio-rename-phone-number
Change the friendly name of one of the account's phone numbers, the label shown in the Twilio Console and lists. Nothing else on the number changes.
Reads
List messages
twilio-list-messages
List messages sent and received by the account, 20 a page, optionally filtered to those to or from one number or sent on, before or after a date (UTC). Each message has its sid, to, from, body, status, direction, num_segments, price, error_code and dates. When next_page_uri is not null, pass its Page and PageToken values as page and page_token for the next page. A redacted message has an empty body; a deleted one is not listed.
Get message
twilio-get-message
Get one message: to, from, body, status (queued, sending, sent, delivered, undelivered, failed, received and others), direction, num_segments, num_media, price and price_unit (filled in after sending), error_code, error_message and dates.
List message media
twilio-list-message-media
List the media files (images and other MMS attachments) of one message, 20 a page: each with its sid, content_type, dates and uri. The file itself is not returned. When next_page_uri is not null, pass its Page and PageToken values as page and page_token for the next page.
List phone numbers
twilio-list-phone-numbers
List the phone numbers the account owns, 20 a page, optionally filtered to those matching a number or a friendly name. Each has its sid, phone_number (E.164), friendly_name, capabilities (sms, mms, voice, fax) and the URLs Twilio calls for incoming messages and calls. When next_page_uri is not null, pass its Page and PageToken values as page and page_token for the next page.
Get phone number
twilio-get-phone-number
Get one phone number the account owns: phone_number, friendly_name, capabilities, status, and the URLs and methods Twilio uses for incoming messages and calls.
List calls
twilio-list-calls
List the account's calls, 20 a page, optionally filtered to those to or from one number, with one status, or started before or on or after a date (UTC). Each call has its sid, to, from, status, direction, start_time, end_time, duration (seconds), price and price_unit. When next_page_uri is not null, pass its Page and PageToken values as page and page_token for the next page.
Get call
twilio-get-call
Get one call: to, from, status, direction, start_time, end_time, duration (seconds), price and price_unit (filled in after the call ends), answered_by and parent_call_sid.
How do users connect? Each one brings their own Twilio.
- 1.Call for the userYour server invokes the action for the signed-in user. Without a Twilio connection, the SDK throws EndUserNotConnectedError with a connect link.
- 2.The user pastes a keyThe link opens a form that shows where in Twilio's settings to create the key. The link lasts 10 minutes and works once.
- 3.Anlyon checks itThe key is checked with Twilio before it is kept, and bound to api.twilio.com. It is never shown back.
- 4.Your server confirmsYour server confirms the connection for the user who is signed in, and the call goes through.
Guardrails. Suggested limits and approvals, for you to review.
Suggested limits
- 100 SMS sent a day
- 100 messages redacted a day
- 100 messages deleted a day
- 20 phone numbers renamed a day
Suggested approvals
- A person approves sending an SMS
- A person approves redacting a message
- A person approves deleting a message
What the key must allow
- Your Account SID and Auth Token
- Connect a subaccount limited to the phone numbers your agent should use
Good to know
- A sent SMS cannot be recalled, and Twilio has no idempotency key for a send. Anlyon sends it once and never repeats it.
- API keys (SK...) are not accepted yet: connect with the Auth Token of a subaccount.
For your own account
- 1.In the Twilio Console, open Account, API keys and tokens, and copy the Account SID and Auth Token.
- 2.In Anlyon, open Actions, then Integrations, choose Twilio and paste both.
- 3.Anlyon checks them with Twilio before storing them. They become a secret named TWILIO, bound to api.twilio.com.
Twilio in your code. For one of your users, or for your own account.
Act for one of your users from your server, or connect your company's own Twilio with the CLI.
import { Client, EndUserNotConnectedError } from "@anlyonhq/sdk";const anlyon = new Client({ apiKey: process.env.ANLYON_API_KEY! });try { const { data } = await anlyon .forUser(session.userId) .actions.invoke("twilio-send-sms", { account_sid: "AC0123456789abcdef0123456789abcdef", to: "+15558675310", body: "Your order shipped today." }); return { status: "done", grade: data.grade };} catch (error) { if (error instanceof EndUserNotConnectedError) { // The user connects their own Twilio, then you call again. return { status: "connect_required", url: error.connectUrl }; } throw error;}Other integrations. Under the same limits, approvals and receipts.
Available
Stripe
Payments · API key
Refunds under a money ceiling, and every customer, payment and invoice to read.
Available
GitHub
Code · API key
Issues, pull requests and code, in the repositories you choose.
Available
HubSpot
CRM · Sign in
Contacts, companies and deals: search them and change them.
- Anlyon app
- Available
- Your own app
- Recommended for production
