Menu

Expand
Rate this page:

Notify API Credential Resource

We are no longer allowing customers to onboard to Notify. We intend to deprecate the Notify product on April 25, 2024. Learn more in our Notify API End of Life Notice. We prepared this Transition Guide to assist in supporting your push notification use cases.

The Credential resource stores the credentials to use with a notification Binding. Credentials can be stored for APNS and FCM binding types.

Credential properties are specific to the binding type and provided by the vendor that supports it. Learn more about vendor-specific credentials at:

Credential properties

Resource Properties in REST API format
sid
sid<CR> Not PII

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

account_sid
sid<AC> Not PII

The SID of the Account that created the Credential resource.

friendly_name
string Not PII

The string that you assigned to describe the resource.

type
enum:push_service Not PII

The Credential type. Can be: gcm, fcm, or apn.

sandbox
string Not PII

[APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

url
url Not PII

The absolute URL of the Credential resource.

Create a Credential resource

post
https://notify.twilio.com/v1/Credentials
Parameters
Parameters in REST API format
type
Required
post enum:push_service Not PII

The Credential type. Can be: gcm, fcm, or apn.

friendly_name
Optional
post string Not PII

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

certificate
Optional
post string Not PII

[APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. -----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----

private_key
Optional
post string Not PII

[APN only] The URL-encoded 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-----

sandbox
Optional
post boolean Not PII

[APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

api_key
Optional
post string Not PII

[GCM only] The Server key of your project from Firebase console under Settings / Cloud messaging.

secret
Optional
post string Not PII

[FCM only] The Server key of your project from Firebase console under Settings / Cloud messaging.

Example 1
Loading Code Sample...
        
        

        Create a Credential resource

        Fetch a Credential resource

        get
        https://notify.twilio.com/v1/Credentials/{Sid}
        Parameters
        Parameters in REST API format
        sid
        Path
        get sid<CR> Not PII

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

        Example 1
        Loading Code Sample...
              
              

              Fetch a Credential resource

              Read multiple Credential resources

              get
              https://notify.twilio.com/v1/Credentials
              Example 1
              Loading Code Sample...
                    
                    

                    Read multiple Credential resources

                    Update a Credential resource

                    post
                    https://notify.twilio.com/v1/Credentials/{Sid}
                    Parameters
                    Parameters in REST API format
                    sid
                    Path
                    post sid<CR> Not PII

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

                    friendly_name
                    Optional
                    post string Not PII

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

                    certificate
                    Optional
                    post string Not PII

                    [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. -----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----

                    private_key
                    Optional
                    post string Not PII

                    [APN only] The URL-encoded 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-----

                    sandbox
                    Optional
                    post boolean Not PII

                    [APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

                    api_key
                    Optional
                    post string Not PII

                    [GCM only] The Server key of your project from Firebase console under Settings / Cloud messaging.

                    secret
                    Optional
                    post string Not PII

                    [FCM only] The Server key of your project from Firebase console under Settings / Cloud messaging.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Update a Credential resource

                          Delete a Credential resource

                          delete
                          https://notify.twilio.com/v1/Credentials/{Sid}
                          Parameters
                          Parameters in REST API format
                          sid
                          Path
                          delete sid<CR> Not PII

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

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete a Credential resource

                                Rate this page:

                                Need some help?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif