Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get started
Connect with Matter
Alexa Connect Kit
Add-ons
Certify
Resources
Skip to main content
After you receive the Amazon authorization code, you exchange the code for an Amazon access token by making an access token request from your app. You use the access token to call the Alexa service to enable the skill and complete account linking in Step 6.

Exchange the Amazon authorization code

To make an access token request, your app backend sends a POST request to the LWA token endpoint (https://api.amazon.com/auth/o2/token) with the authorization code, client ID, and client secret. If your app backend supports PKCE, include the code_verifier in the query string.

HTTP request

HTTP response

On success, the LWA token server returns a JSON response with the Amazon access token.
For more details about LWA, see the following references: For possible errors and the associated message to show the user, see Errors when exchanging the Amazon authorization code for an Amazon access token.

Example access token request

The following example shows an access token request. In this example, the app exchanges the user’s Amazon authorization code for an Amazon access token.

Errors

If an error occurs exchanging the Amazon authorization code for the Amazon access token, the Amazon token server responds with HTTP Status 400 and the JSON response body includes an error parameter, as described by the OAuth 2.0 specification. For details about why the request to obtain the Amazon access token failed, check the error_description parameter of the JSON response and the OAuth 2.0 specification description for that error code.
Error codeMessage to show to userPossible causes
invalid_requestWe are experiencing a problem connecting with Alexa to link your account. Please try again later.Missing client_id, client_secret, grant_type, and/or code
invalid_clientWe are experiencing a problem connecting with Alexa to link your account. Please try again later.Invalid client_id and/or client_secret
invalid_grantWe are experiencing a problem connecting with Alexa to link your account. Please try again later.The request’s code (Amazon authorization code) or the code verifier isn’t valid.
unauthorized_clientWe are experiencing a problem connecting with Alexa to link your account. Please try again later.The provided client_id doesn’t have permission to request consent to link the user’s account
unsupported_grant_typeWe are experiencing a problem connecting with Alexa to link your account. Please try again later.The request’s grant_type isn’t authorization_code
Last modified on October 4, 2026