Sample - Twilio API
POST/2010-04-01/Accounts/{AccountSid}/Tokens.json

Create an ICE server token

Creates a temporary token containing credentials for ICE servers. Use AccountSid to identify the account that creates the token and optionally set Ttl to control how long the generated credentials remain valid. The response includes temporary credentials and the STUN and TURN server URIs.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
AccountSidstringrequired
The unique identifier of the account that creates the token. Must be a 34-character SID beginning with `AC`.

Optional form-encoded settings for the temporary ICE server token.

Ttlintegeroptional
The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours).

1 status code
201Returns the created token object, including the account identifier, creation and update timestamps, ICE server credentials and URIs, temporary password, credential lifetime, and username.
account_sidstringoptional
The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Token resource.
date_createdstringoptional
The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
date_updatedstringoptional
The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
ice_serversarray<object>optional
An array representing the ephemeral credentials and the STUN and TURN server URIs.
passwordstringoptional
The temporary password that the username will use when authenticating with Twilio.
ttlstringoptional
The duration in seconds for which the username and password are valid.
usernamestringoptional
The temporary username that uniquely identifies a Token.

Error handling

AccountSid must be a 34-character account SID beginning with AC. Ttl, when supplied, represents the credential lifetime in seconds; it defaults to 86400 seconds, or 24 hours, when omitted.