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

# Get application privileges


Availability: Generally available since 6.4

## Paths

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

#### Path parameters

- `application` (string) — 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 string | string[]) — 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.

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

## Required authorization

- Cluster privileges: `read_security`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Response

`application/json`

Type: `map string to string to object`

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

