---
title: "POST /analysis/detector-models/"
method: POST
path: "/analysis/detector-models/"
---

# POST /analysis/detector-models/

`POST /analysis/detector-models/`

Performs an analysis of your detector model. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-analyze-api.html">Troubleshooting a detector model</a> in the <i>AWS IoT Events Developer Guide</i>.

## Request body

- object
  - `detectorModelDefinition` object, required — Information that defines how a detector operates.
    - `states` State[] — Information about the states of the detector.
      - `stateName` string, required — The name of the state.
      - `onInput` object — When an input is received and the <code>condition</code> is TRUE, perform the specified <code>actions</code>.
        - `events` Event[] — Specifies the actions performed when the <code>condition</code> evaluates to TRUE.
          - `eventName` string, required — The name of the event.
          - `condition` string — Optional. The Boolean expression that, when TRUE, causes the <code>actions</code> to be performed. If not present, the actions are performed (=TRUE). If the expression result is not a Boolean value, the actions are not performed (=FALSE).
          - `actions` Action[] — The actions to be performed.
            - `setVariable` object — Sets a variable to a specified value.
              - …
            - `sns` object — Sends an Amazon SNS message.
              - …
            - `iotTopicPublish` object — Publishes an MQTT message with the given topic to the AWS IoT message broker.
              - …
            - `setTimer` object — Information needed to set the timer.
              - …
            - `clearTimer` object — Information needed to clear the timer.
              - …
            - `resetTimer` object — Information needed to reset the timer.
              - …
            - `lambda` object — Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action.
              - …
            - `iotEvents` object — Sends AWS IoT Events input, which passes information about the detector model instance and the event that triggered the action.
              - …
            - `sqs` object — Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.
              - …
            - `firehose` object — Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.
              - …
            - `dynamoDB` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `dynamoDBv2` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. A separate column of the DynamoDB table receives one attribute-value pair in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `iotSiteWise` object — Sends information about the detector model instance and the event that triggered the action to an asset property in AWS IoT SiteWise .
              - …
        - `transitionEvents` TransitionEvent[] — Specifies the actions performed, and the next state entered, when a <code>condition</code> evaluates to TRUE.
          - `eventName` string, required — The name of the transition event.
          - `condition` string, required — Required. A Boolean expression that when TRUE causes the actions to be performed and the <code>nextState</code> to be entered.
          - `actions` Action[] — The actions to be performed.
            - `setVariable` object — Sets a variable to a specified value.
              - …
            - `sns` object — Sends an Amazon SNS message.
              - …
            - `iotTopicPublish` object — Publishes an MQTT message with the given topic to the AWS IoT message broker.
              - …
            - `setTimer` object — Information needed to set the timer.
              - …
            - `clearTimer` object — Information needed to clear the timer.
              - …
            - `resetTimer` object — Information needed to reset the timer.
              - …
            - `lambda` object — Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action.
              - …
            - `iotEvents` object — Sends AWS IoT Events input, which passes information about the detector model instance and the event that triggered the action.
              - …
            - `sqs` object — Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.
              - …
            - `firehose` object — Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.
              - …
            - `dynamoDB` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `dynamoDBv2` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. A separate column of the DynamoDB table receives one attribute-value pair in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `iotSiteWise` object — Sends information about the detector model instance and the event that triggered the action to an asset property in AWS IoT SiteWise .
              - …
          - `nextState` string, required — The next state to enter.
      - `onEnter` object — When entering this state, perform these <code>actions</code> if the <code>condition</code> is TRUE.
        - `events` Event[] — Specifies the actions that are performed when the state is entered and the <code>condition</code> is <code>TRUE</code>.
          - `eventName` string, required — The name of the event.
          - `condition` string — Optional. The Boolean expression that, when TRUE, causes the <code>actions</code> to be performed. If not present, the actions are performed (=TRUE). If the expression result is not a Boolean value, the actions are not performed (=FALSE).
          - `actions` Action[] — The actions to be performed.
            - `setVariable` object — Sets a variable to a specified value.
              - …
            - `sns` object — Sends an Amazon SNS message.
              - …
            - `iotTopicPublish` object — Publishes an MQTT message with the given topic to the AWS IoT message broker.
              - …
            - `setTimer` object — Information needed to set the timer.
              - …
            - `clearTimer` object — Information needed to clear the timer.
              - …
            - `resetTimer` object — Information needed to reset the timer.
              - …
            - `lambda` object — Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action.
              - …
            - `iotEvents` object — Sends AWS IoT Events input, which passes information about the detector model instance and the event that triggered the action.
              - …
            - `sqs` object — Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.
              - …
            - `firehose` object — Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.
              - …
            - `dynamoDB` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `dynamoDBv2` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. A separate column of the DynamoDB table receives one attribute-value pair in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `iotSiteWise` object — Sends information about the detector model instance and the event that triggered the action to an asset property in AWS IoT SiteWise .
              - …
      - `onExit` object — When exiting this state, perform these <code>actions</code> if the specified <code>condition</code> is <code>TRUE</code>.
        - `events` Event[] — Specifies the <code>actions</code> that are performed when the state is exited and the <code>condition</code> is <code>TRUE</code>.
          - `eventName` string, required — The name of the event.
          - `condition` string — Optional. The Boolean expression that, when TRUE, causes the <code>actions</code> to be performed. If not present, the actions are performed (=TRUE). If the expression result is not a Boolean value, the actions are not performed (=FALSE).
          - `actions` Action[] — The actions to be performed.
            - `setVariable` object — Sets a variable to a specified value.
              - …
            - `sns` object — Sends an Amazon SNS message.
              - …
            - `iotTopicPublish` object — Publishes an MQTT message with the given topic to the AWS IoT message broker.
              - …
            - `setTimer` object — Information needed to set the timer.
              - …
            - `clearTimer` object — Information needed to clear the timer.
              - …
            - `resetTimer` object — Information needed to reset the timer.
              - …
            - `lambda` object — Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action.
              - …
            - `iotEvents` object — Sends AWS IoT Events input, which passes information about the detector model instance and the event that triggered the action.
              - …
            - `sqs` object — Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.
              - …
            - `firehose` object — Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.
              - …
            - `dynamoDB` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `dynamoDBv2` object — Writes to the DynamoDB table that you created. The default action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. You can customize the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_Payload.html">payload</a>. A separate column of the DynamoDB table receives one attribute-value pair in the payload that you specify. For more information, see <a href="https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-event-actions.html">Actions</a> in <i>AWS IoT Events Developer Guide</i>.
              - …
            - `iotSiteWise` object — Sends information about the detector model instance and the event that triggered the action to an asset property in AWS IoT SiteWise .
              - …
    - `initialStateName` string — The state that is entered at the creation of each detector (instance).

## Response `200`

Success

- StartDetectorModelAnalysisResponse
  - `analysisId` string — The ID that you can use to retrieve the analysis result.

## Other responses

- `480` — InvalidRequestException
- `481` — LimitExceededException
- `482` — ThrottlingException
- `483` — InternalFailureException
- `484` — ServiceUnavailableException

---

[API](https://skmtc.net/aws/apis/iotevents.md) · [All operations](https://skmtc.net/aws/apis/iotevents/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iotevents/versions/d3ae7b052b1d/schema)
