---
type: api
title: Get tags
description: Get the tags that are defined for the project.
url: https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags
resource: https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags
products:
  - Elasticsearch Serverless
---

# Get tags

Authentication: required

Availability: Experimental

## Paths

- `POST` (also `GET`) `/_project/tags`

## Description

Get the tags that are defined for the project.

## Required privileges

- Cluster privileges: `read_project_routing`, `monitor`

## Request body

`application/json`

Type: `object`


## Response

`application/json`

- `origin` (map string to object · min properties: 1 · max properties: 1)
  Map values (object)
  - `_id` (string)
  - `_alias` (string)
  - `_type` (string)
  - `_organisation` (string)
- `linked_projects` (map string to object)
  Map values (object)
  - `_id` (string)
  - `_alias` (string)
  - `_type` (string)
  - `_organisation` (string)
## Code examples

#### Console

```console
POST /_project/tags
```

#### JavaScript

```javascript
const response = await client.project.tags();
```

#### Python

```python
resp = client.perform_request(
    "GET",
    "/_project/tags",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_project/tags" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.project().tags(t -> t);
```

#### C#

```c#
var response = await client.Project.TagsAsync();
```

#### PHP

```php
$resp = $client->project()->tags();
```

#### Ruby

```ruby
response = client.project.tags
```

## Response examples

#### Project tags

`application/json`

A successful response from `GET /_project/tags`

```json
{
  "origin": {
    "c56c4f8849c64cc6ae59c261f40bd195": {
      "_id": "c56c4f8849c64cc6ae59c261f40bd195"
      "_type": "elasticsearch",
      "_alias": "project-1",
      "_csp": "aws",
      "_region": "us-east-1"
      "mytag1": "foo",
      "mytag2": "bar"
    }
  },
  "linked_projects": {
    "a3b88ea3f195a336ae59c261f40bd195": {
      "_id": "a3b88ea3f195a336ae59c261f40bd195"
      "_type": "security",
      "_alias": "project-2",
      "_csp": "aws",
      "_region": "us-east-1"
      "mytag1": "foo",
      "mytag2": "bar"
    },
    "f40bd195389s3761023ca7aa8a3r0932": {
      "_id": "f40bd195389s3761023ca7aa8a3r0932"
      "_type": "observability",
      "_alias": "project-3",
      "_csp": "aws",
      "_region": "us-east-1"
      "mytag1": "foo",
      "mytag2": "bar"
    }
  }
}
```

