Skip to content

CPF Validation

Validates a CPF number by checking the format and verification digits using the Modulo 11 algorithm.

Endpoint

POST /api/v2/external/cpf/validate

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesBearer {access_token}
Content-TypeStringYesapplication/json

Request Body

FieldTypeRequiredDescriptionExample
document_numberStringYesCPF 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
}
FieldTypeDescription
workedBooleantrue indicates the request was processed
validBooleantrue if the CPF is valid, false otherwise
formattedStringFormatted CPF (XXX.XXX.XXX-XX) if valid, null if invalid

Validations Performed

  1. Verifies that the CPF has exactly 11 digits
  2. Rejects CPFs with all identical digits (e.g., 111.111.111-11)
  3. 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.

Owem Pay Instituição de Pagamento — ISPB 37839059