MATIH Platform is in active MVP development. Documentation reflects current implementation status.
7. Tenant Lifecycle
Resource Endpoints

Resource Endpoints

The resource quota endpoints manage tenant resource limits and usage tracking. Quotas are enforced per resource type with configurable soft and hard limits. Served by ResourceQuotaController at /api/v1/tenants/:tenantId/quotas.


Endpoints

MethodEndpointDescription
POST.../quotas/defaultsCreate default quotas for tier
POST.../quotasCreate or update a quota
GET.../quotasGet all quotas
GET.../quotas/:resourceTypeGet specific quota
GET.../quotas/summaryGet quota summary with usage
POST.../quotas/usageRecord resource usage
GET.../quotas/:resourceType/checkCheck quota availability
GET.../quotas/:resourceType/usage/historyGet usage history
GET.../quotas/:resourceType/usage/trendGet usage trend data

Resource Types

TypeDescription
CPUCPU cores allocation
MEMORYMemory in GB
STORAGEStorage in GB
USERSMaximum user accounts
API_CALLSAPI call count per period
QUERIESQuery execution count per period
DASHBOARDSMaximum dashboard count
DATA_SOURCESMaximum data source connections

Recording Usage

POST .../quotas/usage
{
  "resourceType": "API_CALLS",
  "amount": 1,
  "metadata": {
    "endpoint": "/v1/queries/execute",
    "source": "bi-workbench"
  }
}
StatusDescription
200Usage recorded, within limits
403Hard quota exceeded, request rejected

The response includes accepted, currentUsage, quotaLimit, and utilizationPercent.


Usage Trends

GET .../quotas/API_CALLS/usage/trend?interval=day&start=2026-01-01T00:00:00Z
ParameterTypeDefaultDescription
intervalstringdayAggregation interval: hour, day, week
startInstant30 days agoStart of the trend period
endInstantNowEnd of the trend period