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.DataController interface in your Alexa add-on to enable users to view and delete data on Alexa, on the device, and in the device cloud. When the customer asks Alexa to view or delete data, your add-on receives a data controller directive. When the customer deletes data directly on the device or device app, your add-on sends the data controller events to Alexa. The Alexa.DataController interface is a generic controller interface. Typically, you use the Alexa.DataController interface with the Alexa.SmartVision.ObjectDetectionSensor interface. For the list of languages that the Alexa.DataController interface supports, see List of Alexa Interfaces and Supported Languages. For the definitions of the message properties, see Alexa Interface Message and Property Reference.

Data retrieval

Alexa initiates data retrieval by sending a directive to your add-on. After your add-on reports the requested data, Alexa might display the data to the customer in the Alexa app. Also, you can report the data proactively by sending an event to Alexa. The following example shows the message flow when Alexa requests data from your add-on. The nextToken parameter in the DataReport event indicates that there are multiple results. To get the next results, Alexa sends another ReportData directive with a matching nextToken. Order of directives and events for a data request that has three DataReport results.

Utterances

The Alexa.DataController interface doesn’t have any user utterances. Instead, Alexa communicates with your add-on after the customer requests to view and delete data from the Alexa app.

Properties and objects

The Alexa.DataController interface defines the following properties and objects.

Reportable properties

The Alexa.DataController interface doesn’t include any reportable properties.

DataRetrievalSchema object

The DataRetrievalSchema object defines the data format and name of the schema for the data published in the DataReport event.
PropertyDescriptionType
typeData format.
Valid values: BINARY, JSON.
String
schemaName of the data schema.
For JSON schemas, set to the JSON type defined by the data controller instance. For binary schemas, set to the published schema.
String

Query object

The Query object defines the query string for the ReportData and DeleteData directives. All properties are optional.
PropertyDescriptionType
idsList of unique IDs used for query by ID.
Maximum: 10 IDs.
Array of string
fromTimeBeginning time for query by timestamp range.
If not specified, the query starts from the time of the earliest data item available.
DateTime object
toTimeEnd time for query by timestamp range.
If not specified, the query ends at the time of the latest data item available.
DateTime object

Discovery

You describe endpoints that support Alexa.DataController by using the standard discovery mechanism described in Alexa.Discovery. For the full list of display categories, see display categories. An endpoint can support multiple data controllers, so you must always include the instance name in your events and responses. Include an Alexa.DataController instance for each interface and schema that the same endpoint supports. Define an instance name that describes the data. To let Alexa know the health of your device, also implement the Alexa.EndpointHealth interface.

Configuration object

In addition to the usual discovery response fields, for Alexa.DataController, include a Configuration object that contains the following fields.
PropertyDescriptionTypeRequired
targetCapability.nameAlexa interface that this controller applies to.StringYes
targetCapability.versionVersion of the Alexa interface that this controller applies to.StringYes
dataRetrievalSchemaIndicates that the targetCapability supports data retrieval. If not present, the capability doesn’t support data retrieval.DataRetrievalSchema objectNo
supportedAccessIndicates the search methods supported for data access.
Valid values: BY_IDENTIFIER, BY_TIMESTAMP_RANGE.
Array of stringsYes

Discover response example

The following example shows a Discover.Response message for a smart-vision camera that supports the Alexa.DataController and Alexa.SmartVision.ObjectDetectionSensor interfaces.

Directives and events

The Alexa.DataController interface defines the following directives and events.

ReportData directive

Support the ReportData directive so that a customer can request to view data stored on your endpoint.

ReportData directive example

The following example shows a ReportData directive that Alexa sends to a smart-vision camera add-on to retrieve data by ID. The directive doesn’t include the token because Alexa requests the first page of data.

ReportData directive payload

The following table shows the payload details for the ReportData directive.
PropertyDescriptionTypeRequired
queryTypeIdentifies how to search the data.
Valid values: QUERY_BY_IDENTIFIER, QUERY_BY_TIMESTAMP_RANGE, QUERY_ALL.
StringYes
queryIdentifies the search string based on the specified queryType. Include for QUERY_BY_IDENTIFIER and QUERY_BY_TIMESTAMP_RANGE.Query objectNo
maxResultsSpecifies the maximum number of matching results to return.
Valid values: 1 – 10, inclusive.
IntegerYes
nextTokenToken to use to retrieve a specific page of the results. If the token isn’t included, the response contains the first page of the matching results.StringNo

ReportData response

If you handle a ReportData directive successfully, respond with a DataReport event. Include the data in the response.

ReportData directive error handling

If you can’t handle a ReportData directive successfully, respond with an Alexa.DataController.ErrorResponse event. You can also respond with a generic Alexa.ErrorResponse event.

DeleteData directive

Support the DeleteData directive so that a customer can request to delete data from your endpoint.

DeleteData directive example

The following example shows a DeleteData directive that Alexa sends to a smart-vision camera add-on to delete data by time range.

DeleteData directive payload

The following table shows the payload details for the DeleteData directive.
PropertyDescriptionTypeRequired
queryTypeIdentifies how to search the data.
Valid values: QUERY_BY_IDENTIFIER, QUERY_BY_TIMESTAMP_RANGE, QUERY_ALL.
StringYes
queryIdentifies the search string based on the specified queryType. Include for QUERY_BY_IDENTIFIER and QUERY_BY_TIMESTAMP_RANGE.Query objectNo

