Current tenant info — plan limits, live usage counters, preview domain, and branding.
Example
client = Miosa.client(System.fetch_env!("MIOSA_API_KEY"))
{:ok, plan} = Miosa.Tenant.current(client)
IO.inspect(plan["plan"])
{:ok, _} = Miosa.Tenant.set_preview_domain(client, "preview.acme.com")
{:ok, result} = Miosa.Tenant.verify_preview_domain(client)
IO.inspect(result["verified"])
{:ok, _} = Miosa.Tenant.set_branding(client, %{
product_name: "Acme AI",
primary_color: "#ff0000"
})
Summary
Functions
Get the current tenant's plan, limits, and live usage counters.
DELETE /api/v1/tenant/branding — reset branding to platform defaults.
DELETE /api/v1/tenant/preview-domain — remove the custom preview domain.
GET /api/v1/tenant/branding.
GET /api/v1/tenant/preview-domain → %{domain, verified_at, cname_target}.
PUT /api/v1/tenant/branding.
PUT /api/v1/tenant/preview-domain — set the custom preview domain.
POST /api/v1/tenant/preview-domain/verify → %{verified, target, records}.
Functions
@spec current(Miosa.Client.t()) :: Miosa.Client.result(map())
Get the current tenant's plan, limits, and live usage counters.
@spec delete_branding(Miosa.Client.t()) :: Miosa.Client.result(map())
DELETE /api/v1/tenant/branding — reset branding to platform defaults.
@spec delete_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())
DELETE /api/v1/tenant/preview-domain — remove the custom preview domain.
@spec get_branding(Miosa.Client.t()) :: Miosa.Client.result(map())
GET /api/v1/tenant/branding.
@spec get_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())
GET /api/v1/tenant/preview-domain → %{domain, verified_at, cname_target}.
@spec set_branding(Miosa.Client.t(), map()) :: Miosa.Client.result(map())
PUT /api/v1/tenant/branding.
Accepted keys (atom or string):
:product_name, :logo_url, :support_url, :support_email,
:primary_color, :background_color.
@spec set_preview_domain(Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())
PUT /api/v1/tenant/preview-domain — set the custom preview domain.
@spec verify_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())
POST /api/v1/tenant/preview-domain/verify → %{verified, target, records}.