Ana içeriğe geç

Update AI Prompt-Decorator Preset

Endpoint

PUT /apiops/settings/ai-prompt-decorator-presets/{presetName}/

Authentication

Requires a Personal API Access Token with admin privileges.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
presetNamestringYesName of the preset to update. Must match the name in the body when that field is present.

Query Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringNoadminScope the preset lives in. Omit for the admin/global scope.

Request Body

{
"name": "support-tone",
"content": "Answer in a calm, professional tone, always offer a next step, and never promise a delivery date.",
"role": "system",
"position": "PREPEND",
"category": "tone",
"description": "House style for support assistants",
"enabled": true
}

The body carries the same fields as Create AI Prompt-Decorator Preset. The whole preset is replaced, so send every field you want to keep — an omitted optional field is cleared, not preserved.

Response

Success Response (200 OK)

{
"status": "SUCCESS"
}

Error Response (400 Bad Request)

Returned when the preset does not exist in the scope, the path and body names disagree, content is missing, role/position is invalid, the target is a built-in preset, or the caller lacks the ADMIN role.

{
"status": "FAILURE",
"resultMessage": "AI prompt-decorator preset (name: support-tone) was not found!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X PUT \
"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, always offer a next step, and never promise a delivery date.",
"role": "system",
"position": "PREPEND",
"enabled": true
}'

Notes and Warnings

  • Must Already Exist:
    • Unlike POST, this endpoint does not create a missing preset — it reports not-found instead
  • Full Replacement:
    • Optional fields left out of the body are cleared
  • Built-in Presets:
    • Rows with builtIn: true are read-only and reject this call
  • No Redeploy Implied:
    • Blocks BOUND to this preset are updated in place with the new position, role and content, and the affected deployments are flagged redeployRequired so the change ships on the next deploy
    • Blocks that were localized (detached from the catalog) are skipped and keep their own content
    • Renaming the preset, or editing only its category or description, propagates nothing — those fields do not belong to a block