Proactive Suggestion API


The Proactive Suggestion REST API enables you to display glanceable, interactive content on the home page of Alexa devices with screens.

With this API, you provide visual content to Alexa as suggestions. To create the visual experience for your suggestions, you use Alexa Presentation Language (APL).

Endpoint

The endpoint for the Proactive Suggestion API is https://api.amazonalexa.com.

Operations

The Proactive Suggestion API includes the following operations.

Description HTTP method and path

Create a campaign

POST /v1/proactive/campaigns

List campaigns

GET /v1/proactive/campaigns?maxResults={maxResults}&nextToken={nextToken}

Get a campaign

GET /v1/proactive/campaigns/{campaignId}

Delete a campaign

DELETE /v1/proactive/campaigns/{campaignId}

Create a campaign

Creates a campaign that renders the content as a suggestion to targeted recipients.

Request format

POST /v1/proactive/campaigns HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}

Request body format

The request body contains a campaign entity that encapsulates the suggestion along with recipients and scheduling specifics for the information. The following example shows a campaign entity.

{
    "suggestion": {
        "variants": [{
            "placement": {
                "channel": "HOME"
            },
            "content": {
                "values": [{
                    "locale": "en-US",
                    "document": {},
                    "datasources": {}
                }]
            }
        }] 
    },
    "targeting": {
       (polymorphic object of type users or skill subscribers)
    },
    "scheduling": {
        "activationWindow": {
            "start": "2021-01-01T10:00:00.00Z",
            "end": "2021-01-31T10:00:00.00Z"
        }
    }
}

Request body example

{
   "suggestion": {
      "variants": [
         {
            "placement": {
               "channel": "HOME"
            },
            "content": {
               "values": [
                 {
                    "locale": "en-US",
                    "document": {
                       "type": "Link",
                       "src": "doc://alexa/apl/documents/home/cards/textWrapping"
                    },
                    "datasources": {
                       "displayText": {
                          "headerText": "YourHeaderText",
                          "primaryText": "YourPrimaryText",
                          "secondaryText": "YourSecondaryText",
                          "attributionText": "YourAttributionText",
                          "hintText": "Try \"{WakeWord}, open SkillName\"",
                          "action": {
                             "type": "SkillConnection",
                             "uri": "connection://AMAZON.ColdLaunch/1?provider=amzn1.ask.skill.12345",
                             "input": {}
                          }                                                 
                       },
                       "background": {
                          "backgroundImageSource": "http://url-of-background-image"  
                       }
                    }
                 }
               ]
            }
         }
    ]
  },
   "targeting": {
      "type": "SKILL_SUBSCRIBERS"
   },
   "scheduling": {
      "activationWindow": {
         "start": "2021-09-20T21:25:27.179Z",
         "end": "2021-10-22T00:25:27.179Z"
      }
   }
}

Request body parameters

Field Description Type Required

suggestion

A piece of information that Alexa can proactively deliver to users.

Object

Yes

suggestion.variants[]

A list of suggestion variants to present to users. The list must contain at least one variant.

Array

Yes

suggestion.variants[].placement

The place where the content can be rendered.

Object

Yes

suggestion.variants[].placement.channel

The name of the channel. Currently the only supported value is "HOME", which refers to the home screen on Alexa multimodal devices.

String

Yes

suggestion.variants[].content.values[]

Object that contains localized presentation data specific to the default content type. At least one localized presentation data element must be present.

Object

Yes

suggestion.variants[].content.values[].locale

The locale in which the content is rendered, in IETF BCP 47 format.

String

Yes

suggestion.variants[].content.values[].document

A link to the APL document to use for rendering. For details, see Use a linked document with RenderDocument. Not all APL features are supported.

String

Yes

suggestion.variants[].content.values[].document.type

The APL document type. Must be Link.

String

Yes

suggestion.variants[].content.values[].document.src

The APL document link. Currently only "doc://alexa/apl/documents/enterprise/suggestions/home/defaultTemplate" is supported.

String

Yes

suggestion.variants[].content.values[].datasources

Object that can contain other objects that can be used to bind data to the APL document.

Map of data source objects

Yes

suggestion.variants[].content.values[].datasources.displayText.title

