---
type: api
title: Get a project routing expression
description: ## Required authorization
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-project-get-routing
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-project-get-routing
products:
  - Elasticsearch Serverless
---

# Get a project routing expression

Availability: Experimental

## Paths

- `GET` `/_project_routing/{name}`

#### Path parameters

- `name` (string) — required
  The name of project routing expression

## Required authorization

- Cluster privileges: `read_project_routing`, `monitor`

## 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).

## Response

`application/json`

- `expression` (string)
## Code examples

#### Console

```console
GET /_project_routing/aws-us-only
```

#### JavaScript

```javascript
const response = await client.project.getRouting({
  name: "aws-us-only",
});
```

#### Python

```python
resp = client.perform_request(
    "GET",
    "/_project_routing/aws-us-only",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_project_routing/aws-us-only" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.project().getRouting(g -> g
    .name("aws-us-only")
);
```

#### C#

```c#
var response = await client.Project.GetRoutingAsync(name: "aws-us-only");
```

#### PHP

```php
$resp = $client->project()->getRouting([
    "name" => "aws-us-only",
]);
```

#### Ruby

```ruby
response = client.project.get_routing(
  name: "aws-us-only"
)
```

## Response examples

#### A single expressions

```json
{
  "expression" : "_csp:aws AND _region:us*"
}
```

