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
Resource properties
sidtype: SID<IS>
Not PII

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

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

account_sidtype: SID<AC>

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

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

friendly_nametype: string

The string that you assigned to describe the resource.


date_createdtype: string<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_updatedtype: string<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_sidtype: SID<CR>

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

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

gcm_credential_sidtype: SID<CR>

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

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

fcm_credential_sidtype: SID<CR>

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

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

messaging_service_sidtype: SID<MG>

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.

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

facebook_messenger_page_idtype: string

Deprecated.


default_apn_notification_protocol_versiontype: string

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: string

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: string

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: boolean

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


urltype: string<uri>

The absolute URL of the Service resource.


linkstype: object<uri-map>

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


alexa_skill_idtype: string

Deprecated.


default_alexa_notification_protocol_versiontype: string

Deprecated.


delivery_callback_urltype: string

URL to send delivery status callback.


delivery_callback_enabledtype: boolean

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: string

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


ApnCredentialSidtype: SID<CR>

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

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

GcmCredentialSidtype: SID<CR>

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

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

MessagingServiceSidtype: SID<MG>

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.

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

FacebookMessengerPageIdtype: string

Deprecated.


DefaultApnNotificationProtocolVersiontype: string

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: string

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>

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

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

DefaultFcmNotificationProtocolVersiontype: string

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: boolean

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


AlexaSkillIdtype: string

Deprecated.


DefaultAlexaNotificationProtocolVersiontype: string

Deprecated.


DeliveryCallbackUrltype: string

URL to send delivery status callback.


DeliveryCallbackEnabledtype: boolean

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": "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}

URI parameters
Sidtype: SID<IS>
Path ParameterNot PII

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

Pattern:
^IS[0-9a-fA-F]{32}$
Min length:
34
Max 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

URI parameters
FriendlyNametype: string
Query ParameterNot PII

The string that identifies the Service resources to read.


PageSizetype: integer
Query ParameterNot PII

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

Minimum:
1

Pagetype: integer
Query ParameterNot PII

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

Minimum:
0

PageTokentype: string
Query ParameterNot PII

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}

URI parameters
Sidtype: SID<IS>
Path ParameterNot PII

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

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

Request body parameters
FriendlyNametype: string

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


ApnCredentialSidtype: SID<CR>

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

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

GcmCredentialSidtype: SID<CR>

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

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

MessagingServiceSidtype: SID<MG>

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.

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

FacebookMessengerPageIdtype: string

Deprecated.


DefaultApnNotificationProtocolVersiontype: string

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: string

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>

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

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

DefaultFcmNotificationProtocolVersiontype: string

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: boolean

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


AlexaSkillIdtype: string

Deprecated.


DefaultAlexaNotificationProtocolVersiontype: string

Deprecated.


DeliveryCallbackUrltype: string

URL to send delivery status callback.


DeliveryCallbackEnabledtype: boolean

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}

URI parameters
Sidtype: SID<IS>
Path ParameterNot PII

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

Pattern:
^IS[0-9a-fA-F]{32}$
Min length:
34
Max 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: