Tenant API
This content is not available in your language yet.
This page documents every tenant-level operation: fetching your tenant, creating one, updating settings, deleting it, and generating an API key. See Multi-Tenancy for the conceptual model (what a tenant is, how row-level isolation works) and Authentication for the full JWT/API-key auth model — this page cross-links there rather than repeating it.
Every request must include the x-huat-platform: customer header.
myTenant
Section titled “myTenant”Returns the tenant belonging to the authenticated caller.
Auth required: JWT (AuthJwtGuard).
Arguments: None.
Returns: TenantDto (nullable — returns null for a user not yet assigned to a tenant, e.g. immediately after register)
| Field | Type | Notes |
|---|---|---|
id | Int! | |
name | String! | |
plan | TenantPlanEnum! | DEV, PRO, or ENTERPRISE |
isSuspended | Boolean! | |
llmProviderOverride | LlmProviderType | Pilot — tenant-wide default LLM provider for every agent that has no agent-level override of its own. See Agents: LLM provider override. |
llmModelOverride | String | Pilot — only meaningful when llmProviderOverride is BEDROCK_MANTLE. Same section. |
primaryBillingAccount | PrimaryBillingAccountEnum! | WEBBYX_ONE or WETEL — which system bills this tenant’s usage. Set via setPrimaryBillingAccount. |
createdAt | DateTime! | |
updatedAt | DateTime! | |
deletedAt | DateTime | Set once the tenant has been soft-deleted |
Example request:
query MyTenant { myTenant { id name plan isSuspended }}curl https://api.wetel.dev/graphql \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -d '{"query":"query { myTenant { id name plan isSuspended } }"}'Example response:
{ "data": { "myTenant": { "id": 7, "name": "Acme Support", "plan": "PRO", "isSuspended": false } }}createTenant
Section titled “createTenant”Creates a new tenant.
Auth required: JWT (AuthJwtGuard).
Arguments:
| Argument | Type | Required |
|---|---|---|
input | CreateTenantInput! | Yes |
CreateTenantInput:
| Field | Type | Notes |
|---|---|---|
name | String! | Required |
plan | TenantPlanEnum | Optional — DEV, PRO, or ENTERPRISE |
region | String | Optional |
llmProviderOverride | LlmProviderType | Optional, pilot — see Agents: LLM provider override. |
llmModelOverride | String | Optional, pilot — same section. |
Returns: TenantDto! (see shape above)
Example:
mutation CreateTenant($input: CreateTenantInput!) { createTenant(input: $input) { id name plan }}{ "input": { "name": "Acme Support", "plan": "DEV" } }updateTenant
Section titled “updateTenant”Updates the caller’s own tenant.
Auth required: JWT (AuthJwtGuard).
Arguments:
| Argument | Type | Required |
|---|---|---|
input | UpdateTenantInput! | Yes |
UpdateTenantInput (every field optional — send only what is changing):
| Field | Type | Notes |
|---|---|---|
name | String | |
plan | TenantPlanEnum | |
region | String | |
isSuspended | Boolean | |
llmProviderOverride | LlmProviderType | Pilot — supports detach-to-default: omit to leave unchanged, send null to clear. See Agents: LLM provider override. |
llmModelOverride | String | Pilot — same detach-to-default behavior. |
Returns: TenantDto!
Example:
mutation UpdateTenant($input: UpdateTenantInput!) { updateTenant(input: $input) { id name plan }}{ "input": { "name": "Acme Support Inc." } }deleteTenant
Section titled “deleteTenant”Soft-deletes the caller’s own tenant.
Auth required: JWT (AuthJwtGuard).
Arguments: None.
Returns: Boolean!
Example:
mutation DeleteTenant { deleteTenant}curl https://api.wetel.dev/graphql \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -d '{"query":"mutation { deleteTenant }"}'generateApiKey
Section titled “generateApiKey”Generates a new API key for the current tenant, for authenticating server-to-server operations that don’t use a JWT (for example, the embed SDK’s sdkStart entry point, or the embed query).
For the full picture of how API keys fit into the overall auth model (JWT vs. API key vs. avatar token), see Authentication.
Auth required: JWT (AuthJwtGuard).
Arguments: None.
Returns: GenerateApiKeyResult!
| Field | Type | Notes |
|---|---|---|
key | String! | The raw API key — shown only this once |
warning | String! | A human-readable reminder about one-time visibility and invalidation of the previous key |
Example request:
mutation GenerateApiKey { generateApiKey { key warning }}curl https://api.wetel.dev/graphql \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -d '{"query":"mutation { generateApiKey { key warning } }"}'Example response:
{ "data": { "generateApiKey": { "key": "<YOUR_API_KEY>", "warning": "Store this key now — it will not be shown again, and generating a new key invalidates this one immediately." } }}apiUsageSummary
Section titled “apiUsageSummary”Returns this month’s LLM spend for the caller’s own tenant, the tenant’s monthly spend cap (by plan tier — see LLM API: Monthly spend cap), and a call-count breakdown by model and operation. Backs the dashboard’s Developers page.
Covers all of the tenant’s LLM usage — agent sessions, workflow runs, evaluation, and the LLM API — not just one source. It cannot be broken down by individual named API key; usage is tracked per-tenant only (AiUsageEntity has no apiKeyId column today).
Auth required: JWT (AuthJwtGuard).
Arguments: None.
Returns: ApiUsageSummaryDto!
| Field | Type | Notes |
|---|---|---|
costThisMonthUsd | Float! | This tenant’s total LLM spend so far this calendar month, across all sources. |
monthlySpendCapUsd | Float! | The plan-tier cap this tenant is measured against — same limit generateText/startTextGeneration enforce. |
breakdown | [ApiUsageBreakdownItemDto!]! | One row per (model, operation) pair seen for this tenant’s lifetime (not scoped to this month), each with a count. |
Example request:
query ApiUsageSummary { apiUsageSummary { costThisMonthUsd monthlySpendCapUsd breakdown { model operation count } }}curl https://api.wetel.dev/graphql \ -H "Content-Type: application/json" \ -H "x-huat-platform: customer" \ -H "Authorization: Bearer <YOUR_JWT>" \ -d '{"query":"query { apiUsageSummary { costThisMonthUsd monthlySpendCapUsd breakdown { model operation count } } }"}'For creating and configuring the agents that live inside a tenant, see Agents. For the full signup-to-first-agent walkthrough, see Getting Started.