![]() |
VOOZH | about |
dotnet add package Twilio --version 7.14.9
NuGet\Install-Package Twilio -Version 7.14.9
<PackageReference Include="Twilio" Version="7.14.9" />
<PackageVersion Include="Twilio" Version="7.14.9" />Directory.Packages.props
<PackageReference Include="Twilio" />Project file
paket add Twilio --version 7.14.9
#r "nuget: Twilio, 7.14.9"
#:package Twilio@7.14.9
#addin nuget:?package=Twilio&version=7.14.9Install as a Cake Addin
#tool nuget:?package=Twilio&version=7.14.9Install as a Cake Tool
👁 Test
👁 Quality Gate Status
👁 NuGet
👁 Learn with TwilioQuest
Twilio provides a HTTP-based API for sending and receiving phone calls and text messages. Learn more on twilio.com.
More documentation for this library can be found here.
twilio-csharp uses a modified version of Semantic Versioning for all changes. for details.
See the migration guide . Also, if you were using the Twilio.Mvc package, that has been replaced by the Twilio.AspNet.Mvc package which is compatible with this version of the library.
New accounts and subaccounts are now required to use TLS 1.2 when accessing the REST API. "Upgrade Required" errors indicate that TLS 1.0/1.1 is being used. With .NET, you can enable TLS 1.2 using this setting:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
This library supports .NET applications that utilize .NET6+.
The best and easiest way to add the Twilio libraries to your .NET project is to use the NuGet package manager.
From within Visual Studio, you can use the NuGet GUI to search for and install the Twilio NuGet package. Or, as a shortcut, simply type the following command into the Package Manager Console:
Install-Package Twilio
If you are building with the .NET Core command line tools, then you can run the following command from within your project directory:
dotnet add package Twilio
The examples below show how to have your application initiate and outbound phone call and send an SMS message using the Twilio .NET helper library:
TwilioClient.Init("ACCOUNT_SID", "AUTH_TOKEN");
var call = CallResource.Create(
new PhoneNumber("+11234567890"),
from: new PhoneNumber("+10987654321"),
url: new Uri("https://my.twiml.here")
);
Console.WriteLine(call.Sid);
var message = MessageResource.Create(
new PhoneNumber("+11234567890"),
from: new PhoneNumber("+10987654321"),
body: "Hello World!"
);
Console.WriteLine(message.Sid);
We are introducing Client Credentials Flow-based OAuth 2.0 authentication. This feature is currently in beta and its implementation is subject to change.
API examples here
Organisation API examples here
To take advantage of Twilio's Global Infrastructure, specify the target Region and/or Edge for the client:
TwilioClient.SetRegion("au1");
TwilioClient.SetEdge("sydney");
This will result in the hostname transforming from api.twilio.com to api.sydney.au1.twilio.com. Use appropriate client depending on the type of authentication used
There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called TWILIO_LOG_LEVEL and set it to debug or you can set the LogLevel variable on the client as debug:
TwilioClient.SetLogLevel("debug");
For an example on how to handle exceptions in this helper library, please see the Twilio documentation.
To control phone calls, your application needs to output TwiML.
// TwiML classes can be created as standalone elements
var gather = new Gather(numDigits: 1, action: new Uri("hello-monkey-handle-key.cshtml"), method: HttpMethod.Post)
.Say("To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.");
// Attributes can be set directly on the object
gather.Timeout = 100;
gather.MaxSpeechTime = 200
// Arbitrary attributes can be set by calling set/getOption
var dial = new Dial().SetOption("myAttribute", 200)
.SetOption("newAttribute", false);
// Or can be created and attached to a response directly using helper methods
var response = new VoiceResponse()
.Say("Hello Monkey")
.Play(new Uri("http://demo.twilio.com/hellomonkey/monkey.mp3"))
.Append(gather)
.Append(dial);
// Serialize the TwiML objects to XML string
Console.WriteLine(response);
/*
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Say>Hello Monkey</Say>
<Play>http://demo.twilio.com/hellomonkey/monkey.mp3</Play>
<Gather numDigits="1" action="hello-monkey-handle-key.cshtml" method="POST" timeout="100" maxSpeechTime="200">
<Say>To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.</Say>
</Gather>
<Dial myAttribute="200" newAttribute="false"></Dial>
</Response>
*/
To use a custom HTTP client with this helper library, please see the .
Features marked with the [Beta] attribute are in a beta stage and may undergo changes in future releases. Use these features with caution as they may not be stable.
Features marked with the [Deprecated] attribute are deprecated and are not encouraged to use
Features marked with the [Preview] attribute are in a preview stage and are intended for evaluation purposes. They are subject to change and should not be used in production without thorough testing.
The Dockerfile present in this repository and its respective twilio/twilio-csharp Docker image are used by Twilio for testing purposes.
You could use the docker image for building and running tests:
docker build -t twiliobuild .
Bash:
docker run -it --rm -v $(pwd):/twilio twiliobuild
make test
Powershell:
docker run -it --rm -v ${PWD}:/twilio twiliobuild
make test
If you need help installing or using the library, please check the Twilio Support Help Center first, and file a support ticket if you don't find an answer to your question.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net35 net35 is compatible. net40 net40 was computed. net403 net403 was computed. net45 net45 was computed. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Twilio:
| Package | Downloads |
|---|---|
|
Twilio.AspNet.Core
Twilio helper library for ASP.NET Core |
|
|
iRely.Common
iRely.Common |
|
|
Twilio.AspNet.Mvc
Twilio helper library for ASP.NET MVC on .NET Framework. |
|
|
TinWeb
Provides common features for a Web Application. |
|
|
ImmediaC.SimpleCms
ASP.NET Core based CMS |
Showing the top 20 popular GitHub repositories that depend on Twilio:
| Repository | Stars |
|---|---|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
Ombi-app/Ombi
Want a Movie or TV Show on Plex/Emby/Jellyfin? Use Ombi!
|
|
|
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
|
|
|
phongnguyend/Practical.CleanArchitecture
Full-stack .Net 10 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 21, React 19, Vue 3.5, BFF with YARP, NextJs 16, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, EF Core, OpenTelemetry, SignalR, Background Services, Health Checks, Rate Limiting, Clouds (Azure, AWS, GCP), ...
|
|
|
ariacom/Seal-Report
Database Reporting Tool and Tasks (.Net)
|
|
|
bitfoundation/bitplatform
Build all of your apps using what you already know and love ❤️
|
|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
microsoft/botbuilder-dotnet
Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
|
|
|
azure-ad-b2c/samples
Azure AD B2C custom policy solutions and samples.
|
|
|
HTBox/allReady
This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.
|
|
|
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
|
|
|
streetwriters/notesnook-sync-server
Sync server for Notesnook (self-hosting in alpha)
|
|
|
notifo-io/notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
|
|
|
aelassas/wexflow
Workflow Automation Engine
|
|
|
SparkDevNetwork/Rock
An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
|
|
|
dotnetcore/aspnetcore-doc-cn
The Simplified Chinese edition of Microsoft ASP.NET Core documentation, translated by .NET Core Community and .NET China Community.
|
|
|
JasonBock/Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
|
|
|
Azure/azure-webjobs-sdk-extensions
Azure WebJobs SDK Extensions
|
|
|
BotBuilderCommunity/botbuilder-community-dotnet
Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder .NET SDK, including middleware, dialogs, recognizers and more.
|
|
|
NVentimiglia/Unity3d-Foundation
Unity3d Databinding, MVVM, Tasks, Localization
|
| Version | Downloads | Last Updated |
|---|---|---|
| 7.14.9 | 432,211 | 5/7/2026 |
| 7.14.8 | 43,666 | 5/6/2026 |
| 7.14.7 | 340,793 | 4/14/2026 |
| 7.14.3 | 1,225,443 | 2/5/2026 |
| 7.14.2 | 431,195 | 1/22/2026 |
| 7.14.1 | 251,622 | 1/7/2026 |
| 7.14.0 | 275,488 | 12/17/2025 |
| 7.13.8 | 585,110 | 12/3/2025 |
| 7.13.7 | 184,186 | 11/21/2025 |
| 7.13.6 | 455,707 | 11/11/2025 |
| 7.13.5 | 206,131 | 10/28/2025 |
| 7.13.4 | 391,341 | 10/14/2025 |
| 7.13.3 | 327,190 | 9/30/2025 |
| 7.13.2 | 69,901 | 9/25/2025 |
| 7.13.1 | 239,857 | 9/18/2025 |
| 7.13.0 | 255,278 | 9/4/2025 |
| 7.12.2 | 148,105 | 8/28/2025 |
| 7.12.1 | 169,300 | 8/18/2025 |
| 7.12.0 | 571,815 | 7/24/2025 |
| 7.11.5 | 352,147 | 7/10/2025 |