Create a private location

POST /api/synthetics/private_locations

Spaces method and path for this operation:

post /s/{space_id}/api/synthetics/private_locations

Refer to Spaces for more information.

You must have all privileges for the Synthetics and Uptime feature in the Observability section of the Kibana feature privileges.

application/json

Body Required

  • agentPolicyId string Required

    The ID of the agent policy associated with the private location.

  • geo object

    Geographic coordinates (WGS84) for the location.

    Hide geo attributes Show geo attributes object
    • lat number Required

      The latitude of the location.

    • lon number Required

      The longitude of 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.

  • tags array[string]

    An array of tags to categorize the private location.

Responses

  • 200 application/json

    A successful response.

  • 400

    If the agentPolicyId is already used by an existing private location or if the label already exists, the API will return a 400 Bad Request response with a corresponding error message.

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 } }