Ana içeriğe geç

Delete AI Prompt-Decorator Preset

Endpoint

DELETE /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

Path Parameters

ParameterTypeRequiredDescription
presetNamestringYesName of the preset to delete (case-insensitive)

Query Parameters

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

Response

Success Response (200 OK)

{
"status": "SUCCESS"
}

Error Response (400 Bad Request)

Returned when the name is empty, no preset with that name is visible in the scope, the preset belongs to a different scope than the projectId you sent, or the caller lacks the ADMIN role.

{
"status": "FAILURE",
"resultMessage": "Project mismatch"
}

Error Response (401 Unauthorized)

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

cURL Example

curl -X DELETE \
"https://demo.apinizer.com/apiops/settings/ai-prompt-decorator-presets/support-tone/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Built-in Presets Can Be Deleted — Permanently:
    • A seeded row (builtIn: true) accepts this call the same as a custom preset. Mongock deduplicates seed changesets by id and none are runAlways=true, so a deleted built-in preset does not reappear on a version upgrade — it returns only if a future release ships an explicit re-seed changeset. To stop using a preset without losing it, disable it instead of deleting it.
  • Bound Blocks Are Localized, Not Broken:
    • Blocks bound to this preset are detached (localized) as part of the delete: each keeps its current position, role and content and goes on working. No block is removed from any policy and no redeploy is required — only the catalog link is dropped.
  • Scope Must Match (projectId):
    • The preset is deleted only when its own scope equals the projectId you send. Omitting projectId targets the admin/global scope (admin).
    • Deleting a preset that belongs to a different scope is rejected with Project mismatch (error key projectmismatch) and nothing is deleted — an admin token does not let you delete another project's preset by name.
    • To delete a project-scoped preset, pass that project's id explicitly: ?projectId=<projectId>.
  • Admin Only:
    • A project-scoped AI_DEVELOPMENT token is not sufficient on this surface; use the project endpoint to delete a preset the project owns