Rate this page:

Twilio SDK for C# and .NET

The Twilio C# / .NET SDK makes it easy to interact with the Twilio API from your .NET application. The most recent version of the library can be found on NuGet. The Twilio C# SDK supports .NET applications written in C#, VB.Net, and F# that utilize .NET Framework 3.5 or above or any supported version of .NET Core (.NET Standard v1.4).

Install the Library
When your phone number receives an incoming message or phone call, Twilio will send an HTTP request to your .NET application
Twilio servers
Your .NET app tells Twilio how to respond (e.g. with a text message, phone menu, etc.)
Your app

// Incoming message from Twilio!
var messagingResponse =
    new MessagingResponse();
messagingResponse.Message("Hello from C#!");
return TwiML(messagingResponse);
View complete examples
Twilio gets the instructions from your .NET app and takes the appropriate action
Hello from C#!

Get Started

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

Once installed, try one of the code samples to the right or jump into one of the Quickstarts below.

Need to handle Twilio webhooks with ASP.NET MVC or ASP.NET Core? Be sure to also install the corresponding Twilio.AspNet package.

Build your App

You've got an idea in mind. Let's get it to production.

Pick the docs that are right for you. These guides, sample app tutorials, and API reference docs will get you across the deploy line, straight to HTTP 200 OK.

Full .NET SDK Reference

Dig into the Twilio API's and uncover that killer feature you need to make your app awesome.

Common Classes

There are a few common core classes used in the various tutorials and examples. They handle setting up a connection to Twilio, handling errors, and issuing security tokens for client apps.

Common REST API Resource Classes

Each REST API Resource has a corresponding .NET class that you can use to create, fetch, read, update, and delete resources.

Common TwiML Classes

You use TwiML to tell Twilio what to do when you are responding to a Twilio webhook (e.g. a message or a phone call).

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. Please select the reason(s) for your feedback or provide additional information about how we can improve:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more