Ana içeriğe geç

Get AI DLP Preset

Endpoint

GET /apiops/settings/ai-dlp-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 DLP 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": "665f2a1c9b3e4a0012ab5501",
"projectId": "admin",
"name": "BUILTIN_DLP_AWS_ACCESS_KEY",
"ruleValue": "\\bAKIA[0-9A-Z]{16}\\b",
"action": "BLOCK",
"category": "aws",
"description": "AWS access key id (AKIA...)",
"enabled": true,
"builtIn": true,
"overridden": false
}
],
"resultCount": 1
}

Response Fields

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

DLP Preset Object Fields

FieldTypeDescription
idstringServer-assigned identifier (read-only)
projectIdstringScope the preset belongs to (admin for global)
namestringUnique preset name
ruleValuestringJava regex pattern used to detect the secret/credential
literalAnchorsarray[string]Literal substrings used as a fast pre-filter before the regex runs; null when the rule has none (never skipped). Each anchor is guaranteed to appear verbatim in every match — validated on save. See the note below.
actionstringAction applied on match: BLOCK, FLAG, or MASK
categorystringOptional category label (e.g. aws, openai, github, pem, slack, google, jwt, generic)
descriptionstringOptional description for UI display
enabledbooleanWhether the preset is active
builtInbooleantrue for Mongock-seeded rows, false for user-created — the field itself is server-owned, but the row is not otherwise read-only
overriddenbooleanResponse-only. true when an admin has edited this built-in row through the API or Manager UI — the versioned rule-pack loader then skips it on every future pack refresh instead of overwriting the edit. Always false/absent for custom (builtIn: false) rows. See Built-in Presets Are Editable.
literalAnchors — a wrong anchor silently disables the rule

Anchors exist purely as a performance pre-filter: the gateway runs one multi-pattern scan over the text and only evaluates the regex of rules whose anchors were found. That means an anchor which is not guaranteed to appear in a match causes the rule to be skipped entirely — the regex never runs, and a BLOCK rule silently stops blocking. The gateway cannot detect this on its own.

Example of a wrong anchor: rule (?i)api[-_]?key\s*[:=]\s*\S+ with literalAnchors: ["API_KEY"]. The text api-key: sk-live-... matches the regex but does not contain the literal API_KEY, so the rule is skipped and the secret passes through.

Save-time validation extracts the literal runs of ruleValue (for the pattern above: api, key) and rejects any anchor that is not a substring of one of them. The check is deliberately conservative — if a legitimate anchor is rejected, remove it rather than working around the check. An anchor-less rule is never skipped, only slower.

This applies to every write path: this API, the AI DLP Guard policy body, and package import.

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 DLP preset (name: internal-api-token) was not found!"
}

Other possible messages:

{
"status": "FAILURE",
"resultMessage": "AI DLP 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-dlp-presets/internal-api-token/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Admin Only:
    • Only sysAdmin users (or users with the ADMIN role) can read AI DLP 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:
    • ruleValue is a detection regex pattern, not a credential itself — DLP presets carry no secret (@SecretData) fields, so no values are masked