Miosa.Tenant (Miosa v1.1.0)

Copy Markdown View Source

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

current(client)

@spec current(Miosa.Client.t()) :: Miosa.Client.result(map())

Get the current tenant's plan, limits, and live usage counters.

delete_branding(client)

@spec delete_branding(Miosa.Client.t()) :: Miosa.Client.result(map())

DELETE /api/v1/tenant/branding — reset branding to platform defaults.

delete_preview_domain(client)

@spec delete_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())

DELETE /api/v1/tenant/preview-domain — remove the custom preview domain.

get_branding(client)

@spec get_branding(Miosa.Client.t()) :: Miosa.Client.result(map())

GET /api/v1/tenant/branding.

get_preview_domain(client)

@spec get_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())

GET /api/v1/tenant/preview-domain → %{domain, verified_at, cname_target}.

set_branding(client, branding)

@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.

set_preview_domain(client, domain)

@spec set_preview_domain(Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())

PUT /api/v1/tenant/preview-domain — set the custom preview domain.

verify_preview_domain(client)

@spec verify_preview_domain(Miosa.Client.t()) :: Miosa.Client.result(map())

POST /api/v1/tenant/preview-domain/verify → %{verified, target, records}.