Update an existing preset with new name, description, or content. The preset's hierarchy level and entity associations cannot be changed through this endpoint (use promotion for level changes).
URL
(POST) /api/apps/settings/presets/update
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 update |
string, Mandatory |
|
name |
New display name for the preset |
string, Mandatory |
|
description |
New description for the preset |
string?, Optional |
|
content |
New JSON configuration data (must be valid JSON) |
string, Mandatory |
RESULTS
|
Property |
Description |
Type |
|---|---|---|
|
id |
Unique identifier for the preset |
string |
|
name |
Updated display name of the preset |
string |
|
description |
Updated description of the preset |
string? |
|
level |
Hierarchical level where the preset is stored (unchanged) |
string |
|
entityId |
Entity ID associated with the preset level (unchanged) |
int? |
|
content |
Updated JSON content of the preset configuration |
string |
|
date |
Modification timestamp |
string (ISO 8601) |
|
isDefault |
Indicates if this preset is the default for its scope level (unchanged) |
bool |
Example Request:
{
"scope": {},
"key": "editor.ui.settings",
"id": "abc123def456ghi789",
"name": "Updated Editor Config",
"description": "Modified dark theme with medium font",
"content": "{\"theme\":\"dark\",\"fontSize\":14,\"showLineNumbers\":true,\"wordWrap\":true}"
}
Example Response:
{
"id": "abc123def456ghi789",
"name": "Updated Editor Config",
"description": "Modified dark theme with medium font",
"level": "User",
"entityId": 1001,
"content": "{\"theme\":\"dark\",\"fontSize\":14,\"showLineNumbers\":true,\"wordWrap\":true}",
"date": "2023-10-15T15:45:00Z",
"isDefault": true
}
Permission Requirements:
-
User Level Presets: Can only be updated by the owner
-
Resource/Platform Level Presets: Require management permissions
Validation Rules:
-
Preset must exist and be accessible to the user
-
Name must be unique within the same scope level (excluding the preset being updated)
-
Content must be valid JSON
-
All text fields are trimmed of whitespace
Error Scenarios:
-
Preset not found or not accessible to the user
-
Invalid JSON content provided
-
Duplicate name at the same scope level
-
Insufficient permissions to update the preset
-
Content exceeds maximum size limits
-
Required fields missing or invalid