# Listing and Reviewing Tags Using the REST API

You can view the list and view the usage of each tag, including details, policy, and column information.

Policy tags are not isolated in the detail and usage lists for all tags. Therefore, namespace: POLICY and namespace: RESOURCE are combined in the results.

# List Tags

List and view details for all tags.

```bash
curl --request GET "https://api-data-def-repo.treasuredata.com/v1/annotation-type/custom" \
--header 'Authorization: TD1 ${6542/1120000023340000042320000016789000005438}'
```

**Sample Response**

```json
{
  "data": [
    {
      "id": "2f27b00e-9377-419e-91c3-4456598c30a8",
      "attributes": {
        "name": "PII",
        "humanReadableName": "PII",
        "comment": null,
        "version": 1,
        "createdAt": "2021-05-20T22:10:32.872791Z",
        "updatedAt": "2021-05-20T22:10:32.872791Z",
        "color": "POLICY_DEFAULT",
        "namespace": "POLICY"
      },
      "type": "annotation-type"
    },
    {
      "id": "6d4ed012-9a68-4de4-820d-e9b70c22382e",
      "attributes": {
        "name": "KarinTag",
        "humanReadableName": "KarinTag",
        "comment": "",
        "version": 1,
        "createdAt": "2022-01-07T17:08:32.255631Z",
        "updatedAt": "2022-01-07T17:08:32.255631Z",
        "color": "RESOURCE_DEFAULT",
        "namespace": "RESOURCE"
      },
      "type": "annotation-type"
    },
    ....
  ]
}
```

# View Usage for Each Tag

You can view how each tag is used. In the following example, you can see usage for PII.

```bash
$ curl --request GET "https://api-data-def-repo.treasuredata.com/v1/column-annotation/lookup?annotationTypeName=PII" \
       --header 'Authorization: TD1 ${6542/1120000023340000042320000016789000005438}'
```

**Sample Response**

```json
{
  "data": [
    {
      "id": "465302e6-67c0-4b33-9462-2f501c511601",
      "attributes": {
        "comment": "",
        "createdAt": "2021-09-30T07:40:01.792499Z",
        "sensitive": false
      },
      "relationships": {
        "annotation-type": {
          "data": {
            "type": "annotation-type",
            "id": "2f27b00e-9377-419e-91c3-4456598c30a8",
            "name": "PII"
          }
        },
        "table": {
          "data": {
            "type": "treasure-data-table",
            "id": "607222.3276426"
          }
        },
        "column": {
          "data": {
            "type": "treasure-data-column",
            "id": "dob"
          }
        },
        "created-by": {
          "data": {
            "type": "treasure-data-user",
            "id": "33648"
          }
        }
      },
      "type": "column-annotation"
    },
    ...
  ],
  "links": {
    "first": "/v1/column-annotation/lookup?annotationTypeName=PII",
    "self": "/v1/column-annotation/lookup?annotationTypeName=PII"
  },
  "meta": {
    "perPage": 250
  }
}
```