Batch Delete SSO Custom Mapping Rules¶
POST /api/v1/login_mapping/field/batch_delete
Overview¶
Batch delete the custom login mapping rules in the current workspace.
Before Calling and Usage Steps¶
This group maintains Deployment Plan custom login attribute mappings with isSystem=false in the current workspace. It differs from SAML mappings that bind identity providers by ssoUUID and from External/Inner system mappings. For the mappings to take effect, the workspace must also enable isOpenCustomMappingRule; you can configure the switch in Custom Mapping and verify the login policy. Saving/deleting only changes rules; it does not immediately change roles for existing members or revoke existing sessions; subsequent LDAP/OIDC shared login flows re-match against the actual userinfo.
Matching uses top-level userinfo attributes: arrays are compared element by element with str(value), other values are compared by their Python string representation, and fields and values use database equality semantics (case sensitivity/collation is determined by the deployed database); no regex/contains or nested path extraction is performed; use only stable strings from the identity source. For multiple matching rules, roles are unioned and then filtered to available roles. When the workspace custom switch is enabled, it takes precedence over system rules: a match usually resets roles, while no match may clear the original association; existing Owner roles have protection logic. Validate actual permissions with a dedicated test identity first; do not assume that the role for the next login is correct based only on this HTTP success.
Soft-deletes mapping configurations; does not delete target roles or accounts and does not immediately revoke roles/sessions already held by members. If the custom switch is enabled for subsequent logins, a missing match may still clear the original role relationship; deletion does not mean "future login permissions remain unchanged". Batch operations only process matching items in the current workspace that have isSystem=false and are not deleted; some invalid UUIDs are ignored; however, if the array is empty/all items do not match, or all old target roles have no visible records, NotFoundRole is returned; do not treat true as a per-item deletion count. After a timeout/error, list the records first to confirm the final record state before deciding whether to retry.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or fill in: Obtain an OpenAPI Key with the required permission from API Key management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| lgmpUUIDs[*] | string | The old YAML example fdmp_ does not apply to this group; do not use the SAML mapping prefix. Example: lgmp_exampleHow to obtain or fill in: Take a single lgmp_ mapping UUID. |
|
| lgmpUUIDs | array | Y | Required array; an empty array is not recommended. Only processes matching items in the current workspace that have isSystem=false and are not deleted; it does not report misses item by item. An empty array/all items not matching will cause NotFoundRole during old-role summary validation; it is not an idempotent true. Example: ["lgmp_example"]How to obtain or fill in: Obtain multiple lgmp_ UUIDs from the custom mapping list in the current workspace. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/login_mapping/field/batch_delete' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"lgmpUUIDs":["lgmp_example"]}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | Returns true on success; does not return the number of deletions. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 404 | ft.NotFoundRole | No visible role record matches the target/existing mapping role set, including []; this can also be triggered when parsing old roles during single-delete or batch-delete audits | The specified role was not found or has been deleted | First check the role list and mapping list in the current workspace. Unknown roles mixed in some entries will be filtered; for historical empty/no-match sets, do not directly assume they can be deleted; an administrator must fix them before processing. |
| 500 | ft.InternalServerError | An uncaught exception occurred in mapping/role/database storage or data formatting | Internal error | First check the mapping rule list by the UUIDs to be deleted to see whether they still exist, and confirm any possible partially matched deletion state before proceeding. The API does not provide per-item deletion results; retain the traceId and do not infer from a failed response that none were deleted. |
| 406 | ft.ParameterValidationFailed | A request field is missing, or a field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid request JSON syntax | Request JSON format error | Fix the JSON according to content.reason, line, column. |
| 400 | ft.JsonFormatError | Body is not an object | Partial JSON file format error | Submit the object that contains the lgmpUUIDs array. |