apyhub
Back
DATA VALIDATION

Validate Brazilian CPF Number API

What it does

CPF Validation checks whether a Brazilian CPF number is valid and returns a simple validation result. Send a CPF in the number field, and use the response to confirm the document type, the original input value, whether it passed validation, and an optional formatted value.

Use CPF Validation when you need to verify user-submitted identity data before saving a record, creating an account, or processing a form. It is useful anywhere CPF values must be checked at the point of entry to reduce bad data and avoid downstream errors in onboarding, compliance, or customer support workflows.

The response is intentionally direct: is_valid tells you the result, input_value echoes what was checked, document_type identifies the document, and formatted_value is returned when a normalized representation is available. That makes it easy to plug into backend validation, form checks, and document processing pipelines without extra parsing.

GET
Validate CPF
https://api.eu.apyhub.com/dam4g/check-cpf/cpf/:number

QUICKSTART

GUIDE

Quickstart

Validate a CPF by passing the number path parameter in the URL.

curl -X GET "https://api.eu.apyhub.com/dam4g/check-cpf/cpf/:number" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with is_valid as a boolean, input_value as a string, document_type as a string, and formatted_value as a string or null.

{
  "document_type": "cpf",
  "input_value": "11144477735",
  "formatted_value": "111.444.777-35",
  "is_valid": true
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Validates a CPF number passed in the path and returns a JSON object describing the validation result. The response includes whether the value is valid, the original input value, the document type, and an optional formatted value.

Path Parameter(s)

AttributeTypeMandatoryDescription
numberStringYesCPF number to validate.

Response

Returns a JSON object of type ValidationResult with is_valid, input_value, document_type, and formatted_value fields. The is_valid, input_value, and document_type fields are required in the response schema; formatted_value may be a string or null.

AttributeTypeMandatoryDescription
is_validBooleanYesWhether the CPF is valid.
input_valueStringYesThe input value that was validated.
document_typeStringYesThe document type associated with the validation result.
formatted_valueStringNoThe formatted version of the input value, or null.

Path parameters

Name
Type
Description
numberREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.