defmodule LoopsEx.ApiKey do @moduledoc """ Test your Loops API key. """ alias LoopsEx.Client @doc """ Test if the configured API key is valid. ## Returns - `{:ok, %{"success" => true, "teamName" => team_name}}` when the key is valid. - `{:error, {status_code, response_body}}` for HTTP errors (e.g., unauthorized). """ @spec test() :: Client.response() def test do Client.request_api(:get, "/api-key") |> Client.handle_response() end end