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"
.
{
"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"
}
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.
{
"domains": ["app.attio.com"]
}
{
"domains": ["app.attio.com", "attio.com"]
}
{
"domains": [
{
"domain": "app.attio.com"
}
]
}
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.
{
"filter": {
"domain": "app.attio.com"
}
}
{
"filter": {
"domains": {
"root_domain": {
"$eq": "attio.com"
}
}
}
}
{
"filter": {
"domains": {
"domain": {
"$contains": "attio"
}
}
}
Updated 8 months ago