---
type: api
title: Delete source map
description: Delete a previously uploaded source map. You must have `all` Kibana privileges for the APM and User Experience feature.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deletesourcemap
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deletesourcemap
products:
  - Kibana
---

# Delete source map

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

## Paths

- `DELETE` `/api/apm/sourcemaps/{id}`

#### Path parameters

- `id` (string) — required
  Source map identifier

## Description

Delete a previously uploaded source map. You must have `all` Kibana privileges for the APM and User Experience feature.

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

- `elastic-api-version` (enum · default: 2023-10-31) — required
  The version of the API to use
  Values: `2023-10-31`
- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Responses

#### `200`

Successful response

`application/json`

Type: `object`

#### `400`

Bad Request response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `401`

Unauthorized response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `403`

Forbidden response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `500`

Internal Server Error response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
#### `501`

Not Implemented response

`application/json`

- `error` (string)
  Error type
- `message` (string)
  Error message
- `statusCode` (number)
  Error status code
## Code examples

#### curl

```curl
curl -X DELETE "http://localhost:5601/api/apm/sourcemaps/apm:foo-1.0.0-644fd5a9" \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: true' \
-H 'Authorization: ApiKey ${YOUR_API_KEY}'
```

## Response examples

#### Delete source map response example1

An example of a successful response from `DELETE /api/apm/sourcemaps/{id}`. The response body is intentionally empty.

```json
{}
```

#### Bad request

An example of a 400 Bad Request response, returned when the request payload or query parameters fail validation.

```json
{
  "error": "Bad Request",
  "message": "[request body]: expected value of type [string] but got [undefined]",
  "statusCode": 400
}
```

#### Unauthorized

An example of a 401 Unauthorized response, returned when the request is missing valid authentication credentials.

```json
{
  "error": "Unauthorized",
  "message": "[security_exception]: missing authentication credentials for REST request",
  "statusCode": 401
}
```

#### Forbidden

An example of a 403 Forbidden response, returned when the authenticated user lacks the required APM and User Experience privileges.

```json
{
  "error": "Forbidden",
  "message": "Insufficient privileges to perform this action. The APM and User Experience feature requires \u0060all\u0060 privileges.",
  "statusCode": 403
}
```

#### Internal server error

An example of a 500 Internal Server Error response, returned when an unexpected error occurs while processing the request.

```json
{
  "error": "Internal Server Error",
  "message": "An internal server error occurred. Check the Kibana server logs for details.",
  "statusCode": 500
}
```

#### Not implemented

An example of a 501 Not Implemented response, returned when the source map feature is not available on the current deployment.

```json
{
  "error": "Not Implemented",
  "message": "Not Implemented",
  "statusCode": 501
}
```

