Get AI Prompt-Guard Preset
Endpoint
GET /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 (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",
"resultList": [
{
"id": "665f3b2d8c4f5b0013cd45ef",
"projectId": "admin",
"name": "BUILTIN_APG_DAN",
"ruleValue": "(?i)ignore (all|previous) instructions",
"action": "BLOCK",
"category": "jailbreak",
"description": "Classic DAN / instruction-override jailbreak attempt",
"enabled": true,
"builtIn": true
}
],
"resultCount": 1
}
Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Response status: SUCCESS or FAILURE |
| resultList | array | List containing the single matched preset object |
| resultCount | integer | Always 1 on a successful match |
Prompt-Guard Preset Object Fields
| Field | Type | Description |
|---|---|---|
| id | string | Server-assigned identifier (read-only) |
| projectId | string | Scope the preset belongs to (admin for global) |
| name | string | Unique preset name |
| ruleValue | string | Java regex pattern matched against prompt content |
| action | string | Action applied on match: BLOCK, FLAG, MASK |
| category | string | Optional category label (e.g. jailbreak, injection, system-leak) |
| description | string | Optional description for display |
| enabled | boolean | Whether the preset is active |
| builtIn | boolean | true for Mongock-seeded rows (read-only), false for user-created |
EnumStatus
SUCCESS- Operation successfulFAILURE- Operation failed
Error Response (400 Bad Request)
Returned when the preset name is blank, the preset is not found, 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": "AI prompt-guard preset name can not be empty!"
}
{
"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 GET \
"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 read AI prompt-guard presets - A project-scoped
AI_DEVELOPMENTtoken is not sufficient
- Only sysAdmin users (or users with the
- Name Matching:
- The preset name is matched case-insensitively within the resolved scope
- Scope:
- Pass
projectIdto look up a preset in a specific project; otherwise the admin/global scope is used
- Pass
- No Secret Fields:
- Prompt-guard presets carry no secret (
@SecretData) fields, so no values are masked
- Prompt-guard presets carry no secret (
Related Documentation
- List AI Prompt-Guard Presets - List all presets
- Update AI Prompt-Guard Preset - Update a preset
- AI Prompt-Guard Presets API - Resource overview