Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Twilio connector

Basic AuthCommunicationAutomation

Connect to Twilio to send SMS/MMS messages, make voice calls, verify phone numbers with OTP, manage phone numbers, and access usage records.

Twilio connector

  1. Terminal window
    npm install @scalekit-sdk/node

    Full SDK reference: Node.js | Python

  2. Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Register your Twilio credentials with Scalekit so it can authenticate requests on your behalf. You do this once per environment.

    Dashboard setup steps

    Connect Twilio to Scalekit using your Account SID and Auth Token. Scalekit stores these credentials securely and injects them into every tool call — your agent code never handles them directly.

    1. Get your Account SID and Auth Token

      • Log in to the Twilio Console.
      • On the Account Dashboard, scroll down to the Account Info section.
      • Copy your Account SID (starts with AC).
      • Click Show next to Auth Token to reveal it, then copy it.

      Twilio Account Dashboard showing Account SID and Auth Token

    2. Create a connection in Scalekit

      • In the Scalekit dashboard, go to AgentKitConnectionsCreate Connection.
      • Search for Twilio and click Create.
      • Enter your Account SID in the Account SID field.
      • Enter your Auth Token in the Auth Token field.
      • Click Save and note the Connection name — use this as connection_name in your code.

Connect this agent connector to let your agent:

  • List verify services, usage records, recordings — List all Twilio Verify services on the account
  • Get verify service, verification, recording — Retrieve details of a specific Twilio Verify service by its SID
  • Delete verify service, recording, message — Delete a Twilio Verify service by its SID
  • Create verify service — Create a new Twilio Verify service for sending verification codes via SMS, call, email, or WhatsApp
  • Today usage records — Retrieve today’s usage records for a Twilio account, optionally filtered by category
  • Free available numbers toll — Search for available toll-free phone numbers that can be purchased in a given country

Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.

twilio_account_get#Retrieve details of a Twilio account by its SID.0 params

Retrieve details of a Twilio account by its SID.

twilio_available_numbers_local#Search for available local phone numbers that can be purchased in a given country.5 params

Search for available local phone numbers that can be purchased in a given country.

NameTypeRequiredDescription
country_codestringrequiredThe ISO 3166-1 alpha-2 country code to search for numbers in.
area_codestringoptionalFilter by area code.
containsstringoptionalA pattern to match phone numbers against. Use * for wildcards.
sms_enabledstringoptionalFilter for numbers that are SMS-capable.
voice_enabledstringoptionalFilter for numbers that are voice-capable.
twilio_available_numbers_toll_free#Search for available toll-free phone numbers that can be purchased in a given country.3 params

Search for available toll-free phone numbers that can be purchased in a given country.

NameTypeRequiredDescription
country_codestringrequiredThe ISO 3166-1 alpha-2 country code to search for numbers in.
area_codestringoptionalFilter by area code.
containsstringoptionalA pattern to match phone numbers against. Use * for wildcards.
twilio_call_delete#Delete a call record from the account. This permanently removes the call log entry.1 param

Delete a call record from the account. This permanently removes the call log entry.

NameTypeRequiredDescription
call_sidstringrequiredThe unique identifier of the Call resource to delete.
twilio_call_get#Retrieve details of a specific phone call by its SID, including status, duration, and pricing information.1 param

Retrieve details of a specific phone call by its SID, including status, duration, and pricing information.

NameTypeRequiredDescription
call_sidstringrequiredThe unique identifier of the Call resource to retrieve.
twilio_calls_list#Retrieve a list of phone calls made to and from the account, with optional filtering by number, status, and date.6 params

Retrieve a list of phone calls made to and from the account, with optional filtering by number, status, and date.

NameTypeRequiredDescription
end_timestringoptionalFilter by calls started on or before this date (YYYY-MM-DD format).
from_numberstringoptionalFilter by the phone number that initiated the call.
page_sizeintegeroptionalThe number of results to return per page. Maximum is 1000.
start_timestringoptionalFilter by calls started on or after this date (YYYY-MM-DD format).
statusstringoptionalFilter by call status. Values: queued, ringing, in-progress, completed, busy, failed, no-answer, canceled.
tostringoptionalFilter by the phone number that received the call.
twilio_conference_get#Retrieve details of a specific conference by its SID, including status, friendly name, and region.1 param

