Internal admin API. Tenants are the underlying platform isolation boundary. SDK consumers should use sdk.organizations instead — it exposes the same concept with a simpler, developer-friendly interface.
Tenants
A Tenant is the top-level isolation boundary in cPod. All data, billing, configuration, and access control are scoped to a tenant. Each API key belongs to exactly one tenant, and data never crosses tenant boundaries.
Tenant management is restricted to platform administrators. Most application developers interact with a single tenant and do not need these APIs.
Tenant Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | auto | Prefixed ID: tnt-{ulid} |
name | string | yes | Human-readable tenant name |
slug | string | yes | URL-safe unique identifier (immutable after creation) |
plan | enum | yes | free | pro | enterprise |
status | enum | auto | active | suspended | pending_deletion |
settings.maxPods | number | no | Maximum number of concurrent pods |
settings.allowedRegions | string[] | no | Regions where data may reside |
settings.ssoEnabled | boolean | no | Whether SSO is enabled for this tenant |
settings.auditLogsEnabled | boolean | no | Whether audit logging is active |
createdAt | string | auto | ISO 8601 UTC |
updatedAt | string | auto | ISO 8601 UTC |
Get the Current Tenant
Retrieve the tenant associated with the current API key.
import { CpodClient } from '@cpod/sdk'
const sdk = CpodClient.fromEnv()
const tenant = await sdk.tenants.get('tnt-default')
console.log(tenant.name, tenant.plan, tenant.status)
// → "Acme Corp" "enterprise" "active"List Tenants
List all tenants accessible to the authenticated service account. Regular API keys only see their own tenant.
const result = await sdk.tenants.list({
plan: 'enterprise',
status: 'active',
limit: 50,
})
for (const tenant of result.items) {
console.log(tenant.id, tenant.name, tenant.plan)
}Update Tenant Settings
Update the name, plan, or settings of a tenant. The slug field is immutable.
const updated = await sdk.tenants.update('tnt-default', {
name: 'Acme Corporation',
settings: {
maxPods: 20,
ssoEnabled: true,
auditLogsEnabled: true,
allowedRegions: ['us-east-1', 'eu-west-1'],
},
})
console.log(updated.settings.ssoEnabled) // → trueCreate a Tenant
Creating tenants requires a super-admin service account. This operation is not available to standard API keys.
const tenant = await sdk.tenants.create({
name: 'Beta Corp',
slug: 'beta-corp',
plan: 'pro',
settings: {
maxPods: 5,
auditLogsEnabled: true,
},
})
console.log(tenant.id) // → "tnt-01HXYZ..."