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
Implement the Alexa.Authorization interface in your Alexa add-on to give your add-on access to the Alexa event gateway. Access to the gateway enables you to send asynchronous responses and proactive events, such as Alexa.ChangeReport, to Alexa. For the definitions of the message properties, see Alexa Interface Message and Property Reference.

Event gateway authorization

The purpose of the Alexa.Authorization.AcceptGrant directive is to enable you to obtain credentials that identify and authenticate a customer to Alexa. Alexa sends an AcceptGrant directive after a customer enables a smart home add-on and goes through the account linking process, or when you update an existing smart home add-on to support proactive events. The AcceptGrant directive contains the following information:
  • Alexa sends you an authorization code. Exchange the authorization code for an access token and refresh token by using Login With Amazon (LWA). For details, see the Get access token with authorization code operation and LWA Authorization Code Grant.
  • Alexa sends you the access token for the customer that Alexa received during the account linking process. Store the token, and use the token to identify the customer in your system.

Directives

The Alexa.Authorization interface defines the following directives.

AcceptGrant directive

Support the AcceptGrant directive so that you can obtain and store credentials that identify a customer to Alexa.

AcceptGrant directive example

The following example illustrates an AcceptGrant directive that Alexa sends to your add-on. Because this interface is synchronous, the message doesn’t contain a correlation token.

AcceptGrant directive payload

The following table shows the payload details for the AcceptGrant directive.
PropertyDescriptionTypeRequired
grantInformation that identifies a customer in Amazon Alexa systems.ObjectYes
grant.typeType of grant.
Valid value: OAuth2.AuthorizationCode.
StringYes
grant.codeAuthorization code for the customer.
Exchange the authorization code for an access token and refresh token by using the Login With Amazon (LWA) OAuth 2.0 server.
StringYes
granteeInformation that identifies a customer in the linked-account service or system.ObjectYes
grantee.typeType of access token.
Smart home add-ons support bearer token types only. For more details, see OAuth Access Token Types.
Valid value: BearerToken.
StringYes
grantee.tokenThe customer access token received by Alexa during the account linking process.StringYes

AcceptGrant response

If you handle an AcceptGrant directive successfully, respond with an AcceptGrant.Response. Because this interface is synchronous only, don’t include a correlation token. The following example shows an AcceptGrant.Response. The response doesn’t require a payload.

AcceptGrant error handling

If you can’t handle an AcceptGrant directive successfully for one of the following reasons, respond with an Alexa.Authorization.ErrorResponse:
  • You’re unable to call LWA to exchange the authorization code for access and refresh tokens.
  • You’re unable to store the access and refresh tokens for the customer.
  • Any other error that occurs while you try to retrieve and store the access and refresh tokens.
For more general errors, respond with an Alexa.ErrorResponse event. The following example shows an Alexa.Authorization.ErrorResponse.
Last modified on September 28, 2026