---
type: api
title: Get application privileges
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-security-get-privileges
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-security-get-privileges
products:
  - Elasticsearch
---

# Get application privileges


Availability: 6.4+

## Paths

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

- [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) — optional, leave it out to use `/_security/privilege`
  The name of the application.
Application privileges are always associated with exactly one application.
If you do not specify this parameter, the API returns information about all privileges for all applications.
- `name` (union Name | [] Name) — optional, leave it out to use `/_security/privilege`
  The name of the privilege.
If you do not specify this parameter, the API returns information about all privileges for the requested application.

## Description

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

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

## Required authorization

* Cluster privileges: `read_security`

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

## Response

`application/json`

Type: `map string to string to Actions`

## Code Examples

#### Console

```console
GET /_security/privilege/myapp/read
```

#### JavaScript

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

#### Python

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

#### curl

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

#### Java

```java
client.security().getPrivileges(g -> g
    .application("myapp")
    .name("read")
);
```

#### C#

```c#
var response = await client.Security
    .GetPrivilegesAsync(d1 => d1
        .Application("myapp")
        .Name(new[] { "read" })
    );
```

#### PHP

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

#### Ruby

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

## Response Examples

#### Security get privileges response example1

A successful response from `GET /_security/privilege/myapp/read`. The response contains information about the `read` privilege for the `app01` application.

```json
{
  "myapp": {
    "read": {
      "application": "myapp",
      "name": "read",
      "actions": [
        "data:read/*",
        "action:login"
      ],
      "metadata": {
        "description": "Read access to myapp"
      }
    }
  }
}
```

