Add labels/tags to synthetic monitors (deprecated)

DEPRECATED

On July 20, 2020, our tagging implementation replaced labels, which means that using the REST API for labels/tags is deprecated. For more information on this change, see this Explorers Hub post. To learn how to use tags, see Tags.

You can make API calls for synthetic monitors or for monitor labels. These examples show curl commands.

Requirements

The use of the REST API for labels/tags is deprecated. For current recommendations for how to add tags, see Tags.

You can user the user key to make Synthetics REST API calls. The account's REST API key will not work.

API examples

The Synthetics REST API limits an account's rate of requests to three requests per second. Requests made in excess of this threshold will return a 429 response code.

Add a label to a monitor

To add a label to a monitor in New Relic, replace the monitor_uuid and category:label in the following example with your specific values.

curl -v -X POST -H 'Api-Key:NEW_RELIC_USER_KEY' -H 'Content-Type: application/json'  https://synthetics.newrelic.com/synthetics/api/v4/monitors/monitor_uuid/labels -d 'category:label'
Get all monitors using a specific label

To view a list of all monitors in New Relic that have the same label, replace category:label in the following example with the specific value.

curl -v -H 'Api-Key:NEW_RELIC_USER_KEY' https://synthetics.newrelic.com/synthetics/api/v4/monitors/labels/category:label
Dissociate a label from a monitor

To dissociate a label from an existing monitor in New Relic, replace the monitor_uuid and category:label in the following example with your specific values.

curl -v -X DELETE -H 'Api-Key:NEW_RELIC_USER_KEY' https://synthetics.newrelic.com/synthetics/api/v4/monitors/monitor_uuid/labels/category:label

For more help

If you need more help, check out these support and learning resources: