# Tags

Each copy of an object also maintains a set of tags associated with it. Tags are strings of nonzero length and can be associated with objects to help organize them or annotate them.

Tags are returned by the `describe` method, and modified by the `addTags` and `removeTags` methods.

## API method: `/class-xxxx/addTags`

### Specification

Adds the specified tags to the object in the specified project. If any of the tags are already present, no action is taken for those tags.

### Inputs

* `project` **string** (required) ID of the project or container containing the object to be modified.
* `tags` **array of strings** (required) Tags to be added.

### Outputs

* `id` **string** ID of the manipulated object.

### Errors

* InvalidInput (the input is not a hash, `project` is missing or is not a string, the key `tags` is missing, or its value is not an array, or the array contains at least one invalid (not a string of nonzero length) tag)
* ResourceNotFound (the specified object does not exist, the specified project does not exist, or the specified project does not contain the specified object)
* PermissionDenied (If the object is open, UPLOAD access is required, otherwise CONTRIBUTE access is required for the specified project)

## API method: `/class-xxxx/removeTags`

### Specification

Removes the specified tags from the object in the specified project. Ensures that the specified tags are not part of the object -- if any of the tags are already missing, no action is taken for those tags.

### Inputs

* `project` **string** (required) ID of the project or container containing the object to be modified.
* `tags` **array of strings** (required) Tags to be removed.

### Outputs

* `id` **string** ID of the manipulated object.

### Errors

* InvalidInput (the input is not a hash, `project` is missing or is not a string, or the key `tags` is missing, or its value is not an array, or the array contains at least one invalid (not a string of nonzero length) tag)
* ResourceNotFound (the specified object does not exist, the specified project does not exist, or the specified project does not contain the specified object)
* PermissionDenied (If the object is open, UPLOAD access is required, otherwise CONTRIBUTE access is required for the specified project)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.dnanexus.com/developer/api/introduction-to-data-object-metadata/tags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
