Alexa.SecurityPanelController.ErrorResponse Events

If Alexa sends an Alexa.SecurityPanelController directive to your skill and you can't handle it successfully, respond with an Alexa.SecurityPanelController.ErrorResponse event. For more information, see Alexa.SecurityPanelController Interface.

ErrorResponse event

In the payload for the Alexa.SecurityPanelController.ErrorResponse, specify the type of the error and include a message with information about the error. For the list of Alexa.SecurityPanelController error types, see Error type values.

ErrorResponse event payload details

Field Description Type Required
type The type of error. Alexa shares this with the customer. String Yes
message The error message for the error. Alexa does not share this with the customer. String Yes

ErrorResponse event format

Copied to clipboard.

{
"event": {
    "header": {
      "namespace": "Alexa.Health",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "1"
    },
    "payload": {
      "type": "<error type>",
      "message": "<error message>"
    }
  }
}

Error type values

The following table shows the valid Alexa.SecurityPanelController error type values.

Value Description
AUTHORIZATION_REQUIRED The current state of the security system is ARMED_AWAY, and the user tries to re-arm the system as ARMED_STAY or ARMED_NIGHT. See an example here. For more information, see arming a security system.
BYPASS_NEEDED The security panel has open zones that the user must bypass before you can arm the security system. If you want users to bypass errors by using voice commands, include a list of the endpoints that need bypassing in the endpointsNeedingBypass field in the payload of your error response. Specify the friendly name for each endpoint so that Alexa can say it to the user. Include the endpointId for sensors that implement the Alexa.ContactSensor and Alexa.MotionSensor interfaces. If you don't include a list of endpoints in the payload of your error response, Alexa tells the user to bypass manually. See an example here. For more information, see bypass by voice option.
NOT_READY The security panel is not ready for arming and disarming. Use this error type when a user tries to control the security panel while it's in installation mode.
UNAUTHORIZED The PIN code is not correct.
UNCLEARED_ALARM The security panel has an active alarm and the user tries to arm it. See an example here.
UNCLEARED_TROUBLE The security panel has a trouble condition.

In addition to the Alexa.SecurityPanelController error types, you can also use Alexa error types. For more information, see Alexa.ErrorResponse error type values.

Examples

Synchronous response example

The following is an example error response that you send synchronously to Alexa. For the list of Alexa.SecurityPanelController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.SecurityPanelController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "3"
    },
    "endpoint":{
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "UNAUTHORIZED",
      "message": "The PIN code is not correct."
    }
  }
}

Asynchronous response example

The following is an example error response that you send asynchronously to the Alexa event gateway. If you respond asynchronously, include a correlation token and a scope with an authorization token. For more information, see Send Events to the Event Gateway.

For the list of Alexa.SecurityPanelController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.SecurityPanelController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint":{
      "scope":{
        "type":"BearerToken",
        "token":"access-token-from-Amazon"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "UNAUTHORIZED",
      "message": "The PIN code is not correct."
    }
  }
}

AUTHORIZATION_REQUIRED

The following is an example error response for the AUTHORIZATION_REQUIRED error type. Use this error type when the user attempts to switch directly from ARMED_AWAY to ARMED_NIGHT or ARMED_STAY without disarming the system first. For more information, see arming a security system.

For the list of Alexa.SecurityPanelController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.SecurityPanelController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
          "type": "BearerToken",
          "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "AUTHORIZATION_REQUIRED",
      "message": "You must disarm the system before you can set the requested arm state."
    }
  }
}

BYPASS_NEEDED

The following is an example error response for the BYPASS_NEEDED error type. Use this error type when there are open zone errors and the user must bypass the errors to arm the system. In this example you provide a list of endpoints that need to be bypassed, which enables the user to bypass the errors by voice. For more information, see bypass by voice option.

For the list of Alexa.SecurityPanelController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.SecurityPanelController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
          "type": "BearerToken",
          "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "BYPASS_NEEDED",
      "message": "Unable to arm the security panel because there are open sensors.",
      "endpointsNeedingBypass": [
        {
          "friendlyName": "side window sensor", 
          "endpointId": "<endpoint id>"
        },
        {
          "friendlyName": "front door sensor", 
          "endpointId": "<endpoint id>"
        },
        {
          "friendlyName": "water sensor"
        }
      ]
    }
  }
}

UNCLEARED_ALARM

The following is an example error response for the UNCLEARED_ALARM error type. Use this error type when the user attempts to arm a security system that is in an active alarm state. For the list of Alexa.SecurityPanelController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.SecurityPanelController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
          "type": "BearerToken",
          "token": "<an OAuth2 bearer token>"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "UNCLEARED_ALARM",
      "message": "Unable to arm or disarm the security panel because it is in alarm status."
    }
  }
}