Create/Update/Delete Tests Using the ThousandEyes API

The ThousandEyes API supports creating, editing, and deleting tests programmatically.

This feature is restricted to users with Account Admin privileges or higher. Users without account admin privileges will receive an HTTP/403 error when attempting to post a write request.

The NEW, UPDATE and DELETE endpoints have been added to each test endpoint. Content must be submitted using a POST request, and all POST requests must contain a "Content-Type: application/JSON" header.

/tests/agent-to-server/new
/tests/agent-to-server/{testId}/update
/tests/agent-to-server/{testId}/delete

/tests/agent-to-agent/new
/tests/agent-to-agent/{testId}/update
/tests/agent-to-agent/{testId}/delete

/tests/dns-trace/new
/tests/dns-trace/{testId}/update
/tests/dns-trace/{testId}/delete

/tests/dns-server/new
/tests/dns-server/{testId}/update
/tests/dns-server/{testId}/delete

/tests/dns-dnssec/new
/tests/dns-dnssec/{testId}/update
/tests/dns-dnssec/{testId}/delete

/tests/http-server/new
/tests/http-server/{testId}/update
/tests/http-server/{testId}/delete

/tests/page-load/new
/tests/page-load/{testId}/update
/tests/page-load/{testId}/delete

/tests/web-transactions/new
/tests/web-transactions/{testId}/update
/tests/web-transactions/{testId}/delete

To show a basic example of an add request, using cURL:

this will return successfully once the test has been created:

I can then update the same request by modifying the JSON data:

Note that only certain fields can be updated in an update request:

  • interval

  • testName

  • agents

Then, to delete the same test, run the following command:

You'll get an empty JSON response back, and the test will be gone from the front end.

Terraform

The ThousandEyes Terraform provider leverages the ThousandEyes Go SDK to allow users to manage tests and create alerts using Terraform.

For comprehensive documentation on using the ThousandEyes provider, see the links below:

Last updated