create #
Creates a new soft tenant within an existing tenant.
Soft tenants allow for a secondary level of partitioning within a main tenant's index. They are defined by a unique name and custom metadata.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/multi-tenancy/tenant/:tenantId/soft-tenants
Method: POSTOther protocols #
{
"controller": "multi-tenancy/soft-tenant",
"action": "create",
"tenantId": "teacher-liia",
"name": "Class A",
"metadata": {
"geolocation": {
"lon":43,
"lat":7
}
}
}Arguments #
- `tenantId`: (URL Argument) The unique identifier of the parent tenant.
- `name`: Name of the soft tenant.
- `_id`: (Optional) Custom identifier. If not provided, a kebab-case version of the name will be generated.
- `metadata`: (Optional) A JSON object containing custom properties for the soft tenant.
Response #
Returns the created soft tenant object: - id: The unique identifier of the soft tenant. - name: The name of the soft tenant.
metadata: The custom metadata object associated with the soft tenant.
JavaScript
{
"status": 200,
"error": null,
"action": "create",
"controller": "multi-tenancy/soft-tenant",
"requestId": "<unique request identifier>",
"result": {
"id": "class-a",
"name": "Class A",
"metadata": {
"geolocation": {
"lon":43,
"lat":7
}
}
}
}