Get Sub Tenant Ids
import requests
url = "https://api.hydradb.com/tenants/sub_tenant_ids"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/tenants/sub_tenant_ids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.hydradb.com/tenants/sub_tenant_ids \
--header 'Authorization: Bearer <token>'{
"sub_tenant_ids": [
"sub_tenant_1234",
"sub_tenant_4567"
],
"message": "Successfully retrieved sub-tenant IDs"
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}Tenants
List Sub-Tenant IDs
List all sub-tenants that have indexed data under a tenant.
GET
/
tenants
/
sub_tenant_ids
Get Sub Tenant Ids
import requests
url = "https://api.hydradb.com/tenants/sub_tenant_ids"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/tenants/sub_tenant_ids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.hydradb.com/tenants/sub_tenant_ids \
--header 'Authorization: Bearer <token>'{
"sub_tenant_ids": [
"sub_tenant_1234",
"sub_tenant_4567"
],
"message": "Successfully retrieved sub-tenant IDs"
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}When to use it
- Audit – confirm which sub-tenants exist for compliance or usage reporting
- Bulk operations – iterate over sub-tenants to apply the same operation to each
- Dynamic UI – populate dropdowns or selectors in admin dashboards
Endpoint
- Auth: Bearer token
- Idempotency: Read-only
- Async: No
Example
curl 'https://api.hydradb.com/tenants/sub_tenant_ids?tenant_id=my_first_tenant' \
-H "Authorization: Bearer <your_api_key>"
const response = await client.tenant.getSubTenantIds({
tenant_id: "my_first_tenant"
});
const subTenantIds = response.sub_tenant_ids;
response = client.tenant.get_sub_tenant_ids(tenant_id="my_first_tenant")
sub_tenant_ids = response.sub_tenant_ids
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | The tenant to list sub-tenants for. |
Response
{
"sub_tenant_ids": ["engineering", "sales", "hr", "user_12345"],
"message": "Successfully retrieved sub-tenant IDs"
}
| Field | Description |
|---|---|
sub_tenant_ids | Array of unique sub-tenant IDs with indexed data. |
message | Human-readable status. |
Related endpoints
- Before this: Upload knowledge · Add memory – sub-tenants are created implicitly during ingestion
- Related: List data – browse content within a specific sub-tenant
Errors
Common codes:400 INVALID_PARAMETERS, 404 TENANT_NOT_FOUND. See Error Responses for the full list.
Read more: Essentials → Multi-Tenant SupportAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Unique identifier for the tenant/organization
Example:
"tenant_1234"
Response
Successful Response
Was this page helpful?
