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

# Get an enrich policy


## Paths

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

#### Path parameters

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

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use 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}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

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

## Response

`application/json`

- `policies` (object[])
  - `config` (map string to object · min properties: 1 · max properties: 1)
    Map values (object)
    - `enrich_fields` (string)
    - `indices` (string)
    - `match_field` (string)
    - `query` ({} Query)
      See [Query](https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/types/_types-query_dsl-querycontainer)
    - `name` (string)
    - `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"
)
```