Retrieve details of a specific conference by its SID, including status, friendly name, and region.

NameTypeRequiredDescription
conference_sidstringrequiredThe unique identifier of the Conference resource to retrieve.
twilio_conferences_list#Retrieve a list of conferences for the account, with optional filtering by name, status, date, and pagination.4 params

Retrieve a list of conferences for the account, with optional filtering by name, status, date, and pagination.

NameTypeRequiredDescription
date_createdstringoptionalFilter conferences created on this date (YYYY-MM-DD format).
friendly_namestringoptionalFilter conferences by their friendly name.
page_sizeintegeroptionalThe number of results to return per page. Maximum is 1000.
statusstringoptionalFilter by conference status. Values: init, in-progress, completed.
twilio_conversation_delete#Delete a Twilio Conversation by its SID. This permanently removes the conversation and all associated data.1 param

Delete a Twilio Conversation by its SID. This permanently removes the conversation and all associated data.

NameTypeRequiredDescription
conversation_sidstringrequiredThe unique SID of the conversation to delete.
twilio_conversation_get#Retrieve the details of a specific Twilio Conversation by its SID.1 param

Retrieve the details of a specific Twilio Conversation by its SID.

NameTypeRequiredDescription
conversation_sidstringrequiredThe unique SID of the conversation to retrieve.
twilio_conversation_message_delete#Delete a specific message from a Twilio Conversation by its SID.2 params

Delete a specific message from a Twilio Conversation by its SID.

NameTypeRequiredDescription
conversation_sidstringrequiredThe unique SID of the conversation containing the message.
message_sidstringrequiredThe unique SID of the message to delete.
twilio_conversation_messages_list#List all messages in a Twilio Conversation. Optionally control the sort order and page size.3 params

List all messages in a Twilio Conversation. Optionally control the sort order and page size.

NameTypeRequiredDescription
conversation_sidstringrequiredThe unique SID of the conversation to list messages for.
orderstringoptionalThe sort order of messages. One of: asc, desc.
page_sizeintegeroptionalThe number of messages to return per page.
twilio_conversation_participants_list#List all participants in a Twilio Conversation.2 params

List all participants in a Twilio Conversation.

NameTypeRequiredDescription
conversation_sidstringrequiredThe unique SID of the conversation to list participants for.
page_sizeintegeroptionalThe number of participants to return per page.
twilio_conversations_list#List all Twilio Conversations. Optionally filter by state and control page size.2 params

List all Twilio Conversations. Optionally filter by state and control page size.

NameTypeRequiredDescription
page_sizeintegeroptionalThe number of conversations to return per page.
statestringoptionalFilter conversations by state. One of: active, inactive, closed.
twilio_message_delete#Permanently delete a message resource from your Twilio account. This action cannot be undone.1 param

Permanently delete a message resource from your Twilio account. This action cannot be undone.

NameTypeRequiredDescription
message_sidstringrequiredThe unique identifier of the message to delete
twilio_message_get#Retrieve the details of a specific message by its SID.1 param

Retrieve the details of a specific message by its SID.

NameTypeRequiredDescription
message_sidstringrequiredThe unique identifier of the message to retrieve
twilio_message_media_list#Retrieve a list of media resources associated with a specific message.2 params

Retrieve a list of media resources associated with a specific message.

NameTypeRequiredDescription
message_sidstringrequiredThe SID of the message to list media for
page_sizeintegeroptionalNumber of media resources to return per page (1-1000, default 50)
twilio_messages_list#Retrieve a list of messages associated with your Twilio account, with optional filtering by recipient, sender, or date sent.4 params

Retrieve a list of messages associated with your Twilio account, with optional filtering by recipient, sender, or date sent.

NameTypeRequiredDescription
date_sentstringoptionalFilter by date sent (YYYY-MM-DD format)
from_numberstringoptionalFilter by messages sent from this phone number in E.164 format
page_sizeintegeroptionalNumber of messages to return per page (1-1000, default 50)
tostringoptionalFilter by messages sent to this phone number in E.164 format
twilio_messaging_services_list#Retrieve a list of all Messaging Services associated with your Twilio account.1 param

Retrieve a list of all Messaging Services associated with your Twilio account.

