# Properties

Properties are custom string key/value pairs that can be attached to a copy of any object. For example, the key/value pair "project"/"cancer" can be attached to an object.

The properties associated with an object are returned by the `describe` method, and modified by the `setProperties` method.

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

### Specification

Sets properties on an object in the specified project. To remove a property altogether, its value needs to be set to the JSON `null` (instead of a string). This call updates the properties of the object by merging any old (previously existing) ones with what is provided in the input, the newer ones taking precedence when the same key appears in the old.

Best practices: to fully reset properties (remove all existing key/value pairs and replace them with new ones), first issue a describe call to get the names of all properties, then issue a `setProperties` request to set the values of those properties to `null`.

### Inputs

* `project` **string** (required) ID of the project or container containing the object to be modified.
* `properties` **mapping** (required) Properties to modify.
  * **key** — the name of the property to modify.
  * **value** **string or null** — a new string value for the property, or `null` to unset the property.

### Outputs

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

### Errors

* InvalidInput
  * There exists at least one value in `properties` which is neither a string nor the JSON `null`
  * For each property key-value pair, the size, encoded in UTF-8, of the property key may not exceed 100 bytes and the property value may not exceed 700 bytes
* 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)

### Examples

| Input                 | Action                                          |
| --------------------- | ----------------------------------------------- |
| `{}`                  | No action taken.                                |
| `{"tissue": "liver"}` | The property "tissue" is set to value "liver".  |
| `{"tissue": null}`    | The property "tissue" is removed, if it exists. |


---

# 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/properties.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.
