Tenant Management

Tenants in Ema form a hierarchy. A root tenant sits at the top, and child tenants inherit configurations from their parent. This page covers the APIs for creating, querying, and managing tenants.

Tenant Hierarchy

Root Tenant
├── Child Tenant A
│ ├── Grandchild Tenant A1
│ └── Grandchild Tenant A2
└── Child Tenant B

Each tenant has its own set of AI Employees, workflows, dashboards, and users. Child tenants can inherit templates and configurations from their parent.

CreateTenant

Create a new child tenant under an existing parent tenant.

PropertyValue
URL/tenant.v1.TenantService/CreateTenant
HTTP MethodPOST
ProtocolgRPC-Web over HTTP

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/grpc-web+proto
x-grpc-webstringYes1

Request

FieldTypeRequiredDescription
tenant_namestringYesDisplay name for the new tenant
parent_idstringYesUUID of the parent tenant
admin_emailstringYesEmail address of the tenant admin

Response

FieldTypeDescription
tenant_idstringUUID of the newly created tenant

CreateTenantWithApiKey

Create a new child tenant and simultaneously generate an API key for it.

PropertyValue
URL/tenant.v1.TenantService/CreateTenantWithApiKey
HTTP MethodPOST
ProtocolgRPC-Web over HTTP

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/grpc-web+proto
x-grpc-webstringYes1

Request

FieldTypeRequiredDescription
tenant_namestringYesDisplay name for the new tenant
parent_idstringYesUUID of the parent tenant
admin_emailstringYesEmail address of the tenant admin

Response

FieldTypeDescription
tenant_idstringUUID of the newly created tenant
api_keystringAPI key for the new tenant

GetTenant

Retrieve details about a specific tenant.

PropertyValue
URL/tenant.v1.TenantService/GetTenant
HTTP MethodPOST
ProtocolgRPC-Web over HTTP

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/grpc-web+proto
x-grpc-webstringYes1

Request

FieldTypeRequiredDescription
tenant_idstringYesUUID of the tenant

Response

FieldTypeDescription
tenant_idstringUUID of the tenant
tenant_namestringDisplay name of the tenant
parent_idstringUUID of the parent tenant
admin_emailstringEmail of the tenant admin

GetUsers

Retrieve the list of users associated with a tenant.

PropertyValue
URL/api/get_users
HTTP MethodGET
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token

Response

Returns a list of user objects associated with the authenticated tenant.

FieldTypeDescription
usersarrayList of user objects
users[].idstringUUID of the user
users[].emailstringEmail address of the user
users[].rolestringRole of the user in the tenant

Last updated: Aug 13, 2026