Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Devices REST: Keys

A Device Key is a credential that enables your devices to connect to gateways of Twilio Sync for IoT. The Key consists of a public SID part that identifies it and a private secret part, automatically generated by the Device Manager during creation of the Key resource. A single Key may simultaneously belong to just one Device, however each Device may have multiple keys.

Keys allow the developer to:

  • Authenticate the devices in order to reliably establish their identity and access to Twilio services
  • Revoke access to Twilio services for individual devices if they get compromised
  • Renew access rights periodically, e.g. per a key rotation policy

For more information on managing keys and their dependencies, please refer to Adding Credentials documentation.

Twilio Console

You can manage Keys of your Sync IoT devices using your Twilio console when logged in to the console.

Properties

Each Key resource has the following properties. Some of them are optional and allowed to be null: friendly_name, device_sid.

Note: the key secret is returned only once after key creation, and is not available for subsequent queries, will be reported as null instead due to security reasons.

Names in PHP format
sid
sid<KY> Not PII

Contains a 34 character string that uniquely identifies this Key credential resource.

url
url Not PII

Contains an absolute URL for this Key credential resource.

friendlyName
string Not PII

Contains a human readable descriptive text for this Key credential, up to 256 characters long.

fleetSid
sid_like<FL> Not PII

Specifies the unique string identifier of the Fleet that the given Key credential belongs to.

accountSid
sid<AC> Not PII

Specifies the unique string identifier of the Account responsible for this Key credential.

deviceSid
sid<TH> Not PII

Specifies the unique string identifier of a Device authenticated with this Key credential.

secret
string Not PII

Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device.

dateCreated
date_time<iso8601> Not PII

Specifies the date this Key credential was created, given in UTC ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

Specifies the date this Key credential was last updated, given in UTC ISO 8601 format.

List All Keys

GET /Fleets/{FLxx|UniqueName}/Keys

Retrieve a list of all Keys credentials belonging to the Fleet.

Note: By default, this will return the first 50 Keys. Supply a PageSize parameter to fetch up to 100 items at once. See paging for more information.

List Filters

The following GET query string parameters allow you to limit the list returned. Note that the parameters are case-sensitive:

Names in PHP format
deviceSid
Optional
get sid<TH> Not PII

Filters the resulting list of Keys by a unique string identifier of an authenticated Device.

        
        
        
        

        Create a Key

        POST /Fleets/{FLxx|UniqueName}/Keys
        

        Create a new Key credential in the Fleet, optionally giving it a friendly name and assigning to a Device.

        Parameters

        Names in PHP format
        friendlyName
        Optional
        post string Not PII

        Provides a human readable descriptive text for this Key credential, up to 256 characters long.

        deviceSid
        Optional
        post sid<TH> Not PII

        Provides the unique string identifier of an existing Device to become authenticated with this Key credential.

              
              
              
              

              Retrieve a Key

              GET /Fleets/{FLxx|UniqueName}/Keys/{KYxx}
              

              Fetch information about a specific Key credential in the Fleet.

                    
                    
                    
                    

                    Update a Key

                    POST /Fleets/{FLxx|UniqueName}/Keys/{KYxx}
                    

                    Update the given properties of a specific Key credential in the Fleet, giving it a friendly name or assigning to a Device.

                    Parameters

                    Names in PHP format
                    sid
                    Required
                    post sid<KY> Not PII

                    Provides a 34 character string that uniquely identifies the requested Key credential resource.

                    friendlyName
                    Optional
                    post string Not PII

                    Provides a human readable descriptive text for this Key credential, up to 256 characters long.

                    deviceSid
                    Optional
                    post sid<TH> Not PII

                    Provides the unique string identifier of an existing Device to become authenticated with this Key credential.

                          
                          
                          
                          

                          Delete A Key

                          DELETE /Fleets/{FLxx|UniqueName}/Keys/{KYxx}
                          

                          Delete a specific Key credential from the Fleet, effectively disallowing any inbound client connections that are presenting it.

                                
                                
                                
                                
                                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 browsing the Twilio tag on Stack Overflow.