

# UpdateAlarmModel
<a name="API_UpdateAlarmModel"></a>

**Important**  
End of support notice: On May 20,2026, AWS will end support for AWS IoT Events. After May 20,2026, you will no longer be able to access the AWS IoT Events console or AWS IoT Events resources. For more information, see [AWS IoT Events end of support](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-end-of-support.html). 

Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created again as new data arrives.

## Request Syntax
<a name="API_UpdateAlarmModel_RequestSyntax"></a>

```
POST /alarm-models/alarmModelName HTTP/1.1
Content-type: application/json

{
   "alarmCapabilities": { 
      "acknowledgeFlow": { 
         "enabled": boolean
      },
      "initializationConfiguration": { 
         "disabledOnInitialization": boolean
      }
   },
   "alarmEventActions": { 
      "alarmActions": [ 
         { 
            "dynamoDB": { 
               "hashKeyField": "string",
               "hashKeyType": "string",
               "hashKeyValue": "string",
               "operation": "string",
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               },
               "payloadField": "string",
               "rangeKeyField": "string",
               "rangeKeyType": "string",
               "rangeKeyValue": "string",
               "tableName": "string"
            },
            "dynamoDBv2": { 
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               },
               "tableName": "string"
            },
            "firehose": { 
               "deliveryStreamName": "string",
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               },
               "separator": "string"
            },
            "iotEvents": { 
               "inputName": "string",
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               }
            },
            "iotSiteWise": { 
               "assetId": "string",
               "entryId": "string",
               "propertyAlias": "string",
               "propertyId": "string",
               "propertyValue": { 
                  "quality": "string",
                  "timestamp": { 
                     "offsetInNanos": "string",
                     "timeInSeconds": "string"
                  },
                  "value": { 
                     "booleanValue": "string",
                     "doubleValue": "string",
                     "integerValue": "string",
                     "stringValue": "string"
                  }
               }
            },
            "iotTopicPublish": { 
               "mqttTopic": "string",
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               }
            },
            "lambda": { 
               "functionArn": "string",
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               }
            },
            "sns": { 
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               },
               "targetArn": "string"
            },
            "sqs": { 
               "payload": { 
                  "contentExpression": "string",
                  "type": "string"
               },
               "queueUrl": "string",
               "useBase64": boolean
            }
         }
      ]
   },
   "alarmModelDescription": "string",
   "alarmNotification": { 
      "notificationActions": [ 
         { 
            "action": { 
               "lambdaAction": { 
                  "functionArn": "string",
                  "payload": { 
                     "contentExpression": "string",
                     "type": "string"
                  }
               }
            },
            "emailConfigurations": [ 
               { 
                  "content": { 
                     "additionalMessage": "string",
                     "subject": "string"
                  },
                  "from": "string",
                  "recipients": { 
                     "to": [ 
                        { 
                           "ssoIdentity": { 
                              "identityStoreId": "string",
                              "userId": "string"
                           }
                        }
                     ]
                  }
               }
            ],
            "smsConfigurations": [ 
               { 
                  "additionalMessage": "string",
                  "recipients": [ 
                     { 
                        "ssoIdentity": { 
                           "identityStoreId": "string",
                           "userId": "string"
                        }
                     }
                  ],
                  "senderId": "string"
               }
            ]
         }
      ]
   },
   "alarmRule": { 
      "simpleRule": { 
         "comparisonOperator": "string",
         "inputProperty": "string",
         "threshold": "string"
      }
   },
   "roleArn": "string",
   "severity": number
}
```

## URI Request Parameters
<a name="API_UpdateAlarmModel_RequestParameters"></a>

