Ana içeriğe geç

List AI Privacy Presets

Endpoint

GET /apiops/settings/ai-privacy-presets/

Authentication

Requires a Personal API Access Token with admin privileges.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

None.

Query Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringNoadminScope project id. Omit for the admin/global scope, where built-in and admin-owned presets live.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"id": "665f2a1c9b3e4a0012ab34cd",
"projectId": "admin",
"name": "Türkiye TC Kimlik No (TCKN)",
"elementName": "BUILTIN_TR_TCKN",
"patternType": "REGEX",
"regexPattern": "\\b[1-9]\\d{10}\\b",
"operation": "MASK",
"maskMode": "FIXED",
"maskPattern": "***",
"enabled": true,
"builtIn": true
},
{
"id": "665f2a1c9b3e4a0012ab99ff",
"projectId": "admin",
"name": "internal-account-id",
"elementName": null,
"patternType": "REGEX",
"regexPattern": "ACC-[0-9]{8}",
"operation": "MASK",
"maskMode": "KEEP_LAST",
"maskPattern": "*",
"maskVisibleCharCount": 4,
"enabled": true,
"builtIn": false
}
],
"resultCount": 2
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarrayList of privacy preset objects
resultCountintegerTotal number of presets returned

Privacy Preset Object Fields

FieldTypeDescription
idstringServer-assigned identifier (read-only)
projectIdstringScope the preset belongs to (admin for global)
namestringDisplay name (e.g. Türkiye TC Kimlik No (TCKN))
elementNamestringStable built-in key for seeded rows (e.g. BUILTIN_TR_TCKN); may be null for custom presets
patternTypestringMatch pattern type: ELEMENT_NAME or REGEX. Seeded PII rules are REGEX too — BUILTIN is no longer used in this catalog.
regexPatternstringCustom regex pattern; present when patternType = REGEX
operationstringAction applied on match: MASK, DELETE, ENCRYPT, HASH, DETECT
maskModestringMask shape when operation = MASK: FIXED (default), KEEP_FIRST, KEEP_LAST, MASK_FIRST
maskPatternstringReplacement text with FIXED (default ***); mask character with the partial shapes
maskVisibleCharCountintegerCharacters kept (or masked, with MASK_FIRST) in the partial shapes; default 4
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 caller is authenticated but lacks the ADMIN role.

{
"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

Default (admin/global scope)

curl -X GET \
"https://demo.apinizer.com/apiops/settings/ai-privacy-presets/" \
-H "Authorization: Bearer YOUR_TOKEN"

Scoped to a project

curl -X GET \
"https://demo.apinizer.com/apiops/settings/ai-privacy-presets/?projectId=MyProject" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Admin Only:
    • Only sysAdmin users (or users with the ADMIN role) can list AI privacy presets
    • A project-scoped AI_DEVELOPMENT token is not sufficient
  • Built-in Presets:
    • Rows with builtIn: true come from the seeded Türkiye PII catalog and are read-only
  • Scope:
    • The default scope is admin/global; pass projectId to list presets for a specific project
  • No Secret Fields:
    • Privacy presets carry no secret (@SecretData) fields, so no values are masked