Create a private location
You must have all
privileges for the Synthetics and Uptime feature in the Observability section of the Kibana feature privileges.
Body
Required
-
agentPolicyId
string Required The ID of the agent policy associated with the private location.
-
geo
object Geographic coordinates (WGS84) for the location.
-
label
string Required A label for the private location.
-
spaces
array[string] An array of space IDs where the private location is available. If it is not provided, the private location is available in all spaces.
POST
/api/synthetics/private_locations
curl \
--request POST 'https://localhost:5601/api/synthetics/private_locations' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"label\": \"Private Location 1\",\n \"agentPolicyId\": \"abcd1234\",\n \"tags\": [\"private\", \"testing\"],\n \"geo\": {\n \"lat\": 40.7128,\n \"lon\": -74.0060\n }\n \"spaces\": [\"default\"]\n}"'
Request example
Run `POST /api/private_locations` to create a private location.
{
"label": "Private Location 1",
"agentPolicyId": "abcd1234",
"tags": ["private", "testing"],
"geo": {
"lat": 40.7128,
"lon": -74.0060
}
"spaces": ["default"]
}
Response examples (200)
{
"id": "abcd1234",
"label": "Private Location 1",
"agentPolicyId": "abcd1234",
"tags": ["private", "testing"],
"geo": {
"lat": 40.7128,
"lon": -74.0060
}
}