The request uses the following URI parameters.

 ** [alarmModelName](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-uri-alarmModelName"></a>
The name of the alarm model.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^[a-zA-Z0-9_-]+$`   
Required: Yes

## Request Body
<a name="API_UpdateAlarmModel_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [alarmCapabilities](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-alarmCapabilities"></a>
Contains the configuration information of alarm state changes.  
Type: [AlarmCapabilities](API_AlarmCapabilities.md) object  
Required: No

 ** [alarmEventActions](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-alarmEventActions"></a>
Contains information about one or more alarm actions.  
Type: [AlarmEventActions](API_AlarmEventActions.md) object  
Required: No

 ** [alarmModelDescription](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-alarmModelDescription"></a>
The description of the alarm model.  
Type: String  
Length Constraints: Maximum length of 1024.  
Required: No

 ** [alarmNotification](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-alarmNotification"></a>
Contains information about one or more notification actions.  
Type: [AlarmNotification](API_AlarmNotification.md) object  
Required: No

 ** [alarmRule](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-alarmRule"></a>
Defines when your alarm is invoked.  
Type: [AlarmRule](API_AlarmRule.md) object  
Required: Yes

 ** [roleArn](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-roleArn"></a>
The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the * AWS General Reference*.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

 ** [severity](#API_UpdateAlarmModel_RequestSyntax) **   <a name="iotevents-UpdateAlarmModel-request-severity"></a>
A non-negative integer that reflects the severity level of the alarm.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 2147483647.  
Required: No

## Response Syntax
<a name="API_UpdateAlarmModel_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "alarmModelArn": "string",
   "alarmModelVersion": "string",
   "creationTime": number,
   "lastUpdateTime": number,
   "status": "string"
}
```

## Response Elements
<a name="API_UpdateAlarmModel_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [alarmModelArn](#API_UpdateAlarmModel_ResponseSyntax) **   <a name="iotevents-UpdateAlarmModel-response-alarmModelArn"></a>
The ARN of the alarm model. For more information, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the * AWS General Reference*.  
Type: String

 ** [alarmModelVersion](#API_UpdateAlarmModel_ResponseSyntax) **   <a name="iotevents-UpdateAlarmModel-response-alarmModelVersion"></a>
The version of the alarm model.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.

 ** [creationTime](#API_UpdateAlarmModel_ResponseSyntax) **   <a name="iotevents-UpdateAlarmModel-response-creationTime"></a>
The time the alarm model was created, in the Unix epoch format.  
Type: Timestamp

 ** [lastUpdateTime](#API_UpdateAlarmModel_ResponseSyntax) **   <a name="iotevents-UpdateAlarmModel-response-lastUpdateTime"></a>
The time the alarm model was last updated, in the Unix epoch format.  
Type: Timestamp

 ** [status](#API_UpdateAlarmModel_ResponseSyntax) **   <a name="iotevents-UpdateAlarmModel-response-status"></a>
The status of the alarm model. The status can be one of the following values:  
+  `ACTIVE` - The alarm model is active and it's ready to evaluate data.
+  `ACTIVATING` - AWS IoT Events is activating your alarm model. Activating an alarm model can take up to a few minutes.
+  `INACTIVE` - The alarm model is inactive, so it isn't ready to evaluate data. Check your alarm model information and update the alarm model.
+  `FAILED` - You couldn't create or update the alarm model. Check your alarm model information and try again.
Type: String  
Valid Values: `ACTIVE | ACTIVATING | INACTIVE | FAILED` 

## Errors
<a name="API_UpdateAlarmModel_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalFailureException **   
An internal failure occurred.    
 ** message **   
The message for the exception.
HTTP Status Code: 500

 ** InvalidRequestException **   
The request was invalid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** ResourceInUseException **   
The resource is in use.    
 ** message **   
The message for the exception.
HTTP Status Code: 409

 ** ResourceNotFoundException **   
The resource was not found.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is currently unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The request could not be completed due to throttling.    
 ** message **   
The message for the exception.
HTTP Status Code: 429

## See Also
<a name="API_UpdateAlarmModel_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iotevents-2018-07-27/UpdateAlarmModel) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iotevents-2018-07-27/UpdateAlarmModel) 