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

# Delete a private location

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

## Paths

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

#### Path parameters

- `id` (string · min length: 1 · max length: 1024) — required
  The unique identifier of the private location to delete.

## Description

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.

A location cannot be deleted if it has associated monitors in use in any space. You must delete all monitors associated with the location before deleting the location.

## Required authorization

- Privileges: `uptime-read` and `private-location-write` and `uptime-write`

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

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Responses

#### `200`

OK.

#### `400`

The private location does not exist, or it is used by one or more monitors in any space.

## Code examples

#### Console

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

#### curl

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

