Skip to content

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.

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)

FieldTypeNotes
idInt!
nameString!
planTenantPlanEnum!DEV, PRO, or ENTERPRISE
isSuspendedBoolean!
llmProviderOverrideLlmProviderTypePilot — tenant-wide default LLM provider for every agent that has no agent-level override of its own. See Agents: LLM provider override.
llmModelOverrideStringPilot — only meaningful when llmProviderOverride is BEDROCK_MANTLE. Same section.
primaryBillingAccountPrimaryBillingAccountEnum!WEBBYX_ONE or WETEL — which system bills this tenant’s usage. Set via setPrimaryBillingAccount.
createdAtDateTime!
updatedAtDateTime!
deletedAtDateTimeSet once the tenant has been soft-deleted

Example request:

query MyTenant {
myTenant {
id
name
plan
isSuspended
}
}
Terminal window
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
}
}
}

Creates a new tenant.

Auth required: JWT (AuthJwtGuard).

Arguments:

ArgumentTypeRequired
inputCreateTenantInput!Yes

CreateTenantInput:

FieldTypeNotes
nameString!Required
planTenantPlanEnumOptional — DEV, PRO, or ENTERPRISE
regionStringOptional
llmProviderOverrideLlmProviderTypeOptional, pilot — see Agents: LLM provider override.
llmModelOverrideStringOptional, 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" } }

Updates the caller’s own tenant.

Auth required: JWT (AuthJwtGuard).

Arguments:

ArgumentTypeRequired
inputUpdateTenantInput!Yes

UpdateTenantInput (every field optional — send only what is changing):

FieldTypeNotes
nameString
planTenantPlanEnum
regionString
isSuspendedBoolean
llmProviderOverrideLlmProviderTypePilot — supports detach-to-default: omit to leave unchanged, send null to clear. See Agents: LLM provider override.
llmModelOverrideStringPilot — same detach-to-default behavior.

Returns: TenantDto!

Example:

mutation UpdateTenant($input: UpdateTenantInput!) {
updateTenant(input: $input) {
id
name
plan
}
}
{ "input": { "name": "Acme Support Inc." } }

Soft-deletes the caller’s own tenant.

Auth required: JWT (AuthJwtGuard).

Arguments: None.

Returns: Boolean!

Example:

mutation DeleteTenant {
deleteTenant
}
Terminal window
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 }"}'

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!

FieldTypeNotes
keyString!The raw API key — shown only this once
warningString!A human-readable reminder about one-time visibility and invalidation of the previous key

Example request:

mutation GenerateApiKey {
generateApiKey {
key
warning
}
}
Terminal window
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."
}
}
}

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!

FieldTypeNotes
costThisMonthUsdFloat!This tenant’s total LLM spend so far this calendar month, across all sources.
monthlySpendCapUsdFloat!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
}
}
}
Terminal window
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.