---
title: "Create a private location"
method: POST
path: "/api/synthetics/private_locations"
tags: ["synthetics"]
---

# Create a private location

`POST /api/synthetics/private_locations`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/synthetics/private_locations</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

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

## Request body

- object
  - `agentPolicyId` string, required — The ID of the agent policy associated with the private location.
  - `geo` object — Geographic coordinates (WGS84) for the location.
    - `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` 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` string[] — An array of tags to categorize the private location.

## Response `200`

A successful response.

- object

## Other responses

- `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.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/93e11b266872/schema)
