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
@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"}
]
})
@spec delete(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}
Deletes a webhook.
@spec get(Attio.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}
Gets a single webhook by its ID.
@spec list(Attio.Client.t()) :: {:ok, map()} | {:error, term()}
Lists all webhooks in the workspace.
@spec update(Attio.Client.t(), String.t(), map()) :: {:ok, map()} | {:error, term()}
Updates a webhook (e.g. to change its target URL or subscriptions).