Module: Attio

Defined in:
lib/attio.rb,
lib/attio/client.rb,
lib/attio/errors.rb,
lib/attio/logger.rb,
lib/attio/version.rb,
lib/attio/webhooks.rb,
lib/attio/http_client.rb,
lib/attio/rate_limiter.rb,
lib/attio/observability.rb,
lib/attio/retry_handler.rb,
lib/attio/resources/base.rb,
lib/attio/resources/bulk.rb,
lib/attio/resources/meta.rb,
lib/attio/circuit_breaker.rb,
lib/attio/connection_pool.rb,
lib/attio/enhanced_client.rb,
lib/attio/resources/deals.rb,
lib/attio/resources/lists.rb,
lib/attio/resources/notes.rb,
lib/attio/resources/tasks.rb,
lib/attio/resources/users.rb,
lib/attio/resources/objects.rb,
lib/attio/resources/records.rb,
lib/attio/resources/threads.rb,
lib/attio/resources/comments.rb,
lib/attio/resources/attributes.rb,
lib/attio/resources/workspaces.rb,
lib/attio/resources/workspace_members.rb

Overview

Handles all record-related API operations.

Records are the main data entities in Attio, representing things like people, companies, deals, etc. This class provides methods to create, read, update, delete, and query records.

Examples:

List records

records = client.records.list(object: 'people', filters: { name: 'John' })

Create a record

record = client.records.create(
  object: 'people',
  data: { name: 'Jane Doe', email: '[email protected]' }
)

Author:

  • Ernest Sim

Since:

  • 1.0.0

Defined Under Namespace

Modules: Observability, Resources Classes: APIError, AuthenticationError, CircuitBreaker, CircuitBreakerClient, Client, CompositeCircuitBreaker, ConnectionPool, EnhancedClient, Error, HttpClient, Logger, NotFoundError, PooledHttpClient, RateLimitError, RateLimitMiddleware, RateLimiter, RequestLogger, RetryHandler, ServerError, ValidationError, WebhookServer, Webhooks

Constant Summary collapse

VERSION =

Since:

  • 1.0.0

"0.5.0"

Class Method Summary collapse

Class Method Details

.client(api_key:) ⇒ Client

Creates a new Attio API client instance.

Examples:

Create a client

client = Attio.client(api_key: 'your-api-key-here')

Parameters:

  • api_key (String)

    Your Attio API key

Returns:

  • (Client)

    A new client instance configured with the provided API key

Raises:

  • (ArgumentError)

    if api_key is nil or empty

Since:

  • 1.0.0



76
77
78
# File 'lib/attio.rb', line 76

def self.client(api_key:)
  Client.new(api_key: api_key)
end

.enhanced_client(**options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Factory method for creating enhanced client

Examples:

client = Attio.enhanced_client(
  api_key: ENV['ATTIO_API_KEY'],
  connection_pool: { size: 25 },
  circuit_breaker: { threshold: 10 }
)

Since:

  • 1.0.0



254
255
256
# File 'lib/attio/enhanced_client.rb', line 254

def self.enhanced_client(**options)
  EnhancedClient.new(**options)
end