Skip to main content
Version: 2.0.0


Creates a new tenant.


tenantData - An object that contains the information about the tenant. The payload is defined below.


key - A unique id by which Permit will identify the tenant. The tenant key must be url-friendly (slugified).
name - A descriptive name for the tenant.
description - optional - A longer description of the tenant.
attributes - optional - Arbitraty tenant attributes that will be used to enforce attribute-based access control policies.


import io.permit.sdk.openapi.models.TenantCreate;
import io.permit.sdk.openapi.models.TenantRead;

// optional attributes for attribute-based access control
HashMap<String, Object> tenantAttributes = new HashMap<>();
tenantAttributes.put("age", Integer.valueOf(50));
tenantAttributes.put("fav_color", "red");

TenantRead tenant = permit.api.tenants.create(
new TenantCreate("tesla", "Tesla Inc").withDescription("The car company")