Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Notify Service Resource


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:

  • Create separate operational environments, such as dev , stage , and prod , all using the same Twilio account.
  • Scope access to resources used by the Notify REST API
  • Configure different behaviors of a push-notification or messaging service.

If you need more than 10 Service resources for your account, please contact support(link takes you to an external page).


Service Properties

service-properties page anchor
Property nameTypePIIDescription
sidSID<IS>
Not PII

The unique string that we created to identify the Service resource.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the Service resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

The string that you assigned to describe the resource.


date_createdstring<date-time>

The date and time in GMT when the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in RFC 2822(link takes you to an external page) format.


apn_credential_sidSID<CR>

The SID of the Credential to use for APN Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

gcm_credential_sidSID<CR>

The SID of the Credential to use for GCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

fcm_credential_sidSID<CR>

The SID of the Credential to use for FCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

messaging_service_sidSID<MG>

The SID of the Messaging Service to use for SMS Bindings. In order to send SMS notifications this parameter has to be set.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

facebook_messenger_page_idstring

Deprecated.


default_apn_notification_protocol_versionstring

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


default_gcm_notification_protocol_versionstring

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


default_fcm_notification_protocol_versionstring

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


log_enabledboolean

Whether to log notifications. Can be: true or false and the default is true.


urlstring<uri>

The absolute URL of the Service resource.


linksobject<uri-map>

The URLs of the Binding, Notification, Segment, and User resources related to the service.


alexa_skill_idstring

Deprecated.


default_alexa_notification_protocol_versionstring

Deprecated.


delivery_callback_urlstring

URL to send delivery status callback.


delivery_callback_enabledboolean

Callback configuration that enables delivery callbacks, default false


Create a Service resource

create-a-service-resource page anchor
POST https://notify.twilio.com/v1/Services

Request body parameters

request-body-parameters page anchor
Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


ApnCredentialSidSID<CR>Optional

The SID of the Credential to use for APN Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

GcmCredentialSidSID<CR>Optional

The SID of the Credential to use for GCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

MessagingServiceSidSID<MG>Optional

The SID of the Messaging Service to use for SMS Bindings. This parameter must be set in order to send SMS notifications.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

FacebookMessengerPageIdstringOptional

Deprecated.


DefaultApnNotificationProtocolVersionstringOptional

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


DefaultGcmNotificationProtocolVersionstringOptional

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


FcmCredentialSidSID<CR>Optional

The SID of the Credential to use for FCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

DefaultFcmNotificationProtocolVersionstringOptional

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


LogEnabledbooleanOptional

Whether to log notifications. Can be: true or false and the default is true.


AlexaSkillIdstringOptional

Deprecated.


DefaultAlexaNotificationProtocolVersionstringOptional

Deprecated.


DeliveryCallbackUrlstringOptional

URL to send delivery status callback.


DeliveryCallbackEnabledbooleanOptional

Callback configuration that enables delivery callbacks, default false

Create a Service resource

create-a-service-resource-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.notify.v1.services.create().then(service => console.log(service.sid));

Output

_28
{
_28
"sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
_28
"date_created": "2016-03-09T20:22:31Z",
_28
"date_updated": "2016-03-09T20:22:31Z",
_28
"apn_credential_sid": null,
_28
"gcm_credential_sid": null,
_28
"fcm_credential_sid": null,
_28
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"facebook_messenger_page_id": "4",
_28
"alexa_skill_id": null,
_28
"default_apn_notification_protocol_version": "3",
_28
"default_gcm_notification_protocol_version": "3",
_28
"default_fcm_notification_protocol_version": "3",
_28
"default_alexa_notification_protocol_version": "3",
_28
"log_enabled": true,
_28
"type": "S",
_28
"delivery_callback_url": "Hello",
_28
"delivery_callback_enabled": true,
_28
"url": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"links": {
_28
"bindings": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings",
_28
"notifications": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications",
_28
"segments": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Segments",
_28
"users": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users"
_28
}
_28
}


Fetch a Service resource

fetch-a-service-resource page anchor
GET https://notify.twilio.com/v1/Services/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IS>required

The Twilio-provided string that uniquely identifies the Service resource to fetch.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(service => console.log(service.friendlyName));

Output

