> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Domain

> An internet domain

Domain attributes represent an internet domain, for example, "apple.com".

Attio represents domains as structured objects rather than raw strings, allowing filtering and display of specific domain properties such as the root domain.

Please note that domain attributes store domains, not URLs. Any inputted values will have paths and query parameters trimmed. If you would like to store full URLs, please use a text attribute.

It isn't currently possible to create your own domain attributes, so you'll find only the multi-select `domains` attribute on a company object.

### Reading values

There are two properties on a domain attribute, `domain` and `root_domain`.

The `domain` property contains the entire domain, after normalization.

The `root_domain` property is the top-most part of the domain besides the public suffix. For example, the root domain of `"app.attio.com"` would be `"attio.com"`.

<CodeGroup>
  ```jsonc Example: app.attio.com theme={"system"}
  {
    "active_from": "2023-04-03T15:21:06.447000000Z",
    "active_until": null,
    "created_by_actor": {
      /*...*/
    },
    "attribute_type": "domain",
    "domain": "app.attio.com",
    "root_domain": "attio.com"
  }
  ```
</CodeGroup>

### Writing values

To write domain values, simply pass the string of the domain.

The `root_domain` property will automatically be inferred from input values so there is no need to write it yourself.

You may also write domain values using an object with a single key, `domain`.

As the `domains` attribute is multi-select, you must always pass values wrapped in an array.

<CodeGroup>
  ```json Using string (single value) theme={"system"}
  {
    "domains": ["app.attio.com"]
  }
  ```

  ```json Using string (multiple values) theme={"system"}
  {
    "domains": ["app.attio.com", "attio.com"]
  }
  ```

  ```json Using object theme={"system"}
  {
    "domains": [
      {
        "domain": "app.attio.com"
      }
    ]
  }
  ```
</CodeGroup>

### Filtering

Domain attribute values can be filtered by either the `root_domain` or `domain` property, and support several operators:

* `$eq` for an exact match
* `$not_empty` for any value present
* `$contains` , `$starts_with` and `$ends_with`

In implicit mode, the `domain` property is checked for equality, otherwise you can use the explicit syntax to combine the properties and operators above.

<CodeGroup>
  ```json Companies where domain=app.attio.com theme={"system"}
  {
    "filter": {
      "domain": "app.attio.com"
    }
  }
  ```

  ```json ...where subdomain=attio.com theme={"system"}
  {
    "filter": {
      "domains": {
        "root_domain": {
          "$eq": "attio.com"
        }
      }
    }
  }
  ```

  ```jsonc ...where domain includes attio theme={"system"}
  {
    "filter": {
      "domains": {
        "domain": {
          "$contains": "attio"
        }
      }
    }
  }
  ```
</CodeGroup>
