How to Verify a Brazilian CPF With Database Validation
Didit's Database Validation API checks a Brazilian CPF, and optionally the name and date of birth, against Receita Federal records through SERPRO, returning a per-field match and an aggregate match type you can branch on.

Contents
In this guide
Jump to the part you need.
This guide is for teams that must confirm a Brazilian CPF belongs to the person who entered it. Didit's Database Validation API checks the number, and optionally the name and date of birth, against Receita Federal records through SERPRO, and returns a field-by-field match. Database Validation is priced per service and country, so read the exact Brazil CPF rate in the per-service pricing table before you budget.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| Outcome | Confirm a CPF exists in the Brazilian registry and that the name and date of birth you hold match it |
| Endpoint, standalone | POST https://verification.didit.me/v3/database-validation/ |
| Endpoint, inside a workflow | POST https://verification.didit.me/v3/session/, then GET /v3/session/{sessionId}/decision/ |
| Authentication | x-api-key header |
| Required fields | issuing_state=BRA and identification_number (the CPF) |
| Optional fields | first_name, last_name, date_of_birth, vendor_data, services, consent |
| Outcomes | full_match, partial_match, no_match |
| Session status | Approved, In Review, Declined, set by your configured actions |
| Price | Variable per service and country. Read the exact Brazil CPF rate in the per-service pricing table |
| Billing | Per successful service hit. A no-match is still billable when the service hit completed. An all-upstream failure returns HTTP 502 and is not billed |
| Coverage | Database Validation runs in 60+ live countries; Brazil resolves through Receita Federal (SERPRO) |
Start free in the sandbox at https://business.didit.me/, with no sales call. If you build with an AI assistant, connect Didit to it through the MCP server. Every published price on this page lives on https://didit.me/pricing/.
Why a CPF needs a registry check, not a format check
A CPF is 11 digits with two check digits, and anyone can generate a string that passes the check-digit arithmetic. A format test tells you the number looks like a CPF. It tells you nothing about whether the number is registered, whether it is active, or whether it belongs to the person in front of you. That gap is where synthetic identities get through: a fabricated number passes the arithmetic, and a real CPF bought from a data leak passes it too.
Database Validation closes the gap by asking the source that issued the number. For Brazil, Didit routes the lookup to Receita Federal through SERPRO and returns a match per field: the identification number, first name, last name and date of birth, plus the underlying record where the source returns it. You get one aggregate match_type and the evidence behind it, which is what lets you approve a clean case and route a messy one without guessing. The Database Validation overview documents the per-field return.
Didit runs 25+ composable modules on one open API for 4,000+ companies. Database Validation covers 60+ live countries and the platform draws on more than 1,000 government data sources. Pricing is pay per completed check from prepaid credit, with no monthly minimums, platform fees, or per-seat billing.
Prerequisites
- A Didit account and an API key. Sign up at https://business.didit.me/. Eligible organizations on the Free plan receive $10 of monthly credit when they sign up with an eligible work email for a company domain. Sandbox testing is free and unlimited, so you can run the whole call before you fund anything. Copy the key from the console.
- The CPF as digits. Strip punctuation before you send it. The number goes in
identification_number; Didit maps that universal field to CPF, RUT, CURP, DNI and the rest based onissuing_state. - A decision on optional fields.
first_name,last_nameanddate_of_birthare not required. Send them if you want to prove ownership of the number, not just its existence. Date of birth uses ISO 8601, for example1990-01-15. - A consent check. Services flagged
requires_consent=truein the catalog reject a call withoutconsent=trueand answer HTTP 400. Look the service up before you ship, not after. - A choice between the default service and a pinned one. Omit
servicesto run the country default. Passservices=["bra_cpf"]to choose exactly which services run, and list several if you want more than one.
How to verify a Brazilian CPF, step by step
- Create the application and copy an API key. One key is enough to call
POST /v3/database-validation/within minutes of signing up. There is no procurement step in front of the sandbox. - Decide the mode. Use the standalone server-to-server endpoint when you already hold the identity data, for example from your own signup form. Use session mode when a person types the data into a hosted Didit flow. The rest of these steps cover the standalone call; session mode follows further down.
- Assemble the fields. Send
issuing_state=BRA,identification_numberwith the CPF, and whichever offirst_name,last_nameanddate_of_birthyou hold. Addvendor_datawith your own stable identifier for the person so the response is easy to reconcile. - Send the request. The documented Brazil call is a multipart form POST with your API key in the header.
curl -X POST 'https://verification.didit.me/v3/database-validation/' \
-H "x-api-key: $DIDIT_API_KEY" \
-F "issuing_state=BRA" \
-F "identification_number=00000000191" \
-F "first_name=Jane" \
-F "last_name=Doe" \
-F "date_of_birth=1990-01-15" \
-F "vendor_data=user-1234"

