Delete AI Prompt-Guard Preset
Endpoint
DELETE /apiops/settings/ai-prompt-guard-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 |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| presetName | string | Yes | Name of the prompt-guard preset to delete (case-insensitive match) |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| projectId | string | No | admin | Scope project id. Omit for the admin/global scope. |
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Response status: SUCCESS or FAILURE |
| deploymentResult | object | Deployment result summary |
| deploymentResult.success | boolean | true when the preset was deleted successfully |
Error Response (400 Bad Request)
Returned when the preset name is blank, the preset is not found, the preset belongs to a different scope than the projectId you sent, or the caller lacks the ADMIN role.
{
"status": "FAILURE",
"resultMessage": "AI prompt-guard preset (name: block-internal-hostnames) was not found!"
}
Other possible messages:
{
"status": "FAILURE",
"resultMessage": "Project mismatch"
}
{
"status": "FAILURE",
"resultMessage": "Unauthorized! Only users with ADMIN role can manage AI presets!"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
curl -X DELETE \
"https://demo.apinizer.com/apiops/settings/ai-prompt-guard-presets/block-internal-hostnames/" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes and Warnings
- Admin Only:
- Only sysAdmin users (or users with the
ADMINrole) can delete AI prompt-guard presets - A project-scoped
AI_DEVELOPMENTtoken is not sufficient
- Only sysAdmin users (or users with the
- 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 arerunAlways=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.
- A seeded row (
- Scope Must Match (
projectId):- The preset is deleted only when its own scope equals the
projectIdyou send. OmittingprojectIdtargets the admin/global scope (admin). - Deleting a preset that belongs to a different scope is rejected with
Project mismatch(error keyprojectmismatch) 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>.
- The preset is deleted only when its own scope equals the
- Must Exist:
- Deleting a non-existent preset returns a
not founderror
- Deleting a non-existent preset returns a
- Irreversible:
- Deletion is permanent; a deleted preset must be recreated (or, for a built-in row, restored by a future re-seed changeset) to bring it back
Related Documentation
- List AI Prompt-Guard Presets - List all presets
- Create AI Prompt-Guard Preset - Create a preset
- AI Prompt-Guard Presets API - Resource overview