---
type: api
title: Get private locations
description: Get a list of private locations.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-get-private-locations
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-get-private-locations
products:
  - Kibana
---

# Get private locations

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/synthetics/private_locations`

## Description

Get a list of private locations.
You must have `read` privileges for the Synthetics and Uptime feature in the Observability section of the Kibana feature privileges.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Response

A successful response.

`application/json`

Type: `object[]`

An array; each item has these fields:

- `agentPolicyId` (string)
  The ID of the agent policy associated with the private location.
- `geo` (object)
  Geographic coordinates (WGS84) for the location.
  - `lat` (number)
    The latitude of the location.
  - `lon` (number)
    The longitude of the location.
- `id` (string)
  The unique identifier of the private location.
- `isInvalid` (boolean)
  Indicates whether the location is invalid. If `true`, the location is invalid, which means the agent policy associated with the location is deleted.
- `label` (string)
  A label for the private location.
- `namespace` (string)
  The namespace of the location, which is the same as the namespace of the agent policy associated with the location.
## Code examples

#### Console

```console
GET kbn:/api/synthetics/private_locations
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/synthetics/private_locations" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get private locations response example1

```json
[
    {
        "label": "Test private location",
        "id": "fleet-server-policy",
        "agentPolicyId": "fleet-server-policy",
        "isInvalid": false,
        "geo": {
            "lat": 0,
            "lon": 0
        },
        "namespace": "default"
    },
    {
        "label": "Test private location 2",
        "id": "691225b0-6ced-11ee-8f5a-376306ee85ae",
        "agentPolicyId": "691225b0-6ced-11ee-8f5a-376306ee85ae",
        "isInvalid": false,
        "geo": {
            "lat": 0,
            "lon": 0
        },
        "namespace": "test"
    }
]
```