- Base the decision on the match fields. Application decisions must use
match_typeandvalidations[]; the HTTP status alone does not tell you whether the person matched. Start frommatch_type, then readvalidations[]for the per-field evidence. Keeprequest_idfor audit. - Branch on the outcome. A
full_matchcan approve. Apartial_matchgoes to review or to decline, depending on the action you configured. Ano_matchis a synthetic-identity signal and should follow your policy, not a retry loop. - Log the warnings.
warnings[]carries risk codes such asDATABASE_VALIDATION_NO_MATCH,DATABASE_VALIDATION_PARTIAL_MATCHandCOULD_NOT_PERFORM_DATABASE_VALIDATION. Storing them next torequest_idgives you a defensible record of what you saw and when.
The response you get back
The documented return object is request_id plus a database_validation object holding match_type, validation_type, services_used, match_score, a validations array and a warnings array. Field names below are the documented ones; the identifier and score values are abbreviated here.
{
"request_id": "<request uuid>",
"database_validation": {
"match_type": "full_match | partial_match | no_match",
"validation_type": "<the matching mode reported by the service>",
"services_used": ["bra_cpf"],
"match_score": "<score reported for this match>",
"validations": [
{
"service": "bra_cpf",
"status": "<service status>",
"matched_fields": ["identification_number", "first_name", "last_name", "date_of_birth"],
"record_details": {}
}
],
"warnings": []
}
}
Read it in this order. match_type is the aggregate and the field your policy keys on. validations[] is the evidence per service, and when you pass more than one service there is one entry per service, each successful hit being a separate billable event. matched_fields tells you which of the fields you sent actually matched, which is what you need when a name carries an accent or a married name differs from the registry. record_details carries the registry fields when the source returns them, so your reviewers see the record rather than a score alone.
Running the same check inside a workflow
Session mode is the right route when the person enters the data in a Didit flow rather than in your own form. Fields are fed into the registry lookup from the steps in front of it, and an ID Verification step is not required.
- Add the
DATABASE_VALIDATIONfeature to the workflow, in the Business Console or throughPOST /v3/workflows/. You can pin specific services per country. - Create the session with
POST /v3/session/, sendingworkflow_id,vendor_dataandcallback. See the Create Session documentation. - Open
session.urlfor the person, or mount the Web or Mobile SDK. - Fetch the decision with
GET /v3/session/{sessionId}/decision/or subscribe to thesession.status.updatedwebhook. The registry result arrives in thedatabase_validations[]array on the decision payload.
curl https://verification.didit.me/v3/session/<SESSION_ID>/decision/ \
-H "x-api-key: <API_KEY>"

