31102: Authorization token missing in request
VOICE
ERROR
This Voice SDK error indicates the request was malformed because it lacked an authorization token. In the Voice SDK error taxonomy, 311xx denotes malformed requests and 31102 is explicitly defined as Authorization token missing from the request.
- The client did not supply an Access Token when initializing the Voice SDK or before attempting to connect, so no authorization token reached Twilio. For example, the JavaScript SDK requires a token when creating a Device or during setup.
- The application attempted to run a Voice SDK operation that requires a token, such as a preflight test, without providing an Access Token.
- The app failed to retrieve a token from its server-side token endpoint and proceeded without passing a token to the SDK, resulting in a malformed request. Twilio's Voice SDKs require AccessTokens as credentials for end users.
- Generate a valid Access Token on your server using an API Key and Secret and include the appropriate Voice grant, then provide that token to the client before calling Voice SDK methods. Access Tokens are the required authentication mechanism for Twilio client-side SDKs.
- Ensure the client initializes the SDK with a nonempty token and passes it when establishing a connection for calls. For example, instantiate or set up the Device with a token prior to use.
- Verify your token vending flow works as documented so the client reliably fetches a token before attempting any Voice SDK requests. A typical pattern is exposing a /token endpoint that returns an Access Token to the app.
- If your application still uses deprecated Capability Tokens, migrate to Access Tokens to align with current authentication requirements for the Voice SDK.
- Use Twilio Debugger Error Logs to confirm 31102 events and gather context while testing your token flow.