Attio.Webhooks (Attio v0.2.0)

Copy Markdown View Source

Functions for managing webhook subscriptions.

Webhooks allow your application to receive real-time notifications when data changes in Attio. Requires the webhook:read scope for read operations and webhook:read-write for mutations.

Summary

Functions

Creates a webhook.

Deletes a webhook.

Gets a single webhook by its ID.

Lists all webhooks in the workspace.

Updates a webhook (e.g. to change its target URL or subscriptions).

Functions

create(client, attrs)

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

Creates a webhook.

Required attributes

  • "target_url" - The HTTPS URL that will receive event payloads.
  • "subscriptions" - List of event subscription objects, each with an "event_type" field.

Example

Attio.Webhooks.create(client, %{
  "target_url" => "https://my-app.example.com/webhooks/attio",
  "subscriptions" => [
    %{"event_type" => "record.created"},
    %{"event_type" => "record.updated"}
  ]
})

delete(client, webhook_id)

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

Deletes a webhook.

get(client, webhook_id)

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

Gets a single webhook by its ID.

list(client)

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

Lists all webhooks in the workspace.

update(client, webhook_id, attrs)

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

Updates a webhook (e.g. to change its target URL or subscriptions).