One field exists only here: database_validation_not_performed_reason tells you why a configured validation produced no result when database_validations is null. Read that field before you treat a missing array as a pass or a fail. The full decision schema is in the Retrieve Session documentation and the data models reference.
Inputs and outputs
| Field | Direction | Notes |
|---|---|---|
issuing_state | Request | ISO-3 country code. BRA for Brazil. |
identification_number | Request | Required. The CPF as digits. Didit maps the universal field to CPF by issuing_state. |
first_name | Request | Optional. Validated against the registry when supplied. |
last_name | Request | Optional. Same behaviour as first name. |
date_of_birth | Request | Optional. ISO 8601 date. |
vendor_data | Request | Your stable identifier for the person, echoed back for reconciliation. |
services | Request | Omit for the country default. Pass ["bra_cpf"] to pin the service, or list several. |
consent | Request | Required only when the service is flagged requires_consent=true. Missing consent is a 400. |
selfie, gender | Request | Only for the Argentina and Panama services that compare against a registry photo. Not used for Brazil. |
match_type | Response | full_match, partial_match or no_match. |
validation_type | Response | The matching mode the service reports. |
services_used | Response | Which services ran on this request. |
match_score | Response | Score reported for the match. |
validations[] | Response | One entry per service: service, status, matched_fields, record_details. |
warnings[] | Response | Risk codes, for example DATABASE_VALIDATION_NO_MATCH. |
status | Response, session | Approved, In Review or Declined, per the actions configured on the workflow. |
Failure cases and how to recover
| Symptom | Cause | Recovery |
|---|---|---|
| HTTP 400 | Service id not eligible for BRA, a required field missing, or consent missing on a service that needs it | Fix the request. Add consent=true where the catalog requires it, then resend. |
HTTP 502 with validation_errors[] | Every selected upstream service failed | Not billed. Retry later or fall back to document OCR. A COULD_NOT_PERFORM_DATABASE_VALIDATION log is written. |
match_type=no_match | The record is not in the registry | Treat as a synthetic identity per policy. Do not use retries to override a no-match; recheck only when you have a documented reason to believe the source data changed. |
match_type=partial_match | Some fields match and others do not, for example the date of birth matches and the name does not | Route to review, or decline, according to the partial-match action you set. |
COULD_NOT_PERFORM_DATABASE_VALIDATION | The configured validation produced no result | Read database_validation_not_performed_reason on the decision and fix the missing input. |