_28
{
_28
"sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
_28
"date_created": "2016-03-09T20:22:31Z",
_28
"date_updated": "2016-03-09T20:22:31Z",
_28
"apn_credential_sid": null,
_28
"gcm_credential_sid": null,
_28
"fcm_credential_sid": null,
_28
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"facebook_messenger_page_id": "4",
_28
"alexa_skill_id": null,
_28
"default_apn_notification_protocol_version": "3",
_28
"default_gcm_notification_protocol_version": "3",
_28
"default_fcm_notification_protocol_version": "3",
_28
"default_alexa_notification_protocol_version": "3",
_28
"log_enabled": true,
_28
"type": "S",
_28
"delivery_callback_url": "Hello",
_28
"delivery_callback_enabled": true,
_28
"url": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"links": {
_28
"bindings": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings",
_28
"notifications": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications",
_28
"segments": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Segments",
_28
"users": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users"
_28
}
_28
}


Read multiple Service resources

read-multiple-service-resources page anchor
GET https://notify.twilio.com/v1/Services

Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

The string that identifies the Service resources to read.


PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Read multiple Service resources

read-multiple-service-resources-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.notify.v1.services
_10
.list({limit: 20})
_10
.then(services => services.forEach(s => console.log(s.sid)));

Output

_41
{
_41
"meta": {
_41
"page": 0,
_41
"page_size": 50,
_41
"first_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0",
_41
"previous_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0",
_41
"url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0",
_41
"next_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=1",
_41
"key": "services"
_41
},
_41
"services": [
_41
{
_41
"sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
_41
"date_created": "2016-03-09T20:22:31Z",
_41
"date_updated": "2016-03-09T20:22:31Z",
_41
"apn_credential_sid": null,
_41
"gcm_credential_sid": null,
_41
"fcm_credential_sid": null,
_41
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"facebook_messenger_page_id": "4",
_41
"alexa_skill_id": null,
_41
"default_apn_notification_protocol_version": "3",
_41
"default_gcm_notification_protocol_version": "3",
_41
"default_fcm_notification_protocol_version": "3",
_41
"default_alexa_notification_protocol_version": "3",
_41
"log_enabled": true,
_41
"type": "S",
_41
"delivery_callback_url": "Hello",
_41
"delivery_callback_enabled": true,
_41
"url": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"links": {
_41
"bindings": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings",
_41
"notifications": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications",
_41
"segments": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Segments",
_41
"users": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users"
_41
}
_41
}
_41
]
_41
}


Update a Service resource

update-a-service-resource page anchor
POST https://notify.twilio.com/v1/Services/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IS>required

The Twilio-provided string that uniquely identifies the Service resource to update.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


ApnCredentialSidSID<CR>Optional

The SID of the Credential to use for APN Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

GcmCredentialSidSID<CR>Optional

The SID of the Credential to use for GCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

MessagingServiceSidSID<MG>Optional

The SID of the Messaging Service to use for SMS Bindings. This parameter must be set in order to send SMS notifications.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

FacebookMessengerPageIdstringOptional

Deprecated.


DefaultApnNotificationProtocolVersionstringOptional

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


DefaultGcmNotificationProtocolVersionstringOptional

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


FcmCredentialSidSID<CR>Optional

The SID of the Credential to use for FCM Bindings.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

DefaultFcmNotificationProtocolVersionstringOptional

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding resource.


LogEnabledbooleanOptional

Whether to log notifications. Can be: true or false and the default is true.


AlexaSkillIdstringOptional

Deprecated.


DefaultAlexaNotificationProtocolVersionstringOptional

Deprecated.


DeliveryCallbackUrlstringOptional

URL to send delivery status callback.


DeliveryCallbackEnabledbooleanOptional

Callback configuration that enables delivery callbacks, default false

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({friendlyName: 'friendly_name'})
_10
.then(service => console.log(service.friendlyName));

Output

_28
{
_28
"sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c",
_28
"date_created": "2016-03-09T20:22:31Z",
_28
"date_updated": "2016-03-09T20:22:31Z",
_28
"apn_credential_sid": null,
_28
"gcm_credential_sid": null,
_28
"fcm_credential_sid": null,
_28
"default_apn_notification_protocol_version": "3",
_28
"default_gcm_notification_protocol_version": "3",
_28
"default_fcm_notification_protocol_version": "3",
_28
"default_alexa_notification_protocol_version": "3",
_28
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"alexa_skill_id": null,
_28
"facebook_messenger_page_id": "4",
_28
"log_enabled": true,
_28
"type": "S",
_28
"delivery_callback_url": "Hello",
_28
"delivery_callback_enabled": true,
_28
"url": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28
"links": {
_28
"bindings": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings",
_28
"notifications": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications",
_28
"segments": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Segments",
_28
"users": "https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users"
_28
}
_28
}


Delete a Service resource

delete-a-service-resource page anchor
DELETE https://notify.twilio.com/v1/Services/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<IS>required

The Twilio-provided string that uniquely identifies the Service resource to delete.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();


Rate this page: