Moonborn — API · config
Apply a registered preset to a scope
POST/v1/config/presets/{presetId}/applyscope · Bearer (API key or session JWT)
Path parameters
| Field | Type | Description |
|---|---|---|
| presetIdreq | string |
Request body
| Field | Type | Description |
|---|---|---|
| scopereq | object | |
| scope.levelreq | string · "system" | "env" | "plan" | "org" | "workspace" | "user" | "api_key" | "request" | |
| scope.id | string | default: "" |
Responses
200Preset applied
Body
| Field | Type | Description |
|---|---|---|
| appliedreq | number | |
| eventsreq | object[] |
401Unauthenticated
Body
| Field | Type | Description |
|---|---|---|
| typereq | string | |
| titlereq | string | |
| statusreq | number | |
| detail | string | |
| code | string |
403Forbidden
Body
| Field | Type | Description |
|---|---|---|
| typereq | string | |
| titlereq | string | |
| statusreq | number | |
| detail | string | |
| code | string |
404Preset not found
Body
| Field | Type | Description |
|---|---|---|
| typereq | string | |
| titlereq | string | |
| statusreq | number | |
| detail | string | |
| code | string |
422Validation failure
Body
| Field | Type | Description |
|---|---|---|
| typereq | string | |
| titlereq | string | |
| statusreq | number | |
| detail | string | |
| code | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/config/presets/<presetId>/apply \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scope": {
"level": "system"
}
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.config.applyConfigPreset({
presetId: '<presetId>',
scope: {"level":"system"},
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.config.apply_config_preset(
presetId="<presetId>",
scope={"level":"system"},
)