NameTypeRequiredDescription
page_sizeintegeroptionalNumber of Messaging Services to return per page (1-1000, default 50)
twilio_phone_number_get#Retrieve details of a specific incoming phone number by its SID.1 param

Retrieve details of a specific incoming phone number by its SID.

NameTypeRequiredDescription
phone_number_sidstringrequiredThe SID of the incoming phone number to retrieve.
twilio_phone_numbers_list#List all incoming phone numbers on the Twilio account.3 params

List all incoming phone numbers on the Twilio account.

NameTypeRequiredDescription
friendly_namestringoptionalFilter by friendly name of the phone number.
page_sizeintegeroptionalNumber of results to return per page.
phone_numberstringoptionalFilter by phone number in E.164 format.
twilio_recording_delete#Permanently delete a call recording from the account. This action cannot be undone.1 param

Permanently delete a call recording from the account. This action cannot be undone.

NameTypeRequiredDescription
recording_sidstringrequiredThe unique identifier of the Recording resource to delete.
twilio_recording_get#Retrieve details of a specific call recording by its SID, including duration, status, and source.1 param

Retrieve details of a specific call recording by its SID, including duration, status, and source.

NameTypeRequiredDescription
recording_sidstringrequiredThe unique identifier of the Recording resource to retrieve.
twilio_recordings_list#Retrieve a list of call recordings for the account, with optional filtering by call SID, date, and pagination.3 params

Retrieve a list of call recordings for the account, with optional filtering by call SID, date, and pagination.

NameTypeRequiredDescription
call_sidstringoptionalFilter recordings by the Call SID they are associated with.
date_createdstringoptionalFilter recordings created on this date (YYYY-MM-DD format).
page_sizeintegeroptionalThe number of results to return per page. Maximum is 1000.
twilio_usage_records_list#Retrieve usage records for a Twilio account, optionally filtered by category and date range.4 params

Retrieve usage records for a Twilio account, optionally filtered by category and date range.

NameTypeRequiredDescription
categorystringoptionalThe usage category to filter by (e.g., sms, calls, phonenumbers).
end_datestringoptionalThe end date for the usage records in YYYY-MM-DD format.
page_sizeintegeroptionalNumber of results to return per page.
start_datestringoptionalThe start date for the usage records in YYYY-MM-DD format.
twilio_usage_records_today#Retrieve today's usage records for a Twilio account, optionally filtered by category.1 param

Retrieve today's usage records for a Twilio account, optionally filtered by category.

NameTypeRequiredDescription
categorystringoptionalThe usage category to filter by (e.g., sms, calls, phonenumbers).
twilio_verification_get#Retrieve the status and details of a specific verification by its SID.2 params

Retrieve the status and details of a specific verification by its SID.

NameTypeRequiredDescription
service_sidstringrequiredThe SID of the Verify service.
verification_sidstringrequiredThe SID of the verification to retrieve.
twilio_verify_service_create#Create a new Twilio Verify service for sending verification codes via SMS, call, email, or WhatsApp.5 params

Create a new Twilio Verify service for sending verification codes via SMS, call, email, or WhatsApp.

NameTypeRequiredDescription
friendly_namestringrequiredA descriptive name for the Verify service.
code_lengthintegeroptionalThe length of the verification code to generate. Must be between 4 and 10.
lookup_enabledstringoptionalWhether to perform a lookup on the phone number before sending verification.
psd2_enabledstringoptionalWhether to enable PSD2 compliance for the service.
skip_sms_to_landlinesstringoptionalWhether to skip sending SMS to landline phone numbers.
twilio_verify_service_delete#Delete a Twilio Verify service by its SID. This action is irreversible.1 param

Delete a Twilio Verify service by its SID. This action is irreversible.

NameTypeRequiredDescription
service_sidstringrequiredThe unique SID of the Verify service to delete.
twilio_verify_service_get#Retrieve details of a specific Twilio Verify service by its SID.1 param

Retrieve details of a specific Twilio Verify service by its SID.

NameTypeRequiredDescription
service_sidstringrequiredThe unique SID of the Verify service to retrieve.
twilio_verify_services_list#List all Twilio Verify services on the account.1 param

List all Twilio Verify services on the account.

NameTypeRequiredDescription
page_sizeintegeroptionalNumber of results to return per page. Maximum is 1000.