Skip to content

A tenant is your customer inside Truto: an ID you choose, like acme-corp, that every account the customer connects rolls up under.

Skip the reading — fast path for coding agents
CLI
truto tenants list
Skill
View truto skill on GitHub Cursor / Claude Code: /skill truto

What a tenant is

A tenant is a lightweight, environment-scoped object that groups all the integrated accounts belonging to one of your end-users. You choose the ID — a string like acme-corp, usr_1a2b3c, or the UUID your own database uses — and Truto keeps that same ID with the tenant across every integration your user connects.

One tenant can own many integrated accounts: your customer "Acme Corp" might connect HubSpot, Salesforce, and Slack, and each of those becomes an integrated account under the same tenant. Filtering GET /integrated-account?tenant_id=acme-corp returns all three.

Tenants and environments

Tenants are scoped to an environment. The same tenant_id value can exist in development, staging, and production independently — three separate tenants with three separate sets of integrated accounts. That's the same isolation model as Environments: what's in one environment isn't in the others.

A tenant is identified by its ID and its environment. The dashboard handles environment scoping automatically; API tokens are bound to a single environment, so you don't need to pass environment_id manually in API calls.

Tenant IDs

You pick the ID. Truto accepts any string up to 255 characters, except control characters (newlines included), leading or trailing whitespace, and the IDs . and ... Slashes, spaces and other separators are allowed. When you put an ID in a URL path such as /tenant/:id, URL-encode it — org/4567 becomes /tenant/org%2F4567.

Common choices:

  • The primary key from your own users/organizations table (user_1a2b3c, org-4567).
  • A slug your customer will recognize (acme-corp).
  • The email domain, when you have one tenant per company (acme.com).

Whatever you pick, treat it as immutable: it's referenced by every integrated account owned by that tenant, every link token created against it, and every integrated-account webhook payload.

Where tenants come from

There are three ways a tenant appears in Truto:

  • You create it — in the dashboard, with POST /tenant, with truto tenants create, or in bulk (Bulk import). This is the recommended path when you're onboarding a new customer.
  • Truto creates it when an account is created for it — the customer's first successful connection, a POST /integrated-account, or a PATCH /integrated-account/:id that moves an account to a new tenant_id. Creating a link token alone doesn't. The tenant is created a moment after the account, and only for IDs that match the rules above.
  • Truto creates it when you mint a widget session — POST /session-token with create_tenant_if_missing: true. Without that flag, minting a Connections widget session for a tenant that doesn't exist answers 404 Tenant not found.

Explicitly creating tenants first gives you a place to attach metadata (tier, region, billing plan) before the customer connects anything. If you don't need that, letting Truto auto-create them is fine.

Metadata

Tenants carry a free-form JSON metadata object, stored as sent. Use it for your own fields, such as tier, region or plan:

{
  "tier": "gold",
  "region": "wnam",
  "signed_up_at": "2026-06-01",
  "billing_email": "billing@acme.com"
}

Metadata is returned on every GET /tenant / GET /tenant/:id.

Metadata also drives Who can see this: an integration with a visibility rule is listed in the Connect UI and the Connections widget only for tenants whose metadata matches the rule, and a widget attempt to connect it for any other tenant answers 404 Integration not found. Reconnecting an account the tenant already has isn't affected. See Connections widget.

Managing tenants

  • Dashboard — the Tenants list. Search by name or ID, sort by name or creation date, and click an account count to see those accounts. Edit or delete a tenant from its row's … menu, and add many at once with Bulk import. A tenant's page lists its integrated accounts (with bulk delete) and lets you edit its name and metadata. When you connect an account from the dashboard, Existing tenant (optional) lets you pick a tenant.
  • API — POST /tenant, GET /tenant, GET /tenant/:id, PATCH /tenant/:id, DELETE /tenant/:id, and POST /tenant/bulk. Each tenant in a GET /tenant list includes account_count. To search by name, use GET /tenant?name[like]=%25acme%25. See Creating tenants and Deleting tenants.
  • CLI — truto tenants ..., including truto tenants create-bulk for batch imports.

FAQ

Can the same tenant_id appear in multiple environments? Yes. acme-corp in development, staging, and production are three separate tenants with three separate sets of accounts — that's the environment isolation model.

Do I have to create the tenant before my customer connects an account? Not for the Connect UI: Truto creates the tenant when the account connects, as long as the ID matches the rules above. For the Connections widget, yes: create it first, or pass create_tenant_if_missing: true when you mint the session token.

What if my legacy tenant IDs have characters like / in them? They work. Slashes, spaces and other separators are valid in tenant IDs, and auto-create materializes a tenant for them; URL-encode the ID when you call /tenant/:id. Auto-create only skips IDs that can't be valid tenant IDs — longer than 255 characters, containing control characters, with leading or trailing whitespace, or exactly . or ... Those still work as strings on integrated accounts, but Truto won't create a tenant for them. Migrate to a compatible ID (or create the tenant explicitly with a compatible ID and re-point the account) to get first-class tenant management.

Can I rename a tenant's ID? No. You can change the display name and metadata on PATCH /tenant/:id, but the ID is immutable. If you need a different ID, create a new tenant and migrate integrated accounts to it before deleting the old one.

Can I delete a tenant with integrated accounts? No — the API returns 409 Conflict. Delete the accounts first (or POST /integrated-account/bulk-delete with tenant_id), then delete the tenant. See Deleting tenants.

Next

Create your first tenant, with its metadata, in Creating tenants, or load a list of customers at once with Bulk import.