Unit.API.Events (Unit v1.0.0)

Copy Markdown View Source

API module for querying Unit Events (last 90 days).

Events are the underlying records that drive webhook deliveries. You can query them directly even if a webhook was not delivered successfully.

Summary

Functions

Fire a specific event to all active webhooks (for testing/backfill).

Get an event by ID.

List events.

Functions

fire(id, opts \\ [])

@spec fire(
  String.t(),
  keyword()
) :: {:ok, nil} | {:error, term()}

Fire a specific event to all active webhooks (for testing/backfill).

get(id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, Unit.Resource.Event.t()} | {:error, term()}

Get an event by ID.

list(opts \\ [])

@spec list(keyword()) :: {:ok, [Unit.Resource.Event.t()], map()} | {:error, term()}

List events.

Filter options

  • :type — event type string, e.g. "transaction.created"
  • :since / :until — ISO 8601 datetime strings
  • :page_limit, :page_offset