Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Create a Synthetic via API with emails attribute

synthetics
api

#1

I’m trying to create a Synthetic via API call, with an email attribute to receive alerts if the check fails.

I added the following to the payload for the cURL call documented here.

\"emails\" : [ "myemail@example.com" ],

Which I thought would work because the emails attribute is supposedly supported per this.

But, no. “Monitor creation failed”

What am I missing? (The create call works fine without that field.)


#2

Hi, @wyatt.andersen: The following curl command worked for me:

curl \
   -X POST -H 'X-Api-Key: MY_ADMIN_KEY' \
   -H 'Content-Type: application/json' https://synthetics.newrelic.com/synthetics/api/v3/monitors \
   -d '{ "name" : "Test", "frequency" : 60, "uri" : "https://www.example.com/", "locations" : [ "AWS_US_WEST_1" ], "type" : "SIMPLE", "status" : "enabled", "slaThreshold" : "1.0", "emails" : [ "myemail@example.com" ] }' 

Assuming you are using an admin API key, the only difference I see is that I did not escape the quotes around "emails".