How to create an email alerting destination using API?


I have created email_account (for sending) and email_group (for receiving) using the below APIs;

POST _opendistro/_alerting/destinations/email_accounts
POST _opendistro/_alerting/destinations/email_groups

I have tried using Kibana UI, to create alerting destination by going to Alerting > Destinations > Create destination. But, after clicking “Create” button, nothing is happening, the button will stay inactive for a while and then comes back to active, without doing anything. So, I decided to use API to create destination.

Here, its documented how to create slack and webhook destinations using API. Somebody please tell me how to create email destination using API, by providing Name, Type, Sender, and Recipients.

Thanks in advance.

Hi @elasticheart,

Which version of Alerting/Alerting Kibana are you using?

I’d like to validate the destination creation through the Kibana UI, if that’s not working, it would be a bug.

As for the documentation, perhaps it would be helpful to have an example of each destination in the Create destination section.

In the meantime, here is an example of how to create an email Destination through the API (this example has both an email_group and separate email as its recipients).

POST _opendistro/_alerting/destinations
  "type": "email",
  "name": "my-email-destination",
  "email": {
    "email_account_id": "YjY7mXMBx015759_IcfW",
    "recipients": [
        "type": "email_group",
        "email_group_id": "YzY-mXMBx015759_dscs"
        "type": "email",
        "email": ""

The email_account_id and email_group_id will be the document IDs of the email_account and email_group you have created.

Hi @qreshi,
I’m using 1.11.0 version of alerting i am able to create email destination, how ever is there a way we can pass the ‘Content-Type: test/html’ using API.

I would like to get my alerts in a table format. I tried using mustache with html tags but still i see the text as is which is not rendering to html format.

Any suggestion would be appreciated. Thanks!