Hit the
Try it
button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.Sample Request
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.
Rate Limiting: While this API is efficient, avoid calling it excessively in production applications. Consider caching the results for a reasonable period if you need frequent access to this data.
Error Responses
All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Example:
"tenant_1234"
Response
Successful Response
The tenant ID that was queried
Example:
"tenant_1234"
Array of all sub-tenant IDs within the tenant
Example:
["sub_tenant_1234", "sub_tenant_4567"]
Total number of sub-tenants found
Required range:
x >= 0
Example:
1
Schema configuration for the tenant collection
Example:
{
"properties": [
{
"field_name": "field_1",
"index_filterable": true,
"index_searchable": true
},
{
"field_name": "field_2",
"index_filterable": false,
"index_searchable": true
}
]
}
Indicates whether the sub-tenant retrieval was successful
Example:
true
Response message describing the operation result