Key Format
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.
OK
GET /gbds/v2/keyFormat HTTP/1.1
Host: <ip>:8085
Accept: */*
OK
{
"httpResponse": {
"httpCode": 1,
"body": "text"
},
"data": [
{
"keyId": "text",
"formatType": "TITULO",
"regex": "text",
"minLength": 1,
"maxLength": 1
}
]
}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.
CREATED
ACCEPTED
POST /gbds/v2/keyFormat HTTP/1.1
Host: <ip>:8085
Content-Type: application/json
Accept: */*
Content-Length: 81
{
"keyId": "text",
"formatType": "TITULO",
"regex": "text",
"minLength": 1,
"maxLength": 1
}{}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.
OK
GET /gbds/v2/keyFormat/{keyId} HTTP/1.1
Host: <ip>:8085
Accept: */*
OK
{
"httpResponse": {
"httpCode": 1,
"body": "text"
},
"data": {
"keyId": "text",
"formatType": "TITULO",
"regex": "text",
"minLength": 1,
"maxLength": 1
}
}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.
NO CONTENT (deleted)
DELETE /gbds/v2/keyFormat/{keyId} HTTP/1.1
Host: <ip>:8085
Accept: */*
NO CONTENT (deleted)
{}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.
Name of entity identifier.
Value of entity identifier.
OK
BAD REQUEST
POST /gbds/v2/keyFormat/validate HTTP/1.1
Host: <ip>:8085
Content-Type: application/json
Accept: */*
Content-Length: 30
[
{
"id": "text",
"value": "text"
}
]{}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.
OK
BAD REQUEST
GET /gbds/v2/keyFormat/validate/{keyId}/{keyValue} HTTP/1.1
Host: <ip>:8085
Accept: */*
{}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.
Name of entity identifier.
Value of entity identifier.
OK
BAD REQUEST
POST /gbds/v2/keyFormat/validate/inconsistentKeys HTTP/1.1
Host: <ip>:8085
Content-Type: application/json
Accept: */*
Content-Length: 30
[
{
"id": "text",
"value": "text"
}
]{}Was this helpful?

