Ana içeriğe geç

Get AI Prompt-Guard Preset

Endpoint

GET /apiops/settings/ai-prompt-guard-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 prompt-guard preset (case-insensitive match)

Query Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringNoadminScope 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

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarrayList containing the single matched preset object
resultCountintegerAlways 1 on a successful match

Prompt-Guard Preset Object Fields

FieldTypeDescription
idstringServer-assigned identifier (read-only)
projectIdstringScope the preset belongs to (admin for global)
namestringUnique preset name
ruleValuestringJava regex pattern matched against prompt content
actionstringAction applied on match: BLOCK, FLAG, MASK
categorystringOptional category label (e.g. jailbreak, injection, system-leak)
descriptionstringOptional description for display
enabledbooleanWhether the preset is active
builtInbooleantrue for Mongock-seeded rows (read-only), false for user-created

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - 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 ADMIN role) can read AI prompt-guard presets
    • A project-scoped AI_DEVELOPMENT token is not sufficient
  • Name Matching:
    • The preset name is matched case-insensitively within the resolved scope
  • Scope:
    • Pass projectId to look up a preset in a specific project; otherwise the admin/global scope is used
  • No Secret Fields:
    • Prompt-guard presets carry no secret (@SecretData) fields, so no values are masked