Notify APIBeta
Send notifications over SMS, push, messaging apps, and more with a user-centric API.
Create a binding
A binding ties a notification address to a user. For example, User123’s Android phone push registration or Sue’s mobile phone number.
View docs- Curl
- Ruby
- Python
- Java
curl -XPOST https://notifications.twilio.com/v1/Services/ISxxx/Bindings \ -d "Identity=User123" \ -d "BindingType=gcm" \ -d "Address=xxx" \ -u '{twilio account sid}:{twilio auth token}'require 'twilio-ruby' # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Twilio::REST::Client.new(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Create a binding binding = service.bindings.create( identity: 'User123', binding_type: 'apn', address: 'FE66489F304DC75B8D6E9200DFF8A456E8DAEACEC428B427E9518741C92C6660')from twilio.rest import Client # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Client(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Create the binding binding = service.bindings.create( identity='User123', binding_type='apn', address='FE66489F304DC75B8D6E9200DFF8A456E8DAEACEC428B427E9518741C92C6660')import com.twilio.sdk.Twilio; import com.twilio.sdk.creator.notifications.v1.service.BindingCreator; public class CreateBinding { // Twilio credentials and service SID public static final String ACCOUNT_SID = "AC421124bfab3052ad108f3e8c7a119cfb"; public static final String AUTH_TOKEN = "AUTH_TOKEN"; public static final String NOTIFY_SERVICE_SID = "IS13c4cce46710eb656ffffdef2c82c589"; public static void main(String[] args) { Twilio.init(ACCOUNT_SID, AUTH_TOKEN); // Create the binding BindingCreator notification = new BindingCreator( NOTIFY_SERVICE_SID, "User123", Binding.BindingType.APN, "FE66489F304DC75B8D6E9200DFF8A456E8DAEACEC428B427E9518741C92C6660"); System.out.println(notification.execute()); } }Send a transactional notification
Just select whom to send to and what to say and we translate that to all supported channels.
View docs- Curl
- Ruby
- Python
- Java
curl -X POST https://notifications.twilio.com/v1/Services/ISxxx/Notifications \ -d 'Identity=User123' \ -d 'Body=Hello World delivered via SMS, APNS, FCM and Facebook Messenger' \ -u '{twilio account sid}:{twilio auth token}'require 'twilio-ruby' # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Twilio::REST::Client.new(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Send a notification notification = service.notifications.create( identity: 'User123', body: 'Hello there!')from twilio.rest import Client # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Client(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Send the notification notification = service.notifications.create( identity='User123', body='Hello there!')import com.twilio.sdk.creator.notifications.v1.service.NotificationCreator; import com.twilio.sdk.Twilio; public class SendNotification { // Twilio credentials and service SID public static final String ACCOUNT_SID = "AC421124bfab3052ad108f3e8c7a119cfb"; public static final String AUTH_TOKEN = "AUTH_TOKEN"; public static final String NOTIFY_SERVICE_SID = "IS13c4cce46710eb656ffffdef2c82c589"; public static void main(String[] args) { Twilio.init(ACCOUNT_SID, AUTH_TOKEN); // Send the notification NotificationCreator notification = new NotificationCreator(NOTIFY_SERVICE_SID); notification.setIdentity("User123"); notification.setBody("Hello there!"); System.out.println(notification.execute()); } }Send a bulk notification
You can also provide a list of Identities or use Tags and Segments to notify many users with a single request.
API to provide Addresses (e.g. phone numbers, device tokens, etc.) directly in the send request is coming soon.
View docs- Curl
- Ruby
- Python
- Java
curl -X POST https://notifications.twilio.com/v1/Services/ISxxx/Notifications \ -d 'Segment=premium' \ -d 'Tag=preferred device' \ -d 'Body=Hello World delivered via SMS, APNS, FCM and Facebook Messenger' \ -u '{twilio account sid}:{twilio auth token}'require 'twilio-ruby' # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Twilio::REST::Client.new(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Send a notification notification = service.notifications.create( identity: 'User123', body: 'Hello there!')from twilio.rest import Client # Twilio credentials and service SID account_sid = 'AC421124bfab3052ad108f3e8c7a119cfb' auth_token = 'AUTH_TOKEN' notify_service_sid = 'IS13c4cce46710eb656ffffdef2c82c589' # Initialize the client client = Client(account_sid, auth_token) service = client.notifications.v1.services(notify_service_sid) # Send the notification notification = service.notifications.create( segment='premium', tag='preferred device', body='Hello there!')import com.twilio.sdk.creator.notifications.v1.service.NotificationCreator; import com.twilio.sdk.Twilio; public class SendNotification { // Twilio credentials and service SID public static final String ACCOUNT_SID = "AC421124bfab3052ad108f3e8c7a119cfb"; public static final String AUTH_TOKEN = "AUTH_TOKEN"; public static final String NOTIFY_SERVICE_SID = "IS13c4cce46710eb656ffffdef2c82c589"; public static void main(String[] args) { Twilio.init(ACCOUNT_SID, AUTH_TOKEN); // Send the notification NotificationCreator notification = new NotificationCreator(NOTIFY_SERVICE_SID); notification.setIdentity("Alice"); notification.setBody("Hello there!"); System.out.println(notification.execute()); } }
Register for push notifications
Simplify push registration and token management with Twilio Notify SDKs.
- Objective-C
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { [self.notifyClient registerWithToken:deviceToken]; }Select preferred channel
Easily add and remove tags from contacts
- Objective-C
[self.notifyClient.bindings fetch:bindingSid addTag:@"preferred"];Delivery receipt
Capture events when push notifications are delivered. Programmatically adjust logic based on delivery success.
- Objective-C
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { [self.notifyClient delivered:userInfo] if (completionHandler) { completionHandler(); } }Acknowledgement
Capture events when a user reads or acknowledges a push notification. Use this information to create fallback and retry scenarios until a user reads or acknowledges the notification.
- Objective-C
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)(void))completionHandler { if ([identifier isEqualToString: @"acknowledge"]){ [self.notifyClient acknowledged:userInfo] } if (completionHandler) { completionHandler(); } }
Communicate reliably
Experience a 99.95% uptime SLA made possible with automated failover and zero-maintenance windows.
Operate at scale
Extend the same app you write once to new markets with configurable features for localization and compliance.
Many channels
Use the same platform you know for voice, SMS, video, chat, two-factor authentication, and more.
No shenanigans
Get to market faster with pay-as-you-go pricing, free support, and the freedom to scale up or down without contracts.