Set a preset as the default for its scope level. This operation removes the default flag from other presets at the same scope level and sets the specified preset as the new default.
URL
(POST) /api/apps/settings/presets/default
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 set as default |
string, Mandatory |
RESULTS
|
Property |
Description |
Type |
|---|---|---|
|
updated |
The preset that was set as default |
PresetModel |
|
defaultsRemoved |
Array of presets that had their default flag removed |
PresetModel[] |
PresetModel Structure:
|
Property |
Description |
Type |
|---|---|---|
|
id |
Unique identifier for the preset |
string |
|
name |
Display name of the preset |
string |
|
desc |
Optional description of the preset |
string? |
|
level |
Hierarchical level where the preset is stored |
string |
|
entityId |
Entity ID associated with the preset level (null for Platform level) |
int? |
|
content |
JSON content of the preset configuration |
string |
|
date |
Creation or last modification timestamp |
string (ISO 8601) |
|
isDefault |
Indicates if this preset is the default for its scope level |
bool |
Example Request:
{
"scope": {},
"key": "editor.ui.settings",
"id": "abc123def456ghi789"
}
Example Response:
{
"updated": {
"id": "abc123def456ghi789",
"name": "My Custom Editor Config",
"desc": "Dark theme with large font",
"level": "User",
"entityId": 1001,
"content": "{\"theme\":\"dark\",\"fontSize\":16,\"showLineNumbers\":true}",
"date": "2023-10-15T16:30:00Z",
"isDefault": true
},
"defaultsRemoved": [
{
"id": "xyz789uvw012mno345",
"name": "Previous Default",
"desc": "Old default configuration",
"level": "User",
"entityId": 1001,
"content": "{\"theme\":\"light\",\"fontSize\":12}",
"date": "2023-10-10T10:00:00Z",
"isDefault": false
}
]
}
Permission Requirements:
-
User Level Presets: Can be set as default by the owner
-
Resource/Platform Level Presets: Require management permissions
Behavior:
-
Only one preset per scope level can be marked as default for each key
-
Setting a new default automatically removes the default flag from other presets at the same level
-
The operation is atomic - either all changes succeed or none are applied
Error Scenarios:
-
Preset not found or not accessible
-
Invalid preset ID or key provided
-
Insufficient permissions to set preset as default
-
User attempting to set default for presets they don't own (User level)
-
Management permissions required for Resource/Platform level defaults