A Service is the top-level scope of all other resources in Notify REST API.
You can create up to 10 Service resources per account and you can use them to:
If you need more than 10 Service resources for your account, please contact support.
The unique string that we created to identify the Service resource.
^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Service resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the resource was created specified in RFC 2822 format.
The date and time in GMT when the resource was last updated specified in RFC 2822 format.
The SID of the Credential to use for APN Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Credential to use for GCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Credential to use for FCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Messaging Service to use for SMS Bindings. In order to send SMS notifications this parameter has to be set.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
Whether to log notifications. Can be: true
or false
and the default is true
.
The URLs of the Binding, Notification, Segment, and User resources related to the service.
Callback configuration that enables delivery callbacks, default false
POST https://notify.twilio.com/v1/Services
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
The SID of the Credential to use for APN Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Credential to use for GCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Messaging Service to use for SMS Bindings. This parameter must be set in order to send SMS notifications.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The SID of the Credential to use for FCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
Whether to log notifications. Can be: true
or false
and the default is true
.
Callback configuration that enables delivery callbacks, default false
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createService() {11const service = await client.notify.v1.services.create();1213console.log(service.sid);14}1516createService();
1{2"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",5"date_created": "2016-03-09T20:22:31Z",6"date_updated": "2016-03-09T20:22:31Z",7"apn_credential_sid": null,8"gcm_credential_sid": null,9"fcm_credential_sid": null,10"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"facebook_messenger_page_id": "4",12"alexa_skill_id": null,13"default_apn_notification_protocol_version": "3",14"default_gcm_notification_protocol_version": "3",15"default_fcm_notification_protocol_version": "3",16"default_alexa_notification_protocol_version": "3",17"log_enabled": true,18"type": "S",19"delivery_callback_url": "Hello",20"delivery_callback_enabled": true,21"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"links": {23"bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",24"notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications",25"segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments",26"users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users"27}28}
GET https://notify.twilio.com/v1/Services/{Sid}
The Twilio-provided string that uniquely identifies the Service resource to fetch.
^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchService() {11const service = await client.notify.v112.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(service.sid);16}1718fetchService();
1{2"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",5"date_created": "2016-03-09T20:22:31Z",6"date_updated": "2016-03-09T20:22:31Z",7"apn_credential_sid": null,8"gcm_credential_sid": null,9"fcm_credential_sid": null,10"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"facebook_messenger_page_id": "4",12"alexa_skill_id": null,13"default_apn_notification_protocol_version": "3",14"default_gcm_notification_protocol_version": "3",15"default_fcm_notification_protocol_version": "3",16"default_alexa_notification_protocol_version": "3",17"log_enabled": true,18"type": "S",19"delivery_callback_url": "Hello",20"delivery_callback_enabled": true,21"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"links": {23"bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",24"notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications",25"segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments",26"users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users"27}28}
GET https://notify.twilio.com/v1/Services
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listService() {11const services = await client.notify.v1.services.list({ limit: 20 });1213services.forEach((s) => console.log(s.sid));14}1516listService();
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0",8"next_page_url": null,9"key": "services"10},11"services": [12{13"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",16"date_created": "2016-03-09T20:22:31Z",17"date_updated": "2016-03-09T20:22:31Z",18"apn_credential_sid": null,19"gcm_credential_sid": null,20"fcm_credential_sid": null,21"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"facebook_messenger_page_id": "4",23"alexa_skill_id": null,24"default_apn_notification_protocol_version": "3",25"default_gcm_notification_protocol_version": "3",26"default_fcm_notification_protocol_version": "3",27"default_alexa_notification_protocol_version": "3",28"log_enabled": true,29"type": "S",30"delivery_callback_url": "Hello",31"delivery_callback_enabled": true,32"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",33"links": {34"bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",35"notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications",36"segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments",37"users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users"38}39}40]41}
POST https://notify.twilio.com/v1/Services/{Sid}
The Twilio-provided string that uniquely identifies the Service resource to update.
^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
The SID of the Credential to use for APN Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Credential to use for GCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Messaging Service to use for SMS Bindings. This parameter must be set in order to send SMS notifications.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
The SID of the Credential to use for FCM Bindings.
^CR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.
Whether to log notifications. Can be: true
or false
and the default is true
.
Callback configuration that enables delivery callbacks, default false
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateService() {11const service = await client.notify.v112.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ friendlyName: "FriendlyName" });1415console.log(service.sid);16}1718updateService();
1{2"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"friendly_name": "FriendlyName",5"date_created": "2016-03-09T20:22:31Z",6"date_updated": "2016-03-09T20:22:31Z",7"apn_credential_sid": null,8"gcm_credential_sid": null,9"fcm_credential_sid": null,10"default_apn_notification_protocol_version": "3",11"default_gcm_notification_protocol_version": "3",12"default_fcm_notification_protocol_version": "3",13"default_alexa_notification_protocol_version": "3",14"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"alexa_skill_id": null,16"facebook_messenger_page_id": "4",17"log_enabled": true,18"type": "S",19"delivery_callback_url": "Hello",20"delivery_callback_enabled": true,21"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"links": {23"bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",24"notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications",25"segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments",26"users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users"27}28}
DELETE https://notify.twilio.com/v1/Services/{Sid}
The Twilio-provided string that uniquely identifies the Service resource to delete.
^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteService() {11await client.notify.v112.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.remove();14}1516deleteService();