The text to be rendered in the title field of the document. This text is displayed in a large font on the home screen. Maximum length is 25 characters.

String

No

suggestion.variants[].content.values[].datasources.displayText.body

The text to be rendered in the body field of the document. This text is displayed in a smaller font below the title on the home screen. Maximum length is 60 characters.

String

No

targeting

Polymorphic object that defines the recipients of the campaign. One of two types of targets: users or skill subscribers.

Object

Yes

scheduling

The scheduling information for the campaign.

Object

Yes

scheduling.activationWindow

A time window object specifying the time in which a campaign is active. If this field is not specified, Alexa uses default values.

Object

No

scheduling.activationWindow.start

The start of the time window. A string that uses the RFC 3339 profile of the ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. The default value is the current time.

String

No

scheduling.activationWindow.end

The end of the time window. A string that uses the RFC 3339 profile of the ISO 8601 format, YYYY-MM-DDThh:mm:ssZ. Must be later than or equal to the start time. The default value is 24 hours after the current time.

String

No

Users target

The users that the campaign targets.

{
   "type": "USERS", 
   "values": [
      {
         "id": "amzn1.ask.account.{id}"
      }
   ]
}
Field Description Type Required

type

The type of targeting criteria that should be applied. Accepted value: USERS.

String

Yes

values[]

A list of objects that contain the user IDs in the form of amzn1.ask.account.{id}. Currently, this list must contain exactly one user ID.

Array

Yes

values[].id

A user ID in the form of amzn1.ask.account.{id}.

String

Yes

Skill subscribers target

The skill users that the campaign targets.

{
   "type": "SKILL_SUBSCRIBERS"
}
Field Description Type Required

type

The type of targeting criteria that should be applied. Accepted value: SKILL_SUBSCRIBERS.

String

Yes

Success response header

HTTP/1.1 202 Accepted
Host: {host value used in the request}
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field Description Type Required

X-Amzn-RequestId

Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem.

String

Yes

Response body format

{
    "campaignId": "{exampleId}"
}

Response body parameters

Field Description Type

campaignId

Campaign ID for the campaign. You use this ID when you delete the campaign or get the campaign.

String

HTTP response codes

Status Code Name Description

201

Created

The campaign was successfully created.

400

Bad Request

The request is malformed or is missing one or more required parameters.

401

Unauthorized

The access token is missing, expired, or invalid.

403

Forbidden

The access token is valid, but the user doesn't have the needed LWA scope permissions.

429

Too Many Requests

Request has been throttled.

500

Internal Server Error

The request couldn't be handled because of an internal service error.

503

Service Unavailable

Service is temporarily unavailable.

List campaigns

Lists the campaigns you've created.

Request format

GET /v1/proactive/campaigns?maxResults={maxResults}&nextToken={nextToken} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}

Request body format

None.

Request path parameters

Field Description Type Required

maxResults

Maximum number of results to display. The value of this parameter must be between 1 and 10. The default value is 10.

Integer

No

nextToken

Continuation token returned in the response object of the previous response to list campaigns.

String

No

Success response header

Host: {host value used in the request}
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field Description Type Required

X-Amzn-RequestId

Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem.

String

Yes

Response body format

{
   "results": [
      {
         "campaignId": "campaignId",
         "suggestion": {
            "variants": [{
               "placement": {
                  "channel": "HOME"
               },
               "content": {
                  "values": [{
                     "locale": "en-US",
                     "document": {},
                     "datasources": {}
                  }]
               }
            }]          
         },
         "targeting": {
            (polymorphic object of type users or skill subscribers)
         },
         "scheduling": {
            "activationWindow": {
               "start": "2021-01-01T10:00:00.00Z",
               "end": "2021-01-31T10:00:00.00Z"
            }
         },
         "validationStatus": {
            "value": "string enum",   // IN_PROGRESS, APPROVED, or REJECTED
            "reason": "Explanation"
         }
     },
     {
        ... (another campaign and status) ...
     }
   ],
   "paginationContext": {
      "nextToken": "token from previous call"
   }
}

Response body parameters

Field Description Type

results[]

The list of campaigns you created, along with a validation status for each.

Array

results[].campaign

The details you submitted when you created the campaign. For the fields, see the request body format for creating a campaign.

Object

results[].validationStatus

