Functions for managing attributes on objects and lists.
Attributes are the typed properties that define the shape of records and list
entries. Both system-defined (e.g. email_addresses on people) and user-defined
attributes are accessible through these functions.
Targets
Attributes belong to either an object or a list, identified by the target
parameter:
:objects– attributes on an object (e.g.people,companies):lists– attributes on a list
Scopes
Requires object_configuration:read or list_configuration:read for reads,
and their :read-write counterparts for mutations.
Summary
Functions
Creates an attribute on an object or list.
Deletes a custom attribute.
Gets a single attribute by its ID or slug.
Lists attributes on an object or list.
Updates an attribute's configuration.
Types
Functions
Creates an attribute on an object or list.
Required attributes
"api_slug"- URL-safe identifier for the attribute."title"- Human-readable name."type"- Attribute type. One of:"text","number","checkbox","currency","date","timestamp","rating","status","select","record-reference","actor-reference","location","domain","email-address","phone-number".
Example
Attio.Attributes.create(client, :objects, "people", %{
"api_slug" => "linkedin_url",
"title" => "LinkedIn URL",
"type" => "text"
})
Deletes a custom attribute.
System-defined attributes cannot be deleted and will return a 403 error.
Example
Attio.Attributes.delete(client, :objects, "people", "linkedin_url")
Gets a single attribute by its ID or slug.
Example
Attio.Attributes.get(client, :objects, "people", "email_addresses")
Lists attributes on an object or list.
Options
:limit- Maximum number of attributes to return.:offset- Number of attributes to skip (offset-based pagination).
Example
Attio.Attributes.list(client, :objects, "people")
@spec update(Attio.Client.t(), target(), String.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}
Updates an attribute's configuration.
Only the supplied fields are changed; others are left untouched.
Example
Attio.Attributes.update(client, :objects, "people", "linkedin_url", %{
"title" => "LinkedIn Profile"
})