Bunnyx.Account (Bunnyx v0.4.0)

Copy Markdown View Source

Account-level operations — affiliate details, audit logs, global search, and account management.

Uses the main API client created with Bunnyx.new/1.

Usage

client = Bunnyx.new(api_key: "sk-...")

{:ok, affiliate} = Bunnyx.Account.affiliate(client)
{:ok, logs} = Bunnyx.Account.audit_log(client, ~D[2025-06-01])
{:ok, results} = Bunnyx.Account.search(client, "my-zone")

Summary

Functions

Returns affiliate program details and charts.

Returns the user audit log for a given date.

Permanently closes the current user account.

Searches across all resources.

Functions

affiliate(client)

@spec affiliate(Bunnyx.t() | keyword()) :: {:ok, map()} | {:error, Bunnyx.Error.t()}

Returns affiliate program details and charts.

audit_log(client, date, opts \\ [])

@spec audit_log(Bunnyx.t() | keyword(), Date.t() | String.t(), keyword()) ::
  {:ok, map()} | {:error, Bunnyx.Error.t()}

Returns the user audit log for a given date.

Options

  • :product — filter by product (list of strings)
  • :resource_type — filter by resource type (list of strings)
  • :order"Ascending" or "Descending"
  • :continuation_token — pagination token
  • :limit — max results (1–10000)

close_account(client, opts \\ [])

@spec close_account(
  Bunnyx.t() | keyword(),
  keyword()
) :: {:ok, nil} | {:error, Bunnyx.Error.t()}

Permanently closes the current user account.

Options

  • :password — account password
  • :reason — reason for closing

search(client, query, opts \\ [])

@spec search(Bunnyx.t() | keyword(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Bunnyx.Error.t()}

Searches across all resources.

Options

  • :from — number of results to skip (default 0)
  • :size — number of results to return (default 20)