Skip to contentSkip to navigationSkip to topbar
Rate 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
Resource properties
sidtype: SID<IS>Not PII

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


account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that created the Service resource.


friendly_nametype: stringNot PII

The string that you assigned to describe the resource.


date_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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_sidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for APN Bindings.


gcm_credential_sidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for GCM Bindings.


fcm_credential_sidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for FCM Bindings.


messaging_service_sidtype: SID<MG>Not PII

The SID of the Messaging Service(link takes you to an external page) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set.


facebook_messenger_page_idtype: stringNot PII

Deprecated.


default_apn_notification_protocol_versiontype: stringNot PII

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


default_gcm_notification_protocol_versiontype: stringNot PII

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


default_fcm_notification_protocol_versiontype: stringNot PII

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


log_enabledtype: booleanNot PII

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


urltype: string<URI>Not PII

The absolute URL of the Service resource.


linkstype: object<URI MAP>Not PII

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


alexa_skill_idtype: stringNot PII

Deprecated.


default_alexa_notification_protocol_versiontype: stringNot PII

Deprecated.


delivery_callback_urltype: stringNot PII

URL to send delivery status callback.


delivery_callback_enabledtype: booleanNot PII

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

Parameters

create-parameters page anchor
Request body parameters
FriendlyNametype: stringNot PII

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


ApnCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for APN Bindings.


GcmCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for GCM Bindings.


MessagingServiceSidtype: SID<MG>Not PII

The SID of the Messaging Service(link takes you to an external page) to use for SMS Bindings. This parameter must be set in order to send SMS notifications.


FacebookMessengerPageIdtype: stringNot PII

Deprecated.


DefaultApnNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


DefaultGcmNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


FcmCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for FCM Bindings.


DefaultFcmNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


LogEnabledtype: booleanNot PII

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


AlexaSkillIdtype: stringNot PII

Deprecated.


DefaultAlexaNotificationProtocolVersiontype: stringNot PII

Deprecated.


DeliveryCallbackUrltype: stringNot PII

URL to send delivery status callback.


DeliveryCallbackEnabledtype: booleanNot PII

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.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": null,
_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}

URI parameters
Sidtype: SID<IS>Not PII
Path Parameter

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

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": null,
_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

URI parameters
FriendlyNametype: stringNot PII
Query Parameter

The string that identifies the Service resources to read.


PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

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": null,
_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}

URI parameters
Sidtype: SID<IS>Not PII
Path Parameter

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


Request body parameters
FriendlyNametype: stringNot PII

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


ApnCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for APN Bindings.


GcmCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for GCM Bindings.


MessagingServiceSidtype: SID<MG>Not PII

The SID of the Messaging Service(link takes you to an external page) to use for SMS Bindings. This parameter must be set in order to send SMS notifications.


FacebookMessengerPageIdtype: stringNot PII

Deprecated.


DefaultApnNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


DefaultGcmNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


FcmCredentialSidtype: SID<CR>Not PII

The SID of the Credential(link takes you to an external page) to use for FCM Bindings.


DefaultFcmNotificationProtocolVersiontype: stringNot PII

The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a Binding(link takes you to an external page) resource.


LogEnabledtype: booleanNot PII

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


AlexaSkillIdtype: stringNot PII

Deprecated.


DefaultAlexaNotificationProtocolVersiontype: stringNot PII

Deprecated.


DeliveryCallbackUrltype: stringNot PII

URL to send delivery status callback.


DeliveryCallbackEnabledtype: booleanNot PII

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": null,
_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}

URI parameters
Sidtype: SID<IS>Not PII
Path Parameter

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

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: