CPF Validation
Validates a CPF number by checking the format and verification digits using the Modulo 11 algorithm.
Endpoint
POST /api/v2/external/cpf/validateHeaders
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | String | Yes | Bearer {access_token} |
Content-Type | String | Yes | application/json |
Request Body
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
document_number | String | Yes | CPF number (with or without formatting) | "12345678909" or "123.456.789-09" |
Example
bash
curl -X POST https://api.owem.com.br/api/v2/external/cpf/validate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"document_number":"12345678909"}'Success Response -- Valid CPF (200)
json
{
"worked": true,
"valid": true,
"formatted": "123.456.789-09"
}Success Response -- Invalid CPF (200)
json
{
"worked": true,
"valid": false,
"formatted": null
}| Field | Type | Description |
|---|---|---|
worked | Boolean | true indicates the request was processed |
valid | Boolean | true if the CPF is valid, false otherwise |
formatted | String | Formatted CPF (XXX.XXX.XXX-XX) if valid, null if invalid |
Validations Performed
- Verifies that the CPF has exactly 11 digits
- Rejects CPFs with all identical digits (e.g.,
111.111.111-11) - Calculates and verifies the 2 check digits using the Modulo 11 algorithm
Error Response (400)
json
{
"worked": false,
"detail": "The document_number field is required"
}Error Response (401)
json
{
"worked": false,
"detail": "Invalid or expired token"
}Usage
This endpoint only performs mathematical CPF validation (Modulo 11). It does not query the Federal Revenue Service nor verify the document's registration status.