Update tenant policy bundle
PUT/tenants/{tenant_id}/policies
Replaces the tenant's policy bundle. Fields not included in the request revert to platform defaults. Changes are immediately effective and audit-logged. Use when onboarding a tenant to a new plan, enabling/disabling modules mid-term, or applying data governance overrides.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | The tenant identifier. |
Request body
Content type application/json (required).
| Field | Type | Required | Description |
|---|---|---|---|
tenant_id | string | No | The tenant this policy bundle applies to (present on responses). |
modules | map of boolean | No | Map of module slug to enabled/disabled boolean. |
feature_flags | object | No | Map of feature flag key to its value (boolean, string, or integer). |
retention | object | No | Data retention override settings. |
retention.audit_log_days | integer | No | Number of days to retain audit log entries. |
retention.activity_log_days | integer | No | Number of days to retain activity log entries. |
updated_at | string (date-time) | No | Timestamp of the last policy bundle update (present on responses). |
Example
{
"modules": {
"sales": true,
"support": true,
"omnichannel": true,
"payroll": true
},
"feature_flags": {
"ai_copilot_enabled": true,
"ewa_enabled": true
},
"retention": {
"audit_log_days": 730,
"activity_log_days": 365
}
}
Responses
200 Tenant policy bundle updated
Content type application/json, object · TenantPolicyBundleV1.
| Field | Type | Required | Description |
|---|---|---|---|
tenant_id | string | No | The tenant this policy bundle applies to (present on responses). |
modules | map of boolean | No | Map of module slug to enabled/disabled boolean. |
feature_flags | object | No | Map of feature flag key to its value (boolean, string, or integer). |
retention | object | No | Data retention override settings. |
retention.audit_log_days | integer | No | Number of days to retain audit log entries. |
retention.activity_log_days | integer | No | Number of days to retain activity log entries. |
updated_at | string (date-time) | No | Timestamp of the last policy bundle update (present on responses). |
404 Tenant not found
422 Validation failed — check module keys or retention values
Example request
Paths are relative to the control-plane API base URL ($BASE_URL below).
curl -X PUT "$BASE_URL/tenants/{tenant_id}/policies" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"modules": {"sales": true, "support": true, "omnichannel": true, "payroll": true}, "feature_flags": {"ai_copilot_enabled": true, "ewa_enabled": true}, "retention": {"audit_log_days": 730, "activity_log_days": 365}}'