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?

REST API: Network Traversal Service Tokens

Network Traversal Service Tokens are ephemeral credentials that let you access TURN resources from WebRTC and VoIP clients. They are a secure way to create communication sessions with web browsers or mobile apps without exposing credentials in a client-side environment. All tokens have a limited lifetime to protect you from abuse. The lifetime is configurable up to 24 hours (which is also the default value) but you should make it as short as possible for your application.

Token List Resource

Resource URI

/2010-04-01/Accounts/{AccountSid}/Tokens

Resource Properties

A Token instance resource has the following properties

Property Description
Username The temporary username that uniquely identifies a Token.
Password The temporary password that the username will use when authenticating with Twilio.
Ttl The duration in seconds for which the username and password are valid, the default value is 86,400 (24 hours)
AccountSid The unique id of the Account that created this Token.
IceServers An array representing the ephemeral credentials and the STUN and TURN server URIs.
DateCreated The date that this resource was created, given in RFC 2822 format.
DateUpdated The date that this resource was last updated, given in RFC 2822 format.

HTTP GET

Not Supported

HTTP POST

You can create a new Token resource by POSTing to the Tokens list resource. Since the purpose of tokens is to provide short-lived credentials, usernames and passwords are always auto-generated and not intended to be stored long term.

Optional Parameters

You may POST the following parameters:

Parameter Description
Ttl The duration in seconds for which the generated credentials are valid, the default value is 86400 (24 hours).
Examples
        
        
        
        
              
              
              
              

              HTTP PUT

              Not Supported.

              HTTP DELETE

              Not Supported.

              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.