Attio.Objects (Attio v0.2.0)

Copy Markdown View Source

Functions for managing Attio objects.

Objects are the core data models in Attio. Standard objects (people, companies, deals) are provided by the workspace; custom objects can be created via create/2.

Requires the object_configuration:read scope for read operations and object_configuration:read-write for mutations.

Summary

Functions

Creates a new custom object.

Gets a single object by its ID or slug.

Lists all objects in the workspace.

Lists saved views for an object.

Updates an object's configuration.

Functions

create(client, attrs)

@spec create(Attio.Client.t(), map()) :: {:ok, map()} | {:error, term()}

Creates a new custom object.

Required attributes

  • "api_slug" - URL-safe identifier (e.g. "my_object")
  • "singular_noun" - Display name for a single record (e.g. "Deal")
  • "plural_noun" - Display name for multiple records (e.g. "Deals")

get(client, object)

@spec get(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}

Gets a single object by its ID or slug.

Example

Attio.Objects.get(client, "people")
Attio.Objects.get(client, "97052eb9-e65e-443f-a297-f2d9a4a7f795")

list(client)

@spec list(Attio.Client.t()) :: {:ok, map()} | {:error, term()}

Lists all objects in the workspace.

list_views(client, object)

@spec list_views(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}

Lists saved views for an object.

update(client, object, attrs)

@spec update(Attio.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}

Updates an object's configuration.