Tenants are the top-level isolation unit in Pangolin. Each tenant has its own set of users, catalogs, and resources.
Base Endpoint: /api/v1/tenants
- Method:
GET - Path:
/api/v1/tenants - Auth: Root Access Token
- Parameters:
limit(query, optional): Max resultsoffset(query, optional): Pagination offset
curl -X GET http://localhost:8080/api/v1/tenants \
-H "Authorization: Bearer <root-token>"- Method:
POST - Path:
/api/v1/tenants - Auth: Root Access Token
- Body:
{ "name": "acme-corp" }
curl -X POST http://localhost:8080/api/v1/tenants \
-H "Authorization: Bearer <root-token>" \
-H "Content-Type: application/json" \
-d '{"name": "acme-corp"}'When a tenant is created, you usually create a tenant-admin user immediately after, or use the CLI which can do both.
The pangolin-admin CLI provides convenient commands for tenant management.
pangolin-admin list-tenantsYou can create a tenant and an optional admin user in one go.
# Create tenant only
pangolin-admin create-tenant --name "acme-corp"
# Create tenant AND admin user
pangolin-admin create-tenant \
--name "acme-corp" \
--admin-username "admin" \
--admin-password "securePass123"To perform operations on a specific tenant using the CLI:
pangolin-admin use "acme-corp"This sets the context for subsequent commands (like creating users or warehouses).
from pypangolin import PangolinClient
client = PangolinClient(uri="http://localhost:8080", username="root", password="root_password")
tenants = client.tenants.list()
for t in tenants:
print(t.name, t.id)new_tenant = client.tenants.create(name="acme-corp")
print(f"Created tenant: {new_tenant.id}")# Switch client context to specific tenant
client.tenants.switch("acme-corp")
# Subsequent calls now apply to acme-corp
client.users.list() - Log in as the Root User.
- Navigate to Tenants in the sidebar.
- List: You will see a table of all existing tenants.
- Create: Click the "Create Tenant" button.
- Enter the Tenant Name.
- (Optional) Enter Admin Username/Password to auto-provision an admin.
- Click Save.
- Switch Context: Click the "Switch" (or log-in) icon next to a tenant to switch your active session to that tenant.