Overview
Tenants are the top-level administrative units in Pulsar. Each tenant can have multiple namespaces and represents an organization or team. The Tenants API allows you to create, configure, and manage tenants. Base Path:/admin/v2/tenants
List Tenants
Get the list of all existing tenants in the cluster.Response
List of tenant names
Example
Response Example
Get Tenant Info
Retrieve the configuration for a specific tenant.Path Parameters
The tenant name
Response
List of admin roles for this tenant
List of clusters this tenant is allowed to use
Example
Response Example
Create Tenant
Create a new tenant with the specified configuration.Path Parameters
The tenant name to create. Must be a valid identifier without ’/’ characters.
Request Body
List of roles that have admin access to this tenant
List of clusters this tenant can use. Cannot be empty.
Example
Response Codes
| Code | Description |
|---|---|
| 204 | Tenant created successfully |
| 403 | Don’t have admin permissions |
| 409 | Tenant already exists |
| 412 | Invalid tenant name or clusters don’t exist |
Update Tenant
Update the configuration of an existing tenant.Path Parameters
The tenant name to update
Request Body
Updated list of admin roles
Updated list of allowed clusters
Example
Response Codes
| Code | Description |
|---|---|
| 204 | Tenant updated successfully |
| 403 | Don’t have admin permissions |
| 404 | Tenant doesn’t exist |
| 412 | Invalid configuration or clusters don’t exist |
Delete Tenant
Delete a tenant and all its namespaces and topics.Path Parameters
The tenant name to delete
Query Parameters
Force delete even if namespaces exist
Example
Response Codes
| Code | Description |
|---|---|
| 204 | Tenant deleted successfully |
| 403 | Don’t have admin permissions |
| 404 | Tenant doesn’t exist |
| 409 | Tenant has active namespaces (use force=true) |
Error Handling
Common Errors
403 - Permission Denied
403 - Permission Denied
You don’t have super-user or tenant admin privileges.Solution: Ensure you’re authenticated with proper credentials.
409 - Tenant Already Exists
409 - Tenant Already Exists
A tenant with this name already exists.Solution: Choose a different name or update the existing tenant.
412 - Invalid Tenant Name
412 - Invalid Tenant Name
The tenant name contains invalid characters.Solution: Use only alphanumeric characters, hyphens, and underscores.
412 - Clusters Don't Exist
412 - Clusters Don't Exist
One or more specified clusters don’t exist.Solution: Verify cluster names and create missing clusters first.
Best Practices
Naming Conventions
- Use lowercase names for consistency
- Avoid special characters except hyphens and underscores
- Use descriptive names that reflect the organization or team
Cluster Assignment
- Assign tenants to appropriate clusters based on geographic location
- Consider data residency and compliance requirements
- Plan for multi-region deployments
Role Management
- Use the principle of least privilege
- Create specific roles for different administrative levels
- Regularly review and update admin roles
Tenant Lifecycle
- Create: Define tenant with appropriate clusters
- Configure: Set up namespaces and policies
- Monitor: Track usage and performance
- Update: Adjust configuration as needs change
- Delete: Clean up when no longer needed
Related Resources
Namespaces API
Manage namespaces within tenants
Clusters API
Configure cluster settings