diff --git a/notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java b/notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java index ff7c1d59..dd6c8141 100644 --- a/notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java +++ b/notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java @@ -153,7 +153,7 @@ public String getResponseString(CloseableHttpResponse response) throws IOExcepti private void validateResponseStatus(HttpResponse response) throws IOException { int statusCode = response.getStatusLine().getStatusCode(); - if (statusCode != RestStatus.OK.getStatus()) { + if (!(statusCode == RestStatus.OK.getStatus() || statusCode == RestStatus.CREATED.getStatus())) { throw new IOException("Failed: " + response); } }