The latest validation status for the campaign.

Object

results[].validationStatus.value

Enum that describes the latest validation status for the campaign. Valid values: IN_PROGRESS, APPROVED, REJECTED.

String

results[].validationStatus.reason

Explanation, if applicable, for the validation status value.

String

paginationContext

Object containing pagination information. If omitted, all evaluation results were already returned.

Object

paginationContext.nextToken

Continuation token that you use in the next call to list campaigns.

String

HTTP response codes

Status Code Name Description

200

Successful

The request was processed successfully.

400

Bad Request

The request is malformed or is missing one or more required parameters.

401

Unauthorized

The access token is missing, expired, or invalid.

403

Forbidden

The access token is valid, but the user doesn't have the needed LWA scope permissions.

429

Too Many Requests

Request has been throttled.

500

Internal Server Error

The request couldn't be handled because of an internal service error.

503

Service Unavailable

Service is temporarily unavailable.

Get a campaign

Retrieves a campaign that you created.

Request format

GET /v1/proactive/campaigns/{campaignId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}

Request body format

None.

Request path parameters

Field Description Type Required

campaignId

The ID of the campaign to retrieve. This value is returned when you create a campaign.

String

Yes

Success response header

Host: {host value used in the request}
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field Description Type Required

X-Amzn-RequestId

Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem.

String

Yes

Response body format

{
   "campaignId": "campaignId",
   "suggestion": {
      "variants": [{
         "placement": {
            "channel": "HOME"
         },
         "content": {
            "values": [{
               "locale": "en-US",
               "document": {},
               "datasources": {}
            }]
         }
      }]  
   },
   "targeting": {
      (polymorphic object of type users or skill subscribers)
   },
   "scheduling": {
      "activationWindow": {
         "start": "2021-01-01T10:00:00.00Z",
         "end": "2021-01-31T10:00:00.00Z"
      }
   },
   "validationStatus": {
      "value": "string enum",   // IN_PROGRESS, APPROVED, or REJECTED
      "reason": "Explanation"
   }
}

Response body parameters

Field Description Type

Campaign information

The details you submitted when you created the campaign. For the fields, see the request body format for creating a campaign.

Object

ValidationStatus

The status of the campaign validation.

Object

validationStatus

The latest validation status for the campaign.

Object

validationStatus.value

The latest validation status for the campaign. Valid values: IN_PROGRESS, APPROVED, REJECTED.

String

validationStatus.reason

Explanation, if applicable, for the validation status value.

String

HTTP response codes

Status Code Name Description

200

Successful

The request was processed successfully.

400

Bad Request

The request is malformed or is missing one or more required parameters.

401

Unauthorized

The access token is missing, expired, or invalid.

403

Forbidden

The access token is valid, but the user doesn't have the needed LWA scope permissions.

404

Not Found

The campaign to delete isn't found.

429

Too Many Requests

Request has been throttled.

500

Internal Server Error

The request couldn't be handled because of an internal service error.

503

Service Unavailable

Service is temporarily unavailable.

Delete a campaign

Deletes a campaign.

Request format

DELETE /v1/proactive/campaigns/{campaignId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {LWA Token}

Request path parameters

Field Description Type Required

campaignId

The ID of the campaign to delete. This value is returned when you create a campaign.

String

Yes

Request body

None.

Success response header

HTTP/1.1 202 OK
Host: {host value used in the request}
X-Amzn-RequestId: {request-id}
Content-Type: application/json
Field Description Type Required

X-Amzn-RequestId

Unique identifier for the request. If a problem occurs, Amazon can use this value to troubleshoot the problem.

String

Yes

Response body

None.

HTTP response codes

Status Code Name Description

202

Accepted

The delete request for the specified campaign has been accepted. The campaign will be deleted, but there's no guarantee that the suggestion wasn't already delivered.

400

Bad Request

The request is malformed or is missing one or more required parameters.

401

Unauthorized

The access token is missing, expired, or invalid.

403

Forbidden

The access token is valid, but the user doesn't have the needed LWA scope permissions.

404

Not Found

The campaign to delete isn't found.

429

Too Many Requests

Request has been throttled.

500

Internal Server Error

The request couldn't be handled because of an internal service error.


Last updated: Apr 01, 2022