Integrations / Twilio
Twilio
Twilio REST API (read-only): list and fetch SMS/MMS messages and calls, list your phone numbers, fetch the account and read usage records. Sending SMS is not included because Twilio's Messages API only accepts form-encoded requests.
8 actions
API key
8 read0 write
Calls api.twilio.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "twilio" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get accountreadtwilio.get_accountFetch the account: friendly name, status (active, suspended, closed) and type (Trial or Full).
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
await setu.execute({
userId: "user_1",
action: "twilio.get_account",
input: {
"account_sid": "<account_sid>"
},
});Get callreadtwilio.get_callFetch one voice call by its SID (CA...) including status, duration and price.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
call_sid | string | Required | Call SID, starts with CA |
await setu.execute({
userId: "user_1",
action: "twilio.get_call",
input: {
"account_sid": "<account_sid>",
"call_sid": "<call_sid>"
},
});Get messagereadtwilio.get_messageFetch one SMS/MMS message by its SID (SM...) including status, price and any error code.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
message_sid | string | Required | Message SID, starts with SM or MM |
await setu.execute({
userId: "user_1",
action: "twilio.get_message",
input: {
"account_sid": "<account_sid>",
"message_sid": "<message_sid>"
},
});Get phone numberreadtwilio.get_phone_numberFetch one owned phone number by its SID (PN...).
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
phone_number_sid | string | Required | Incoming phone number SID, starts with PN |
await setu.execute({
userId: "user_1",
action: "twilio.get_phone_number",
input: {
"account_sid": "<account_sid>",
"phone_number_sid": "<phone_number_sid>"
},
});List callsreadtwilio.list_callsList voice calls on the account, newest first, optionally filtered by number or status.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
to | string | Optional | Only calls to this number |
from | string | Optional | Only calls from this number |
status | string | Optional | Only calls with this status |
page_size | integer | Optional | Records per page, up to 1000 (default 50) |
await setu.execute({
userId: "user_1",
action: "twilio.list_calls",
input: {
"account_sid": "<account_sid>"
},
});List messagesreadtwilio.list_messagesList SMS/MMS messages on the account, newest first, optionally filtered by recipient, sender or the day sent.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
to | string | Optional | Only messages to this number (E.164) |
from | string | Optional | Only messages from this number (E.164) |
date_sent | string | Optional | Only messages sent on this GMT date, YYYY-MM-DD |
date_sent_before | string | Optional | Only messages sent on or before this GMT date, YYYY-MM-DD |
date_sent_after | string | Optional | Only messages sent on or after this GMT date, YYYY-MM-DD |
page_size | integer | Optional | Records per page, up to 1000 (default 50) |
await setu.execute({
userId: "user_1",
action: "twilio.list_messages",
input: {
"account_sid": "<account_sid>"
},
});List phone numbersreadtwilio.list_phone_numbersList the phone numbers owned by the account with their capabilities and webhook URLs.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
friendly_name | string | Optional | Filter by friendly name |
phone_number | string | Optional | Filter by number; partial numbers allowed |
page_size | integer | Optional | Records per page, up to 1000 (default 50) |
await setu.execute({
userId: "user_1",
action: "twilio.list_phone_numbers",
input: {
"account_sid": "<account_sid>"
},
});List usage recordsreadtwilio.list_usage_recordsRead what the account used and spent per category (sms, calls, ...) over a date range.
| Input | Type | Description | |
|---|---|---|---|
account_sid | string | Required | Twilio Account SID (starts with AC); the account the credentials belong to |
category | string | Optional | Usage category, e.g. sms, calls, totalprice |
start_date | string | Optional | On or after this GMT date, YYYY-MM-DD, or an offset like -30days |
end_date | string | Optional | On or before this GMT date, YYYY-MM-DD |
include_subaccounts | boolean | Optional | Include subaccounts (default true) |
page_size | integer | Optional | Records per page, up to 1000 (default 50) |
await setu.execute({
userId: "user_1",
action: "twilio.list_usage_records",
input: {
"account_sid": "<account_sid>"
},
});