Key Format

List key formats

get

Returns all configured key formats used by API-side key validation. Each item describes a keyId and its constraints: formatType (CPF, TITULO, REGEX, ALPHANUMERIC, ALPHABETIC, NUMERIC), optional regex (when formatType=REGEX), and optional minLength/maxLength. Use this endpoint to inspect which formats are currently enforced by the API during enroll/update when key-format validation is enabled.

Responses
200

OK

application/json
get
/keyFormat
200

OK

Create or update key formats

post

Creates or updates one or more key-format definitions. Required fields are keyId and formatType. When formatType=REGEX, the regex field is required. minLength and maxLength are optional. Newly created definitions return 201 Created, while existing definitions return 202 Accepted. These formats are used when key-format validation is enabled for enroll/update.

Body
keyIdstringOptional
formatTypestring · enumOptionalPossible values:
regexstringOptional
minLengthinteger · int32Optional
maxLengthinteger · int32Optional
Responses
post
/keyFormat

Get key format

get

Retrieves the configured key-format definition for a specific keyId. The response includes the formatType and any additional constraints (regex, minLength, maxLength). Use this to validate client payloads against server-side requirements and to understand how a specific key will be checked during enroll/update.

Path parameters
keyIdstringRequired
Responses
200

OK

application/json
get
/keyFormat/{keyId}
200

OK

Delete key format

delete

Deletes the key-format definition for the given keyId. If the format exists and is removed, server-side validation for that key will no longer be applied (unless the format is re-added). Returns 204 No Content on success.

Path parameters
keyIdstringRequired
Responses
delete
/keyFormat/{keyId}
204

NO CONTENT (deleted)

Validate keys (oneKeyOnly + format)

post

Validates a list of keys according to the active key-validation settings. When the oneKeyOnly setting is enabled, payloads containing more than one key are rejected. When the keyFormat setting is enabled, each key must satisfy its configured key_format rules (formatType, regex, minLength, maxLength). The endpoint returns 200 OK if all validations pass, or 400 Bad Request if any rule is violated. Use this to pre-check client requests before enroll/update.

Bodyobject[]
idstringOptional

Name of entity identifier.

valuestringOptional

Value of entity identifier.

Responses
200

OK

application/json
Responseobject
post
/keyFormat/validate

Validate a single key value

get

Validates a single key value against its configured format outside of the enroll/update flow. It returns 200 OK if the value passes all checks (format type, regex pattern, and optional length constraints) or 400 Bad Request with type=VALIDATION_ERROR and code=INVALID_KEY if validation fails. This endpoint only evaluates a single (keyId, keyValue) pair and does not modify state.

Path parameters
keyIdstringRequired
keyValuestringRequired
Responses
200

OK

application/json
Responseobject
get
/keyFormat/validate/{keyId}/{keyValue}

Validate keys for potential inconsistencies

post

Checks a list of keys for inconsistencies that would invalidate an update/enroll under the inconsistentKeys setting. Inconsistent cases include multiple keys matching different existing people or a payload key that matches an existing person while another key of the same id has a different value. The endpoint returns 200 OK if the keys are consistent, or 400 Bad Request when inconsistencies are detected.

Bodyobject[]
idstringOptional

Name of entity identifier.

valuestringOptional

Value of entity identifier.

Responses
200

OK

application/json
Responseobject
post
/keyFormat/validate/inconsistentKeys

Was this helpful?