Skip to content

CPF Validation

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

Endpoint

POST /api/external/cpf/validate

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesApiKey {client_id}:{client_secret}
Content-TypeStringYesapplication/json

Request Body

FieldTypeRequiredDescriptionExample
cpfStringYesCPF number (with or without formatting)"12345678909" or "123.456.789-09"

Alias

The document_number field is also accepted as an alias.

Example

bash
curl -X POST https://api.owem.com.br/api/external/cpf/validate \
  -H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"cpf":"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 cpf field is required"
}

Error Response (401)

json
{
  "error": {
    "status": 401,
    "message": "Missing API key credentials. Use Authorization: ApiKey <client_id>:<client_secret>"
  }
}

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