Two 400s are worth checking first, because both are configuration mistakes rather than registry answers: a service id that is not eligible for BRA, and a missing consent flag on a service that requires one. Neither should reach production, and both are visible in the catalog before you write the call.
What you pay for and where review begins
Database Validation bills per successful service hit, not per API call. A single request that runs several services produces several usage events. A no-match is still billable when the service hit completed, so a retry does not buy you a free answer; the docs pricing page lists the lookups and retries that are billable. A request whose upstream calls all fail returns 502 and is not billed. That makes a retry loop a cost decision as much as a policy decision.
Review boundaries are configuration, not code. The session status of Approved, In Review or Declined follows the partial-match action and the no-match action set on the workflow. If you want a human to see every partial match, set the partial-match action to review. If you would rather decline and let the person re-enter their data, set decline. Our recommendation is to reserve automatic approval for full_match and send every other outcome to a human reviewer. For the biometric services that read a registry photo, a face mismatch surfaces through the per-service outcome_code, for example BIOMETRIC_NO_MATCH, which belongs in the same review queue.
Worked cost example for 10,000 Brazilian checks a month
Take 10,000 Brazilian onboardings a month, each with a full ID check, an AML screen and one database validation lookup. The full ID check is $0.33, built from ID document $0.15 + passive liveness $0.10 + face match $0.05 + device and IP analysis $0.03.
- 10,000 x $0.33 = $3,300.00 for the full ID checks
- 10,000 x $0.20 = $2,000.00 for AML screening
- 10,000 x $0.33 + 10,000 x $0.20 = $3,300.00 + $2,000.00 = $5,300.00 for the ID checks and AML screening
The database validation lookup sits outside that $5,300.00. It is 10,000 x the exact Brazil CPF rate from the per-service pricing table. On the Scale plan the same volume is 10,000 x $0.297 = $2,970.00 for the ID checks and 10,000 x $0.18 = $1,800.00 for AML, a 10% discount on every Didit price. Plan credit is added monthly, does not roll over, and top-ups last 12 months, which is all on https://didit.me/pricing/.
Sources
- Didit Database Validation API overview
- Database Validation report
- Database Validation warnings catalogue
- Database Validation outcome codes
- Per-service Database Validation pricing table
- Didit pricing and billing rules in the docs
- Didit pricing page (live price feed, read November 26, 2026)
- Create Session API
- Retrieve Session API and decision payload
- Didit data models reference
- Didit integration prompt
- Didit documentation index
The next step is the sandbox: start free at https://business.didit.me/ with no sales call, run the Brazil curl call, and read the match_type on your own data before you wire it into a decision. If you are replacing an existing CPF check, https://didit.me/switch/ covers the migration.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
What is Brazilian CPF database validation?
Database validation sends a CPF, and usually the name and date of birth, to the source that issued the number and returns a match per field. For Brazil, Didit routes the lookup to Receita Federal through SERPRO. The API returns an aggregate match_type of full_match, partial_match or no_match plus the evidence behind it.
Does Didit check the CPF check digits or the registry record?
Both questions matter, but only one proves anything. A check-digit test confirms the 11 digits form a valid CPF string. The registry lookup confirms the number exists and that the name and date of birth you hold match the official record. Didit's Database Validation performs the registry lookup, and a format test is still worth keeping as a cheap pre-filter before you spend a lookup.
What do full_match, partial_match and no_match mean?
full_match means the fields you sent match the registry record. partial_match means some fields match and others do not, for example the date of birth matches and the name does not. no_match means the record is not in the registry, which is the synthetic-identity signal you build a policy around.
How much does a CPF database validation check cost?
Database Validation is variable per service and country, so the Brazil CPF line has its own rate rather than a flat country price. Published rates run up to $7.00 per check for the most expensive specialist sources, so read the exact Brazil CPF rate in the per-service pricing table in the docs. Billing is per completed service hit: a no-match can still be billable when the service hit completed, while a request where every selected upstream service fails returns HTTP 502 and is not billed.
Can I verify a CPF without a document photo?
Yes. The standalone endpoint at POST /v3/database-validation/ takes the identity data you already hold and runs the registry lookup server to server, so no selfie or document image is needed for Brazil. The selfie and gender fields on the same endpoint exist for the Argentina and Panama services that compare against a registry photo.
What happens when the CPF is not found in the registry?
You get match_type=no_match and a DATABASE_VALIDATION_NO_MATCH warning. Treat it as a synthetic identity per your policy. Do not use retries to override a no-match; recheck only when you have a documented reason to believe the source data changed, and remember that a no-match can still be billable when the service hit completed.
Which fields do I need to send to get a full match?
issuing_state=BRA and identification_number are required. first_name, last_name and date_of_birth are optional, but the match only covers the fields you send. If you send the CPF alone you learn that the number exists, not that it belongs to the person claiming it.
Is a CPF check billed when the upstream registry fails?
No. When every selected upstream service fails, the API returns HTTP 502 with validation_errors[], the request is not billed, and a COULD_NOT_PERFORM_DATABASE_VALIDATION log is written. Retry later or fall back to document OCR. A 400 from a malformed request is a request error, not a registry hit.
Can I run CPF validation inside a hosted flow instead of the API?
Yes. Add the DATABASE_VALIDATION feature to a workflow in the console or through POST /v3/workflows/, create a session, and read database_validations[] from the decision payload. Fields are fed into the lookup from the steps in front of it, and an ID Verification step is not required.
Where does manual review start in a CPF flow?
Review starts where you configure it. The session status of Approved, In Review or Declined follows the partial-match action and the no-match action set on the workflow, so a partial match can go to a reviewer or be declined automatically. Full matches are the only outcome that should approve without a human.
Is the sandbox free for CPF testing?
Sandbox testing is free and unlimited on every plan, and the Free plan adds $10 of monthly credit for eligible organizations that sign up with an eligible work email for a company domain. You can run the documented curl call end to end before you fund an account, which is how you confirm the Brazil service behaves the way this guide describes for your data.
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Tested in Spain's Treasury sandbox
Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy


