---
type: api
title: Get an enrich policy
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-enrich-get-policy
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-enrich-get-policy
products:
  - Elasticsearch
---

# Get an enrich policy


Availability: 7.5+

## Paths

- `GET` `/_enrich/policy/{name}`
- `GET` `/_enrich/policy`

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

#### Path Parameters

- `name` (union Name | [] Name) — optional, leave it out to use `/_enrich/policy`
  Comma-separated list of enrich policy names used to limit the request.
To return information for all enrich policies, omit this parameter.

## Description

Returns information about an enrich policy.

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node.

## Response

`application/json`

- `policies` ([] Summary)
  - `config` (map string to Policy)
    Map values ({} Policy)
    - `enrich_fields` (string Fields)
    - `indices` (string Indices)
    - `match_field` (string Field)
    - `query` ({} QueryContainer)
      See [QueryContainer](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/types/_types-query_dsl-querycontainer)
    - `name` (string Name)
    - `elasticsearch_version` (string)
## Code Examples

#### Console

```console
GET /_enrich/policy/my-policy
```

#### JavaScript

```javascript
const response = await client.enrich.getPolicy({
  name: "my-policy",
});
```

#### Python

```python
resp = client.enrich.get_policy(
    name="my-policy",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_enrich/policy/my-policy" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.enrich().getPolicy(g -> g
    .name("my-policy")
);
```

#### C#

```c#
var response = await client.Enrich
    .GetPolicyAsync(d1 => d1
        .Name(new[] { "my-policy" })
    );
```

#### PHP

```php
$resp = $client->enrich()->getPolicy([
    "name" => "my-policy",
]);
```

#### Ruby

```ruby
response = client.enrich.get_policy(
  name: "my-policy"
)
```

