← Back to Dashboard

Organizations

Multi-tenant client management with billing, agent assignment, and revenue tracking

Table of Contents

Overview

Non-technical summary: Organizations represent your clients or departments. Each organization is a separate tenant — you assign AI agents to organizations, set billing rates, and track revenue vs. costs. Think of it like managing client accounts at an agency: each client has their own agents, their own billing, and their own data boundary.

The Organizations page (OrganizationsPage) provides full CRUD management for client organizations in a multi-tenant AgenticMail deployment. Organizations act as logical boundaries for agent assignment, knowledge base isolation, billing, and access control. Each organization has a unique slug, contact information, billing configuration, and a set of assigned agents.

How It Works

  1. Create an organization — Provide a name (auto-generates a URL-safe slug), contact details, description, and optional billing rate per agent per month.
  2. Assign agents — Open the organization detail view and assign existing agents to it. Agents can be reassigned from other orgs.
  3. Set billing rates — Configure a default per-agent monthly rate, or set custom rates per agent.
  4. Monitor revenue — The billing tab shows revenue vs. token cost charts, margin calculations, and per-agent breakdowns.
  5. Manage lifecycle — Activate, deactivate, or delete organizations as needed.

Key Concepts

Organization Slug

A URL-safe identifier auto-generated from the organization name (e.g., "AgenticMail" → agenticmail). Slugs are immutable after creation and used throughout the system for routing and identification. You can manually edit the slug during creation.

Active vs. Inactive

Organizations can be toggled active/inactive. Deactivating an organization effectively suspends all linked agents. The toggle endpoint is POST /api/organizations/{id}/toggle.

Agent Assignment

Agents are assigned to organizations via POST /api/agents/{id}/assign-org. An agent can belong to only one organization at a time. Assigning an agent that's currently in another org will move it. Unassigning returns the agent to the default (internal) org.

Creating Organizations

Form Fields

FieldRequiredDescription
NameYesDisplay name of the organization
SlugYesURL-safe identifier, auto-generated from name
Contact NameNoPrimary contact person
Contact EmailNoPrimary contact email address
DescriptionNoBrief description of the organization
Billing RateNoMonthly rate per agent (default: 0.00)
CurrencyNoUSD, EUR, GBP, NGN, CAD, or AUD (default: USD)
POST /api/organizations
Content-Type: application/json

{
  "name": "AgenticMail",
  "slug": "agenticmail",
  "contact_name": "Ope Olatunji",
  "contact_email": "ope@agenticmail.com",
  "description": "Enterprise client — Q1 2026 onboarding",
  "billing_rate_per_agent": 99.00,
  "currency": "USD"
}

Detail View

Clicking an organization card opens a detail modal with two tabs:

Agents Tab

Billing Tab

How billing works: Each agent's monthly cost is calculated from LLM token usage. Revenue is the billing rate you set. The difference is your margin. Setting a billing rate of $99/agent/month with $3 in token costs gives you a 97% margin.

Billing & Revenue Tracking

Billing data is loaded from two endpoints:

Custom per-agent rates are saved via PATCH /api/agents/{id} with a billingRate field. The effective rate for an agent is: custom rate if set, otherwise the org's default rate.

API Reference

EndpointMethodDescription
/api/organizationsGETList all organizations
/api/organizationsPOSTCreate a new organization
/api/organizations/{id}GETGet organization detail with linked agents
/api/organizations/{id}PATCHUpdate organization fields
/api/organizations/{id}DELETEDelete organization (must have 0 agents)
/api/organizations/{id}/togglePOSTToggle active/inactive status
/api/organizations/{id}/billing-summaryGETMonthly billing aggregation
/api/organizations/{id}/billingGETPer-agent billing records
/api/agents/{id}/assign-orgPOSTAssign agent to org
/api/agents/{id}/unassign-orgPOSTRemove agent from org
/api/agents/{id}PATCHUpdate agent billing rate

Best Practices

Troubleshooting

Cannot delete organization

Organizations can only be deleted when they have zero assigned agents. Unassign all agents first, then delete.

Agent shows "[assigned elsewhere]" in dropdown

The agent is currently assigned to a different organization. Assigning it to this org will remove it from the previous one.

Billing data shows $0.00 everywhere

Billing records are created as agents process tasks and accumulate token costs. New organizations will have empty billing until agents start working.

Deleting an organization is permanent. All billing history and configuration will be lost. Ensure you've exported any needed billing data before deletion.
AgenticMail Enterprise Documentation Report an issue