Skill Package Management REST API Reference
Use the Skill Package Management REST API to import and export a skill package to a skill.
A skill package contains resources that describe the skill, such as the skill manifest. Based on the skill type, the skill package might contain other features, such as a custom voice interaction model, in-skill products, and image assets. For details about the layout of the skill package, see Skill package format.
To create and import a skill by using the skill package format, take the following steps.
- Organize your skill components as shown in the skill package format diagram, and then zip the top-level folder.
- Create an upload URL to Amazon S3.
Or, if you upload your skill package to a publicly-accessible URL, skip this step. - Upload the zip file to Amazon S3 or to a publicly-accessible URL.
- If you want to create a new skill and upload the skill package, call Create and import skill package.
- If you want to import the uploaded skill package to an existing skill, call Import skill package.
To update an existing skill, call Export skill package, edit the skill package locally, and then import the updated package by using the preceding steps.
API endpoint
The endpoint of the Skill Package Management API is https://api.amazonalexa.com
.
Authentication
Each API request must have an authorization header whose value is the access token retrieved from Login with Amazon (LWA). For details, see Get an Access Token for SMAPI.
Operations
The Skill Package Management API includes the following operations.
Operation | HTTP method and URI |
---|---|
| |
| |
| |
| |
| |
|
Create and import skill package
Create a new skill, and then import the skill package at the specified location to the new skill.
Request
To create a skill and import a skill package, you make a POST
request to the imports
resource.
Request path and header example
POST /v1/skills/imports
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes |
Request body example
{
"location": "https://example.com/skillPackage",
"vendorId": "your.vendor.id.1"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
URL to the skill package location. Valid values: Amazon S3 URL or any publicly accessible URL. |
String |
Yes |
|
Identifies the vendor to which the skill belongs. |
String |
No |
Response
A successful response returns HTTP 202 Accepted
, along with a Location
in the header that contains the import ID.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Request to create and import a new skill package succeeded.
|
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create upload URL
Create a presigned URL to Amazon S3. Then, upload your skill package zip file to S3 by using one of the following methods:
- Send an HTTP
PUT
request to the presigned URL that you receive in the response. - Use an Amazon Web Services SDK. For more details, see Uploading Objects Using Presigned URLs.
If you upload your skill package to a publicly accessible URL, you can skip this API.
Request
To create a URL to S3, you make a POST
request to the uploads
resource.
Request path and header example
POST /v1/skills/uploads
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 201 Created
.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
{
"uploadUrl": "https://example.com/skillPackage",
"expiresAt": "2018-10-11T19:28:34.525Z"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Presigned URL to the S3 bucket location where you can upload your skill package. |
String |
|
Time the URL expires. |
String |
HTTP status codes
Status | Description |
---|---|
|
URL created successfully. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Export skill package
Export an existing skill package to the specified location.
Request
To export a skill package, you make a POST
request to the exports
resource.
Request path and header example
POST /v1/skills/{skillId}/stages/{stage}/exports
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the skill. |
String |
Yes |
|
Path |
Indicates stage of the skill. |
String |
Yes |
|
Header |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 202 Accepted
, along with a Location
in the header that contains the export ID.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Request to export a new skill package succeeded.
|
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Import skill package
Import an existing skill package to the specified location.
eTag
to prevent accidental overwriting.Get the latest skill package
Sometimes, you might want to avoid overwriting an existing skill. For example, consider the following scenario in which a graphic designer and a developer work on the same skill simultaneously:
- The graphic designer and the developer each use the
Import skill package
API to export separate copies of the skill to their own laptops. - The graphic designer adds new images to the skill package, and then uses the
Import skill package
API to upload and import the skill package to the existing skill. - The developer updates the interaction model, adds a new in-skill product, and then uses the
Import skill package
API to upload and import the skill package to the existing skill. This import overwrites the changes that the graphic designer made because the developer didn't have these changes in their local copy of the skill package.
To avoid this scenario, use the eTag
opaque version identifier for a skill package. You get the latest eTag
in the Get export status and Get import status responses.
The following example shows how eTag
prevent overwriting:
- The graphic designer and the developer each use the
Export skill package
API to export separate copies of the skill to their own laptops. They each save theeTag
value and the skill package .zip file. - The graphic designer adds new images to the skill package, and then imports the skill package to the existing skill. The
Import skill package
request includes theeTag
value in the HTTP header. The value matches the server-sideeTag
value for the skill package and the import request succeeds. The server creates a neweTag
value for this latest version of the skill package. - The developer updates the custom interaction model, adds a new in-skill product, and then imports the updated skill package to the existing skill. The
Import skill package
request includes theeTag
value in the HTTP header, which doesn't match the server-sideeTag
value for the skill package. As a result, the import request fails. - The developer exports the skill package to obtain the latest version and the corresponding
eTag
value. This version includes the previous updates that the graphic designer made. - The developer compares their local changes to the latest version, and then reconciles the differences.
- The developer uses the imports the skill package to the existing skill. The
Import skill package
request includes theeTag
value. The value matches the server-sideeTag
value for the skill package and the import request succeeds.
About in-skill product updates
The existence of in-skill products in the isps.json
file determines how the import request associates products with your skill.
- When the
isps.json
file containsisps
orassociations
that are new, the products are created and linked accordingly. - When the
isps.json
file contains updates toisps
that previously existed in the skill package, the product definitions are updated. - When the
isps.json
file omitsassociations
that existed in the skill package previously, the products still exist but are no longer linked to your skill.
If you don't want the import to take these actions, you can omit the isps
folder from the skill package, and continue to manage in-skill products separately.
Request
To import a skill package, you make a POST
request to the imports
resource.
Request path and header example
POST /v1/skills/{skillId}/imports
Host: api.amazonalexa.com
Content-Type: application/json
If-Match: {eTag}
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the skill. |
String |
Yes |
|
Header |
Identifies the current version of the skill package. Include to avoid overwriting other imported changes after you last exported the skill package. |
String |
No |
|
Header |
String |
Yes |
Request body example
{
"location": "https://example.com/skillPackage"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
URL to the skill package location.
Valid values: Amazon S3 URL from |
String |
Yes |
Response
A successful response returns HTTP 202 Accepted
, along with a Location
in the header that contains the import ID.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Request to import a new skill package succeeded.
|
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get export status
Get the status of a previously requested export. Use the exportId
from the Location
header of the Export skill package
response.
Request
To get the export status, you make a GET
request to the exports
resource.
Request path and header example
GET /v1/skills/exports/{exportId}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the export request for which you want the status. |
String |
Yes |
|
Header |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the export status and URL to the skill package zip file.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
{
"status": "SUCCEEDED",
"skill": {
"expiresAt": "1550521786056",
"location": "https://example.com/skillPackage",
"eTag": "token.1"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
Identifies the status of the export. |
String |
|
Description |
Object |
|
Time in milliseconds until the URL expires. |
String |
|
(Optional) URL to download the skill package zip file. |
String |
|
Opaque token that identifies the current version of the skill package. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the export status and URL to the skill package zip file. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get import status
Get the status of a previously requested import. Use the importId
from the Location
header of the Import skill package
response.
Request
To get the import status, you make a GET
request to the import
resource.
Request path and header example
GET /v1/skills/import/{importId}
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the import request for which you want the status. |
String |
Yes |
|
Header |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the import status and URL to the skill package zip file.
On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.
Response body example
{
"status": "SUCCEEDED",
"skill": {
"expiresAt": "1550521786056",
"location": "https://example.com/skillPackage",
"eTag": "token.1"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
Identifies the status of the import. |
String |
|
Description |
Object |
|
Time in milliseconds until the URL expires. |
String |
|
(Optional) URL to download the skill package zip file. |
String |
|
Opaque token that identifies the current version of the skill package. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the import status and URL to the skill package zip file. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off. |
|
Error occurred on the server. Retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Skill package format
A skill package file combines all the skill components into a zipped file with a .zip
extension. If you manage with your skill through the Alexa developer console, these components exist behind the scenes. If you interact with your skill through the Alexa Skills Kit Command Line Interface (ASK CLI) or the Skill Management REST APIs, you see these components as individual files.
The skill package has the following organization.
SkillPackageName.zip
├── assets
│ └── images
│ ├── en-US_largeIcon.png
│ ├── en-US_smallIcon.png
│ ├── isp1
│ │ ├── en-US_largeIcon.png
│ │ └── en-US_smallIcon.png
│ └── isp2
│ ├── en-US_largeIcon.png
│ └── en-US_smallIcon.png
├── interactionModels
│ └── custom
│ └── en-US.json
├── isps
│ ├── isps.json
│ ├── isp1.json
│ └── exampleDirectory
│ └── isp2.json
└── skill.json
Folder or file | Description | Required |
---|---|---|
|
Skill manifest file that contains metadata about the skill, including the display name, skill capabilities (video, smart home, custom), and the endpoint for the skill service code, either AWS Lambda or a web endpoint. For details, see skill manifest schema. |
Yes |
|
Folder that contains images associated with your skill, appearing as icons in the Alexa Skills Store or your in-skill products. |
No |
|
Folder that contains definition for a custom voice interaction model, such as invocation name, intents, and slots. The folder contains one model file for each locale that the skill supports, such as |
No |
|
Folder that contains the in-skill products that users can purchase in your skill. They specify the type of purchase and other details, such as pricing. You can add files that define in-skill products to link to the skill. For more details about the files in the |
No |
Your skill might also contain other folders, such as account linking. You can still import and export the skill package, but use the appropriate REST APIs to manage these files.
Related topics
- Create and Manage Skills in the Alexa Developer Console
- Skill Manifest Schema
- Skill Manifest REST API Reference
- Resource Schema REST API Reference
Last updated: Aug 08, 2024