Add Events to Your Skill

When you develop a skill with ASK CLI (Alexa Skills Kit Command Line Interface), you can modify the skill schema to include event subscriptions that allow you to build richer skill and external app experiences. For more details about events, see Skill Events and List Events.

All skill models—custom skills, smart home skills, and so on—support skill events.

To add events to an existing skill, follow these instructions. Otherwise, to create a new list skill directly from ASK CLI, see Steps to Create a List Skill. You can view sample code for a skill with skill and list events.

The following instructions apply to both custom skills and list skills.

A custom skill manifest can include skill events if updated in this manner.

A list skill manifest has two possible formats:

  • A skill manifest for a custom skill, including events, plus an additional householdList field in the apis object.
  • A skill manifest that includes a householdList field, but no custom object in the apis object, and no interaction model.

For an example that shows how to include code in your skill service to handle events, see the List Events Demo on GitHub.

Install the ASK CLI

Before you can update your skill definition, you need to install ASK CLI. For details, see Quick Start Alexa Skills Kit Command Line Interface for installation instructions.

Update your skill definition to include events

After you complete the ASK CLI installation and initialization, you can update your skill definition for any of your existing skills as follows.

  1. Download your existing skill manifest by using the get-skill-manifest command.

    ask smapi get-skill-manifest -s {skillId} -g {development|certified|live} > skill.json

  2. Update the skill.json file to include the events object. For details, see Skill Manifest.

  3. If necessary for your skill, add the permissionInfo object, using the appropriate scopes for your skill. For details, see Skill Manifest.

  4. Update your skill definition by using the update-skill-manifest command.

    ask smapi update-skill-manifest -s {skillId} -g {development|certified|live} --manifest skill.json