---
type: api
title: Delete application privileges
description: To use this API, you must have one of the following privileges:
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-security-delete-privileges
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-security-delete-privileges
products:
  - Elasticsearch
---

# Delete application privileges

Availability: 6.4+

## Paths

- `DELETE` `/_security/privilege/{application}/{name}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `application` (string Name)
  The name of the application.
Application privileges are always associated with exactly one application.
- `name` (union Name | [] Name)
  The name of the privilege.

## Description

To use this API, you must have one of the following privileges:

* The `manage_security` cluster privilege (or a greater privilege such as `all`).
* The "Manage Application Privileges" global privilege for the application being referenced in the request.

## Required authorization

* Cluster privileges: `manage_security`

[Read the reference documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.19/security-privileges.html)

## Query String Parameters

- `refresh` (enum Refresh)
  If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
  Values: `true`, `false`, `wait_for`

## Response

`application/json`

Type: `map string to string to FoundStatus`

## Code Examples

#### Console

```console
DELETE /_security/privilege/myapp/read
```

#### JavaScript

```javascript
const response = await client.security.deletePrivileges({
  application: "myapp",
  name: "read",
});
```

#### Python

```python
resp = client.security.delete_privileges(
    application="myapp",
    name="read",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_security/privilege/myapp/read" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.security().deletePrivileges(d -> d
    .application("myapp")
    .name("read")
);
```

#### C#

```c#
var response = await client.Security.DeletePrivilegesAsync(application: "myapp", name: new[] { "read" });
```

#### PHP

```php
$resp = $client->security()->deletePrivileges([
    "application" => "myapp",
    "name" => "read",
]);
```

#### Ruby

```ruby
response = client.security.delete_privileges(
  application: "myapp",
  name: "read"
)
```

## Response Examples

#### Security delete privileges response example1

A successful response from `DELETE /_security/privilege/myapp/read`. If the privilege is successfully deleted, `found` is set to `true`.

```json
{
  "myapp": {
    "read": {
      "found" : true
    }
  }
}
```

