Credentials resource Positive Feedback Negative Feedback Beta The Push Notifications API is currently available as a
Private Beta product. The information contained in this document is subject to change. You acknowledge
and agree that your use of the Twilio Push Notifications API is subject to the terms of the Services in
Private Beta(link takes you to an external page) . This
means that some features are not yet implemented and others may be changed before the product is
declared as Generally Available. Private Beta products are not covered by the Twilio Support Terms or
Twilio Service Level Agreement.
A Credential resource represents the authentication credentials required to send push notifications through a specific platform. Twilio supports two credential types:
FCM : Google Firebase Cloud Messaging credentials for Android devices and all web browsers (including Safari).
APN : Apple Push Notification service credentials for iOS devices.
After you upload a Credential, it is associated with an App . If you don't specify an App, the Credential is associated with your default App.
Info You can create a maximum of 10 Apps per account and 10 Credentials per App.
Positive Feedback Negative Feedback Property name Type Required PII Description Child properties
A reference to Credential.
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
credentialType enum<string> required
The credential types available for PushNotifications.
Possible values: APNAPN_SANDBOXFCM
Use this Credential as the default for the Push Notification App for the
given credentialType to send Push Notifications.
If a Credential of the given type doesn't already exist,
this Credential automatically becomes the default.
Default: false
The name of the app that this Credential is associated with.
This should be the same value as the appName set when registering devices for the app
with /PushNotifications/DeviceRegistrations
createdAt string<date-time> required
updatedAt string<date-time> required
Positive Feedback Negative Feedback
credentialTypeDescription FCMFirebase Cloud Messaging. Requires a base64-encoded privateKey (Google Cloud private key JSON object) in content. APNApple Push Notification service. Requires a base64-encoded certificate and privateKey in content.
Positive Feedback Negative Feedback POST https://comms.twilio.com/v1/PushNotifications/Credentials
Upload new push notification credentials by making an HTTP POST request to the Credentials resource URI.
When creating a Credential, specify an appName. If the App doesn't exist, the API creates it. If no other Apps exist, the API sets the created App as the default.
Positive Feedback Negative Feedback Encoding type: application/json
Property name Type Required PII Description Child properties
credentialType enum<string> required
The credential types available for PushNotifications.
Possible values: APNAPN_SANDBOXFCM
Credential properties are specific to the channel type and provided by the vendor that supports it.
Property name Type Required PII Description Child properties
certificate string<byte> required
The base64 representation of the certificate. Strip everything outside of the headers, e.g. -----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE----- and encode with base64 encoding.
privateKey string<byte> required
The base64 representation of the private key. Strip everything outside of the headers, e.g. -----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY----- and encode with base64 encoding.
Use this Credential as the default for the Push Notification App for the
given credentialType to send Push Notifications.
If a Credential of the given type doesn't already exist,
this Credential automatically becomes the default.
Default: false
The name of the App that this Credential will be associated with.
Twilio will automatically create a new Push Notification App on your behalf
when you create a Credential with a new appName.
The first App created will automatically be assigned as the default App.
Pattern: ^[a-z0-9_]+$Min length: 1Max length: 64
Select from available examples {
"credentialType" : "APN" ,
"appName" : "limonade_app" ,
"content" : {
"certificate" : "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tTUlJRm5UQ0NCSVdnQXdJQkFnSUlBank5SDg0OStFOHdEUVlKS29aSWh2Y05BUUVGQlFBd2daWXhDekFKQmdOVi4uLi4uQT09LS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==" ,
"privateKey" : "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLU1JSUVwUUlCQUFLQ0FRRUF1eWYvbE5ySDljazhEbU55bzNmR2d2Q0kxbDlzK2NtQlkzV0l6K2NVRHFteGlpZVIKLi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t"
}
}
Positive Feedback Negative Feedback The request was accepted and a resource ID is available to check the result. The response body contains the resource ID and link to the resource.
Property name Type Required Description Child properties
The Resource ID is an identifier for the resource that was created or updated
in response to the request.
resourceLocation string<uri> The location (uri) of the resource identified by Resource-Id.
{
"resourceId" : "comms_credential_01h9krwprkeee8fzqspvwy6nq8" ,
"resourceLocation" : "https://comms.twilio.com/v1/PushNotifications/Credentials/comms_credential_01h9krwprkeee8fzqspvwy6nq8"
}
This error indicates that the request content was malformed or ambiguous.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "Not Found" ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that you have sent too many requests to the API. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20429 ,
"message" : "Too many requests. Please retry according to the Retry-After response header." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20429" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is experiencing server-side issues. The request should not be retried.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20500 ,
"message" : "Internal server error." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20500" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is temporarily unavailable. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20503 ,
"message" : "Service unavailable." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20503" ,
"context" : "null"
}
]
}
1 import { TwilioClient } from "twilio-comms" ;
4 const client = new TwilioClient ({
8 await client.pushNotifications.credentials. create ({
11 certificate: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tTUlJRm5UQ0NCSVdnQXdJQkFnSUlBank5SDg0OStFOHdEUVlKS29aSWh2Y05BUUVGQlFBd2daWXhDekFKQmdOVi4uLi4uQT09LS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==" ,
12 privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLU1JSUVwUUlCQUFLQ0FRRUF1eWYvbE5ySDljazhEbU55bzNmR2d2Q0kxbDlzK2NtQlkzV0l6K2NVRHFteGlpZVIKLi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t" ,
Positive Feedback Negative Feedback GET https://comms.twilio.com/v1/PushNotifications/Credentials/{credentialId}
Retrieve a single Credential resource by making an HTTP GET request to the Credential resource URI with the Credential ID.
Positive Feedback Negative Feedback Property name Type Required PII Description
credentialId string required
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
Positive Feedback Negative Feedback OK
Property name Type Required Description Child properties
A reference to Credential.
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
credentialType enum<string> The credential types available for PushNotifications.
Possible values: APNAPN_SANDBOXFCM
Use this Credential as the default for the Push Notification App for the
given credentialType to send Push Notifications.
If a Credential of the given type doesn't already exist,
this Credential automatically becomes the default.
Default: false
The name of the app that this Credential is associated with.
This should be the same value as the appName set when registering devices for the app
with /PushNotifications/DeviceRegistrations
createdAt string<date-time>
updatedAt string<date-time>
Select from available examples {
"id" : "comms_credential_01h9krwprkeee8fzqspvwy6nq8" ,
"credentialType" : "APN" ,
"isDefault" : false ,
"appName" : "limonade_app" ,
"createdAt" : "2023-08-31T14:15:22Z" ,
"updatedAt" : "2023-08-31T14:15:22Z"
}
This error indicates that the request content was malformed or ambiguous.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "Not Found" ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that the requested resource was not found.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "The resource was not found." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that you have sent too many requests to the API. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20429 ,
"message" : "Too many requests. Please retry according to the Retry-After response header." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20429" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is experiencing server-side issues. The request should not be retried.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20500 ,
"message" : "Internal server error." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20500" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is temporarily unavailable. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20503 ,
"message" : "Service unavailable." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20503" ,
"context" : "null"
}
]
}
1 import { TwilioClient } from "twilio-comms" ;
4 const client = new TwilioClient ({
8 await client.pushNotifications.credentials. fetch ( "comms_credential_01h9krwprkeee8fzqspvwy6nq8" );
Positive Feedback Negative Feedback GET https://comms.twilio.com/v1/PushNotifications/Credentials
Returns a list of all Credentials associated with your account. You can filter by date range, app name, credential type, or default status.
Positive Feedback Negative Feedback Property name Type Required PII Description
startDate string<date-time> Filter to Push Credentials created after the specified date and time.
Filter to Push Credentials created before the specified date and time.
Filter Push Credentials by App name
Pattern: ^[a-z0-9_]+$Min length: 1Max length: 64
credentialType enum<string> Filter Push Credentials by type.
Possible values: APNAPN_SANDBOXFCM
Filter only is_default credentials.
The token to retrieve the next page of results.
The number of resources to return in a page.
Default: 50Example: 50Minimum: 1Maximum: 1000
Positive Feedback Negative Feedback OK
Property name Type Required Description Child properties
credentials array[PushNotificationCredential]
Show credentials properties
Property name Type Required Description Child properties
A reference to Credential.
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
credentialType enum<string> The credential types available for PushNotifications.
Possible values: APNAPN_SANDBOXFCM
Use this Credential as the default for the Push Notification App for the
given credentialType to send Push Notifications.
If a Credential of the given type doesn't already exist,
this Credential automatically becomes the default.
Default: false
The name of the app that this Credential is associated with.
This should be the same value as the appName set when registering devices for the app
with /PushNotifications/DeviceRegistrations
createdAt string<date-time>
updatedAt string<date-time>
pagination PaginationMetadata Metadata for paginated results.
This object contains two tokens to navigate through paginated results.
Use next to retrieve the 'next' page in the result list.
Use self to retrieve the same page of the result list again.
Supply the token in the pageToken query param.
Show pagination properties
Property name Type Required Description Child properties
Token for the next page of results.
Supply the token in the pageToken query param.
Token for the current page of results.
Supply the token in the pageToken query param.
{
"credentials" : [
{
"id" : "comms_credential_8qn6ywvpsqzf8eeekrpwrk9h10" ,
"credentialType" : "APN" ,
"isDefault" : true ,
"appName" : "limonade_app" ,
"createdAt" : "2023-08-31T14:15:22Z" ,
"updatedAt" : "2023-08-31T14:15:22Z"
},
{
"id" : "comms_credential_01h9krwprkeee8fzqspvwy6nq8" ,
"credentialType" : "FCM" ,
"isDefault" : true ,
"appName" : "limonade_app" ,
"createdAt" : "2023-08-31T14:15:22Z" ,
"updatedAt" : "2023-08-31T14:15:22Z"
}
],
"pagination" : {
"next" : null ,
"self" : "eyJTSyI6IkEjMDFqbmVoYm5xYWZmNDlrazUxZHA1bmN5bXciLCJTSzEiOiJBI2FjdGl2YXRlZCMyMDI1LTAzLTAzVDE3OjM3OjQ3WiMwMWpuZWhibnFhZmY0OWtrNTFkcDVuY3ltdyIsIlBLIjoiQyNBQzYwMzg4ODJiZDY5ZWIyNGM4YzU4ZGI5NjE4NjE3OTE4I0EifQ=="
}
}
This error indicates that the request content was malformed or ambiguous.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "Not Found" ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that you have sent too many requests to the API. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20429 ,
"message" : "Too many requests. Please retry according to the Retry-After response header." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20429" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is experiencing server-side issues. The request should not be retried.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20500 ,
"message" : "Internal server error." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20500" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is temporarily unavailable. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20503 ,
"message" : "Service unavailable." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20503" ,
"context" : "null"
}
]
}
1 import { TwilioClient } from "twilio-comms" ;
4 const client = new TwilioClient ({
8 await client.pushNotifications.credentials. list ({
9 startDate: new Date ( "2024-01-15T09:30:00Z" ),
10 endDate: new Date ( "2024-01-15T09:30:00Z" ),
Positive Feedback Negative Feedback PATCH https://comms.twilio.com/v1/PushNotifications/Credentials/{credentialId}
Update an existing Credential by making an HTTP PATCH request to the Credential resource URI with the Credential ID.
You can update whether this Credential is the default for its App and credential type.
Positive Feedback Negative Feedback Property name Type Required PII Description
credentialId string required
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
Positive Feedback Negative Feedback Encoding type: application/json
Property name Type Required PII Description Child properties
Use this Credential as the default for the Push Notification App for the
given credentialType to send Push Notifications.
If a Credential of the given type doesn't already exist,
this Credential automatically becomes the default.
Default: false
Positive Feedback Negative Feedback The request was accepted and a resource ID is available to check the result. The response body contains the resource ID and link to the resource.
Property name Type Required Description Child properties
The Resource ID is an identifier for the resource that was created or updated
in response to the request.
resourceLocation string<uri> The location (uri) of the resource identified by Resource-Id.
{
"resourceId" : "comms_credential_01h9krwprkeee8fzqspvwy6nq8" ,
"resourceLocation" : "https://comms.twilio.com/v1/PushNotifications/Credentials/comms_credential_01h9krwprkeee8fzqspvwy6nq8"
}
This error indicates that the request content was malformed or ambiguous.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "Not Found" ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that the requested resource was not found.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "The resource was not found." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that you have sent too many requests to the API. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20429 ,
"message" : "Too many requests. Please retry according to the Retry-After response header." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20429" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is experiencing server-side issues. The request should not be retried.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20500 ,
"message" : "Internal server error." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20500" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is temporarily unavailable. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20503 ,
"message" : "Service unavailable." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20503" ,
"context" : "null"
}
]
}
1 import { TwilioClient } from "twilio-comms" ;
4 const client = new TwilioClient ({
8 await client.pushNotifications.credentials. update ( "comms_credential_01h9krwprkeee8fzqspvwy6nq8" , {
Positive Feedback Negative Feedback DELETE https://comms.twilio.com/v1/PushNotifications/Credentials/{credentialId}
Delete a Credential by making an HTTP DELETE request to the Credential resource URI with the Credential ID.
If successful, returns HTTP 202 (Accepted) with a resource ID to check the result.
Warning If all Credentials belonging to an App are deleted, the App and its Device Registrations are deleted as well.
Positive Feedback Negative Feedback Property name Type Required PII Description
credentialId string required
Example: comms_credential_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_credential_[a-hjkmnpqrstv-z0-9]{26,34}
Positive Feedback Negative Feedback The request was accepted and a resource ID is available to check the result. The response body contains the resource ID and link to the resource.
Property name Type Required Description Child properties
The Resource ID is an identifier for the resource that was created or updated
in response to the request.
resourceLocation string<uri> The location (uri) of the resource identified by Resource-Id.
{
"resourceId" : "comms_credential_01h9krwprkeee8fzqspvwy6nq8" ,
"resourceLocation" : "https://comms.twilio.com/v1/PushNotifications/Credentials/comms_credential_01h9krwprkeee8fzqspvwy6nq8"
}
This error indicates that the request content was malformed or ambiguous.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "Not Found" ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that the requested resource was not found.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20404 ,
"message" : "The resource was not found." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20404" ,
"context" : "null"
}
]
}
This error indicates that you have sent too many requests to the API. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20429 ,
"message" : "Too many requests. Please retry according to the Retry-After response header." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20429" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is experiencing server-side issues. The request should not be retried.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20500 ,
"message" : "Internal server error." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20500" ,
"context" : "null"
}
]
}
This error indicates that the Twilio API is temporarily unavailable. You should retry according to the Retry-After response header.
Property name Type Required Description Child properties
A list of one or more Twilio API errors.
Property name Type Required Description Child properties
A human readable message describing the error.
A JSON path that identifies the errant field.
{
"errors" : [
{
"code" : 20503 ,
"message" : "Service unavailable." ,
"infoUrl" : "https://www.twilio.com/docs/api/errors/20503" ,
"context" : "null"
}
]
}
1 import { TwilioClient } from "twilio-comms" ;
4 const client = new TwilioClient ({
8 await client.pushNotifications.credentials. delete ( "comms_credential_01h9krwprkeee8fzqspvwy6nq8" );