---
type: api
title: Get a private location
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-get-private-location
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-get-private-location
products:
  - Kibana
---

# Get a private location

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

## Paths

- `GET` `/api/synthetics/private_locations/{id}`
- `GET` `/s/{space_id}/api/synthetics/private_locations/{id}`

#### Path parameters

- `id` (string · min length: 1 · max length: 1024) — required
  A private location identifier or label.

## Description

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

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

## Required authorization

- Privileges: `uptime-read`

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Responses

#### `200`

A successful response.

`application/json`

- `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.
- `spaces` (string[])
  The space IDs where the private location is available.
- `tags` (string[])
  An array of tags to categorize the private location.
#### `404`

No private location matches the given ID or label.

## Code examples

#### Console

```console
GET kbn://api/synthetics/private_locations/location-id
```

#### curl

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

## Response examples

#### Get private location response example1

```json
{
  "agentPolicyId": "test-private-location-id",
  "geo": {
    "lat": 0,
    "lon": 0
  },
  "id": "test-private-location-id",
  "isInvalid": false,
  "isServiceManaged": false,
  "label": "Test private location",
  "namespace": "default"
}
```

