Promote Preset
Promote a preset to a higher level in the hierarchy, making it available to a broader audience. This operation requires management permissions and moves the preset from its current scope to a higher scope level.
URL
(POST) /api/apps/presets/promote
PARAMETERS
JSON object in the request body:
Property | Description | Type |
---|---|---|
scope | The scope object. It limits resources that can be accessed. | object, Mandatory |
key | Unique identifier for the preset type | string, Mandatory |
id | Unique identifier of the preset to promote | string, Mandatory |
level | Target hierarchy level for promotion. If not specified, promotes to the next level in the hierarchy | string?, Optional |
Valid promotion paths:
User
→Resource
(if resource context is available)User
→Platform
Resource
→Platform
RESULTS
Property | Description | Type |
---|---|---|
id | Unique identifier for the preset (unchanged) | string |
name | Display name of the preset (unchanged) | string |
desc | Description of the preset (unchanged) | string? |
level | New hierarchical level after promotion | string |
entityId | New entity ID associated with the target level | int? |
content | JSON content of the preset configuration (unchanged) | string |
date | Promotion timestamp | string (ISO 8601) |
isDefault | Indicates if this preset was set as default at the new level | bool |
Example Request:
{
"scope": {},
"key": "editor.ui.settings",
"id": "abc123def456ghi789",
"level": "Resource"
}
Example Response:
{
"id": "abc123def456ghi789",
"name": "My Custom Editor Config",
"desc": "Dark theme with large font",
"level": "Resource",
"entityId": 12345,
"content": "{\"theme\":\"dark\",\"fontSize\":16,\"showLineNumbers\":true}",
"date": "2023-10-15T16:00:00Z",
"isDefault": true
}
Permission Requirements:
Requires management permissions
User must have access to both source and target scope levels
Promotion Behavior:
If the preset is the first at the target level, it becomes the default
Default presets cannot be promoted unless they are the last preset at the current level
The preset name must be unique at the target level
The preset's content and metadata remain unchanged except for level and timestamps
Validation Rules:
Target level must be higher in the hierarchy than the current level
Target level must be valid within the provided scope context
Preset name must not conflict with existing presets at the target level
Default preset restrictions apply for both source and target levels
Error Scenarios:
Preset not found or not accessible
Invalid target level for promotion path
Target level not higher than current level
Name conflicts with existing presets at target level
Insufficient management permissions for promotion
Attempt to promote protected default preset
Target level not available in current scope context