Create AI Prompt-Decorator Preset
Endpoint
POST /apiops/settings/ai-prompt-decorator-presets/{presetName}/
Authentication
Requires a Personal API Access Token with admin privileges.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| presetName | string | Yes | Name of the preset. Must match the name in the body when that field is present. |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| projectId | string | No | admin | Scope the preset is created in. Omit for the admin/global scope, which every project can then import from. |
Request Body
{
"name": "support-tone",
"content": "Answer in a calm, professional tone and always offer a next step.",
"role": "system",
"position": "PREPEND",
"category": "tone",
"description": "House style for support assistants",
"enabled": true
}
Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | No | Preset name. Defaults to presetName from the path when omitted; must match it otherwise. |
| content | string | Yes | Instruction text injected into the request's message list |
| role | string | No | system (default), user or assistant |
| position | string | No | PREPEND (default) or APPEND |
| category | string | No | Optional category label |
| description | string | No | Optional description for display |
| enabled | boolean | No | Defaults to true |
id, projectId and builtIn in the body are ignored — the scope comes from the projectId query parameter and builtIn is server-owned, so a client cannot forge a built-in preset.
Response
Success Response (200 OK)
{
"status": "SUCCESS"
}
Error Response (400 Bad Request)
Returned for a name mismatch, a missing content, an invalid role/position, a name that collides with an already visible preset, an attempt to overwrite a built-in preset, or a caller without the ADMIN role.
{
"status": "FAILURE",
"resultMessage": "AI prompt-decorator preset name in path (support-tone) does not match name in body (supportTone)!"
}
{
"status": "FAILURE",
"resultMessage": "Built-in presets are read-only"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/settings/ai-prompt-decorator-presets/support-tone/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Answer in a calm, professional tone and always offer a next step.",
"role": "system",
"position": "PREPEND",
"category": "tone",
"description": "House style for support assistants",
"enabled": true
}'
Notes and Warnings
- Upsert by Name:
- When a non-built-in preset with the same name already exists in the scope it is updated rather than duplicated — the call is safe to repeat from a CI/CD pipeline
- Validation:
contentis required — an empty block would silently do nothing once imported into a policy- Blank
role/positionnormalize tosystem/PREPEND; any other value is rejected
- Name Uniqueness:
- Names must be unique across the caller's visible set, so a project cannot shadow a built-in or admin-shared preset name
- No Redeploy Implied:
- Policies import presets as copies; creating or updating a preset never changes an already-deployed policy
Related Documentation
- Update AI Prompt-Decorator Preset - Update an existing preset
- Delete AI Prompt-Decorator Preset - Delete a preset
- AI Prompt-Decorator Presets API - Resource overview