apyhub
Back
DATA VALIDATION

Validate Brazilian CNH Number API

What it does

CNH Validator checks a Brazilian driver’s licence number and returns a simple validation result. Send the number path parameter, and get back whether it is valid, the original input_value, the document_type, and a formatted_value when one is available.

Use this when you need to verify a CNH before storing it in a CRM, onboarding a driver, or accepting licence details in a form. The response is minimal and predictable, which makes it easy to plug into request validation, account creation flows, or back-office review steps.

CNH Validator is designed for straightforward yes/no verification with just enough context to handle the result cleanly. If the number is valid, you can keep moving; if not, you can reject the record or prompt for correction. Because the output includes the exact value you sent, it is easy to log, audit, or compare against user input without extra parsing.

GET
Validate CNH
https://api.eu.apyhub.com/dam4g/check-cnh/cnh/:number

QUICKSTART

GUIDE

Quickstart

Validate a CNH number by passing it in the path.

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

What you'll get back

Returns a JSON object with document_type, input_value, is_valid, and formatted_value fields. document_type and input_value are strings, is_valid is a boolean, and formatted_value is either a string or null.

{
  "document_type": "cnh",
  "input_value": "02650306461",
  "formatted_value": null,
  "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

Checks a CNH number and returns a validation result for the supplied value. The response includes whether the input is valid, the original input value, the document type, and an optional formatted value.

Path Parameter(s)

AttributeTypeMandatoryDescription
numberStringYesCNH number to validate.

Response

Returns a JSON object with is_valid boolean, input_value string, document_type string, and formatted_value string or null fields. The output schema describes a validation result object; the required fields are document_type, input_value, and is_valid.

AttributeTypeMandatoryDescription
is_validBooleanYesIndicates whether the provided CNH number is valid.
input_valueStringYesThe input value that was validated.
document_typeStringYesThe document type returned by the validation result.
formatted_valueString | NullNoFormatted version of the input value, if provided by the service.

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.