DeleteData response

If you handle a DeleteData directive successfully, respond with an DataDeleted event.

DeleteData directive error handling

If you can’t handle a DeleteData directive successfully, respond with an Alexa.DataController.ErrorResponse event. You can also respond with a generic Alexa.ErrorResponse event.

DataReport event

Send a DataReport event to the Alexa event gateway to report data proactively to Alexa. For details, see Send Events to the Event Gateway. You can send the event at any time or in response to a ReportData directive. Include the correlation token if you send the event in response to the directive. Otherwise, don’t include the correlation token. The event includes a token that indicates whether there is more data to retrieve. After Alexa receives a DataReport event that includes a nextToken parameter, Alexa sends a ReportData directive with the same nextToken value to your add-on. In response, your add-on must send the next set of data results in another DataReport event.

DataReport event example

The following example shows a DataReport event that a smart-vision camera add-on sends to Alexa in response to a ReportData directive. The example includes the correlationToken.

DataReport event payload

The following table shows the payload details for the DataReport event.
PropertyDescriptionTypeRequired
paginationContextInformation about the next page of results. If you don’t support pagination, don’t include this parameter.ObjectNo
paginationContext.nextTokenToken used to report the next page of results. If there are more results, include this parameter.StringNo
dataSchemaSchema of the included data. You identified the schema format in your discovery response.DataRetrievalSchema objectNo
dataFor JSON schemas, include the array of JSON data. For binary schemas, don’t include this parameter and pass the data as a multi-part attachment.Array of StringNo

DataReport response

If your add-on proactively sent a DataReport event and Alexa handles the event successfully, your add-on receives HTTP status code 202 Success. On error, Alexa sends the appropriate HTTP status code. The following table shows the HTTP status codes sent in response to the event.
StatusDescription
202 SuccessOperation succeeded.
400 Invalid RequestIndicates that the request is invalid or badly formatted. Verify the event payload and check for any missing or invalid fields. For example, the data format must match the specified dataSchema.
401 UnauthorizedIndicates that the request didn’t include the authorization token or the token is invalid or expired.
403 ForbiddenIndicates that the authorization token doesn’t have sufficient permissions or the add-on is disabled.
404 Not FoundIndicates that the add-on doesn’t exist in the corresponding stage.
413 Request Entity Too LargeMaximum number or size of a parameter exceeds the limit. For example, more than 50 IDs included in the DataDeleted event.
429 Too Many Requests responseNumber of requests per minute is too high. Use exponential back-off and retry the request.
500 Internal Server ErrorAn error occurred on the server. The add-on can retry by using exponential back-off.
503 Service UnavailableServer is busy or unavailable. The add-on can retry by using exponential back-off.

DataDeleted event

Send a DataDeleted event to the Alexa event gateway to notify Alexa proactively that you deleted the data identified by a unique ID. For details, see Send Events to the Event Gateway. You can send the event at any time or in response to a DeleteData directive. Include the correlation token if you send the event in response to the directive. Otherwise, don’t include the correlation token.

DataDeleted event example

The following example shows a DataDeleted event that a smart-vision camera add-on sends to Alexa in response to a DeleteData directive. Include the correlation token if you send the event in response to the directive. Otherwise, don’t include the correlation token.

DataDeleted event payload

The following table shows the payload details for the DataDeleted event.
PropertyDescriptionTypeRequired
queryTypeIdentifies how to search the data.
Valid values: QUERY_BY_IDENTIFIER, QUERY_BY_TIMESTAMP_RANGE, QUERY_ALL.
StringYes
queryIdentifies the search string based on the specified queryType. Include for QUERY_BY_IDENTIFIER and QUERY_BY_TIMESTAMP_RANGE.Query objectNo

DataDeleted response

If your add-on proactively sent a DataDeleted event and Alexa handles the event successfully, your add-on receives HTTP status code 202 Success. On error, Alexa sends the appropriate HTTP status code. If Alexa sent the DataDeleted event to your add-on proactively, respond with the appropriate HTTP status code. The following table shows the HTTP status codes sent in response to the event.
StatusDescription
202 SuccessOperation succeeded.
400 Invalid RequestIndicates that the request is invalid or badly formatted. Verify the event payload and check for any missing or invalid fields. For example, the data format must match the specified dataSchema.
401 UnauthorizedIndicates that the request didn’t include the authorization token or the token is invalid or expired.
403 ForbiddenIndicates that the authorization token doesn’t have sufficient permissions or the add-on is disabled.
404 Not FoundIndicates that the add-on doesn’t exist in the corresponding stage.
413 Request Entity Too LargeMaximum number or size of a parameter exceeds the limit. For example, more than 50 IDs included in the DataDeleted event.
429 Too Many Requests responseNumber of requests per minute is too high. Use exponential back-off and retry the request.
500 Internal Server ErrorAn error occurred on the server. The add-on can retry by using exponential back-off.
503 Service UnavailableServer is busy or unavailable. The add-on can retry by using exponential back-off.

Change reporting

You send a ChangeReport event to report changes proactively in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For details about change reports, see Understand State and Change Reporting.
Last modified on September 30, 2026