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

My below python script for synthetics api fails with 500



import json
import requests

API_KEY = ‘11111111’

def main():

def create_monitors():
header = {
‘X-Api-Key’: API_KEY,
‘Content-Type’: “application/json”

data = {
“name”: “Google”,
“uri”: “”,
“type”: “SIMPLE”,
“frequency”: 15,
“slaThreshold”: 7.0,
“status”: “ENABLED”,
“locations”: [
“options”: {
“validationString”: “”,
“verifySSL”: False,
“bypassHEADRequest”: True,
“treatRedirectAsFailure” : False

response =’, headers=header, data=json.dumps(data))


#monitors = json.loads(response.content)

return response.headers

if name == “main”:



It looks like the private locations you included in your payload are not the private location ids. If the locations are not recognized this endpoint will return a 500.

Private location ids follow the format of <account-number>-<sanitized-location-name>-<unique chars>. You can find the ids of your private locations in the UI by going to the edit view of the private location, or using the locations endpoint of the REST API: