Examples
- API Request
- TypeScript
- Python (Sync)
Use Cases
Tenant Administration
- Audit Sub-Tenants: Get a complete list of all sub-tenants in your organization
- Monitor Usage: Track how many sub-tenants are actively being used
- Data Management: Understand the scope of your multi-tenant setup
Application Development
- Dynamic UI: Build interfaces that adapt based on available sub-tenants
- Access Control: Implement role-based access by checking available sub-tenants
- Analytics: Generate reports on sub-tenant usage and distribution
Integration Scenarios
- Bulk Operations: Perform operations across multiple sub-tenants
- Migration: Plan data migration or consolidation across sub-tenants
- Compliance: Generate compliance reports showing data distribution
Query Parameters
- tenant_id (required): The primary tenant ID to fetch sub-tenant IDs for
Response Format
The endpoint returns a structured response containing:- tenant_id: The tenant ID that was queried
- sub_tenant_ids: Array of all sub-tenant IDs within the tenant
- count: Total number of sub-tenants found
- message: Success message with additional context
Example Request
Example Response
Response Details
Sub-Tenant ID Types
The response may include different types of sub-tenant IDs: Default Sub-Tenant:"default"- The automatically created default sub-tenant
"engineering","sales","marketing"- Organizational departments
"user_12345","user_67890"- Individual user workspaces (B2C applications)
"project_alpha","client_beta"- Project or client-specific workspaces
Understanding the Count
Thecount field represents the total number of sub-tenants, including:
- The default sub-tenant (always present)
- All custom sub-tenants created through uploads
- Any sub-tenants created through other API operations
Default Sub-Tenant: Every tenant automatically has a “default” sub-tenant that serves as the organization-wide workspace. This will always be included in the sub-tenant IDs list.
Error Handling
Common Error Scenarios
Invalid Tenant ID:Performance: This API provides real-time data directly from the underlying data store, ensuring you always get the most current list of sub-tenants.
Error Responses
All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.Authorizations
Query Parameters
Example: