Clone a Skill Locale

You use this API to clone existing locale assets of a custom skill and re-use them for development. After cloning the assets, you use them as a starting point to configure a new locale in the same language.

The endpoint of the API is https://api.amazonalexa.com. Each API request must have an Authorization header whose value is the access token retrieved from Login with Amazon.

Create a new clone locale workflow

Creates a new clone-locale workflow for a skill. In a single workflow, you can clone a locale to multiple target locales. However, you can't run multiple workflows in parallel – only a single workflow can run at the same time. For more details on skill cloning, see Clone a skill locale or the associated CLI command references.

Request

POST /v1/skills/{skillId}/stages/{stageV2}/cloneLocale

Request parameters

Field Description Parameter Type Required?
skillId The unique identifier of the skill. Path Yes
stageV2 The publishing stage of your skill.
Accepted value: development
Path Yes

Request body structure

The following example illustrates the structure of the response body.

{
  "sourceLocale": "en-US",
  "targetLocales": [
    "en-CA"
  ],
  "overwriteMode": "DO_NOT_OVERWRITE"
}

Request body parameters

Field Description Parameter Type Required?
sourceLocale Locale of the cloned assets. String Yes
targetLocales A List of locales where the sourceLocale copy to. List Yes
overwriteMode Determines if a skill locale can be overwritten. Possible values: DO_NOT_OVERWRITE,OVERWRITE.
Default value: DO_NOT_OVERWRITE.
String No

Response

HTTP/1.1 200 OK

Response fields

Field Description Parameter Type
Location Returns a relative URL to track the progress of the clone workflow. String

Get status of cloned locale

Returns the status of an in-progress clone locale workflow. For more details on skill cloning, see Clone a skill locale or the associated CLI command references.

Request

GET ​/v1​/skills​/{skillId}​/stages​/{stageV2}​/cloneLocaleRequests​/{cloneLocaleRequestId}

Request parameters

Field Description Parameter Type Required?
skillId The unique identifier of the skill. Path Yes
stageV2 The publishing stage of your skill.
Accepted value: development
Path Yes
cloneLocaleRequestId Identifier for a clone locale workflow. If set to ~latest, the request returns the status of the latest clone locale workflow. String Yes

Response

HTTP/1.1 200 OK

Response body structure

The following example illustrates the structure of the response body.

{
    "error": [
        {
            "validationDetails": {
                "reason": {
                    "allowedStages": [
                        "development"
                    ],
                    "type": "OPERATION_NOT_ALLOWED",
                    "resource": {
                        "stage": "development",
                        "name": "locale"
                    }
                },
                "originalInstance": {
                    "type": "QUERY_PARAMETER",
                    "value": "false",
                    "name": "overwriteMode"
                }
            },
            "code": "OPERATION_NOT_ALLOWED",
            "message": "Resource \"locale\" is not allowed to be overwritten."
        }
    ],
    "sourceLocale": "en-US",
    "status": "INELIGIBLE",
    "targetLocales": {
        "en-IN": {
            "error": [
                {
                    "validationDetails": {
                        "reason": {
                            "allowedStages": [
                                "development"
                            ],
                            "type": "OPERATION_NOT_ALLOWED",
                            "resource": {
                                "stage": "development",
                                "name": "locale"
                            }
                        },
                        "originalInstance": {
                            "type": "QUERY_PARAMETER",
                            "value": "false",
                            "name": "overwriteMode"
                        }
                    },
                    "code": "OPERATION_NOT_ALLOWED",
                    "message": "Resource \"locale\" is not allowed to be overwritten."
                }
            ],
            "status": "INELIGIBLE"
        },
        "en-GB": {
            "error": [
                {
                    "validationDetails": {
                        "reason": {
                            "allowedStages": [
                                "development"
                            ],
                            "type": "OPERATION_NOT_ALLOWED",
                            "resource": {
                                "stage": "development",
                                "name": "locale"
                            }
                        },
                        "originalInstance": {
                            "type": "QUERY_PARAMETER",
                            "value": "false",
                            "name": "overwriteMode"
                        }
                    },
                    "code": "OPERATION_NOT_ALLOWED",
                    "message": "Resource \"locale\" is not allowed to be overwritten."
                }
            ],
            "status": "INELIGIBLE"
        }
    }
}

Response body fields

Field Description Parameter Type
Error List of standardized error codes List
Status Status of a locale clone request.
Possible values: FAILED, INELIGIBLE, IN_PROGRESS, MIXED, ROLLBACK_FAILED, ROLLBACK_SUCCEEDED, SUCCEEDED
String
sourceLocale Locale of the cloned assets. String
targetLocales The returned target locales statuses. Includes an error list if the status is INELIGIBLE. Map
Status Description  
IN_PROGRESS Clone is still in progress. String
SUCCEEDED Source locale cloned to all target locales. String
INELIGIBLE Source locale ineligible to clone to all target locales. String
MIXED More than one status exists for multiple clones. See the individual target locale statues for more details. String
FAILED Source locale clone failed due to internal service issues. String
ROLLBACK_SUCCEEDED Skill rollback successful. String
ROLLBACK_FAILED Skill rollback attempted, but failed. String

Error codes

Error Code Description
2XX Success. The clone-locale operation started.
4XX Validation error. An error occurred before the clone-locale operation started.
5XX System error. An error occurred before the clone-locale operation started.
HTTP/1.1 400 Bad Request
HTTP/1.1 401 Unauthorized
HTTP/1.1 403 Forbidden
HTTP/1.1 404 Not Found
HTTP/1.1 409 Conflict with the target resource
HTTP/1.1 429 Too Many Requests
HTTP/1.1 500 Internal Server Error
HTTP/1.1 503 Service Unavailable