Update AI Privacy Preset
Endpoint
PUT /apiops/settings/ai-privacy-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 |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| presetName | string | Yes | Name of the existing privacy preset. Must match the name in the body (case-insensitive); if name is omitted it defaults to this value. |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| projectId | string | No | admin | Scope project id. Omit for the admin/global scope. |
Request Body
Full JSON Body Example
{
"name": "internal-account-id",
"patternType": "REGEX",
"regexPattern": "ACC-[0-9]{6,10}",
"operation": "HASH",
"enabled": true
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | No | path value | Preset name. Must equal presetName (case-insensitive); defaults to the path value when omitted. |
| patternType | string | Yes | - | Match pattern type: ELEMENT_NAME or REGEX. BUILTIN is rejected with patterntypebuiltinunsupported. |
| regexPattern | string | Conditional | - | Custom regex pattern. Required when patternType = REGEX. |
| maskMode | string | No | FIXED | Mask shape when operation = MASK: FIXED, KEEP_FIRST, KEEP_LAST, MASK_FIRST |
| maskPattern | string | No | *** | With FIXED, the full replacement text. With the partial shapes, its first character is used as the mask character. |
| maskVisibleCharCount | integer | No | 4 | Characters kept (or masked, with MASK_FIRST) in the partial shapes |
| elementName | string | No | - | Header/param/body field name to match when patternType = ELEMENT_NAME |
| operation | string | Yes | - | Action applied on match: MASK, DELETE, ENCRYPT, HASH, DETECT |
| enabled | boolean | No | - | Whether the preset is active |
Notes
- The preset must already exist in the scope; otherwise a
not founderror is returned - The request body must not be empty
namein the body must matchpresetNamein the path (case-insensitive)builtInandidare server-controlled and ignored on write
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 updated successfully |
Error Response (400 Bad Request)
Returned when the preset is not found, on validation/name-mismatch failure, on a built-in preset, or when the caller lacks the ADMIN role.
{
"status": "FAILURE",
"resultMessage": "AI privacy preset (name: internal-account-id) was not found!"
}
Other possible messages:
{
"status": "FAILURE",
"resultMessage": "AI privacy preset name in path (internal-account-id) does not match name in body (other-name)!"
}
{
"status": "FAILURE",
"resultMessage": "Built-in presets are read-only"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/settings/ai-privacy-presets/internal-account-id/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "internal-account-id",
"patternType": "REGEX",
"regexPattern": "ACC-[0-9]{6,10}",
"operation": "HASH",
"enabled": true
}'
Notes and Warnings
- Admin Only:
- Only sysAdmin users (or users with the
ADMINrole) can update AI privacy presets - A project-scoped
AI_DEVELOPMENTtoken is not sufficient
- Only sysAdmin users (or users with the
- Must Exist:
- The preset must already exist in the scope; to create one, use the create (POST) endpoint
- Built-in Presets Are Read-only:
- Updating a built-in (seeded) preset is rejected with a
Built-in presets are read-onlyerror
- Updating a built-in (seeded) preset is rejected with a
- Full Replacement:
- Update applies the full field surface from the body onto the existing preset
- No Secret Fields:
- Privacy presets carry no secret (
@SecretData) fields, so no values are masked
- Privacy presets carry no secret (
Related Documentation
- Create AI Privacy Preset - Create or upsert a preset
- Get AI Privacy Preset - Get a single preset
- AI Privacy Presets API - Resource overview