How to Validate a Brazilian CPF with an API (2026)
We check the CPF and personal details against Receita Federal. Continue after a full match, review a partial match, and treat no match as a synthetic-identity signal under your policy.

Contents
In this guide
Jump to the part you need.
Use this guide when you already hold a Brazilian CPF and the rest of the person's data server-side and want a one-shot check against the Receita Federal record. Our standalone API checks the submitted data against Receita Federal in one POST and returns full_match, partial_match or no_match. Billing is per successful service hit, and the Brazil CPF service has a service-specific rate that the general price feed does not quote, so read it from the per-service table first. The caveat: a registry miss alone does not prove fraud.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| Endpoint | POST https://verification.didit.me/v3/database-validation/ |
| Body | multipart/form-data |
| Authentication | x-api-key header, server side only |
| Country | issuing_state=BRA |
| Identifier | identification_number, mapped to the CPF by issuing_state |
| Service id | bra_cpf; omit services to run Brazil's default service |
| Also sent | first_name, last_name, date_of_birth, vendor_data |
| Source queried | Receita Federal, through SERPRO, queried directly rather than through an aggregator |
| Returns | request_id and database_validation with match_type, services_used, validations[] and warnings |
| Billing | Per successful service hit; the rate is set per service and Database Validation is listed as variable in the live price feed |
Start free in the sandbox at business.didit.me, with no sales call. Developers can also connect Didit to an AI assistant through the Didit MCP server. For Database Validation itself, start at the Didit Database Validation product page, and the Database Validation overview in our docs explains what the product checks and how this endpoint returns a result. The per-service pricing table quotes the rate for each service, and the Didit pricing page covers plans and module pricing.
What a CPF check against Receita Federal establishes
For Brazil, the authoritative source is Receita Federal, reached through SERPRO. We query it directly, so the answer comes from the body that holds the CPF record rather than from an aggregator's copy of it.
The response carries a per-field match and an aggregated outcome. Each entry in validations[] carries matched_fields and, when the source returns them, record_details. You can see that the date of birth matched while the surname did not, instead of getting one opaque yes or no.
We check whether the submitted CPF and personal details match a Receita Federal record. That is the whole claim. The call does not read a document and does not compare a face, so it confirms the data and not that the person in the browser owns the record. When you need that binding, send the same person through a session that compares a live capture against a verified ID document. The full ID check includes document verification, passive liveness and Face Match 1:1 at a $0.33 list price.
Two ways to run the check
Mode A is session based. You add the Database Validation feature to a workflow in the Business Console or through POST /v3/workflows/, create a session with POST /v3/session/, and read database_validations[] from GET /v3/session/{sessionId}/decision/. Subscribe to session.status.updated for status updates. In a hosted session, Database Validation receives identity fields from preceding workflow steps, and an ID Verification step is not required.
Mode B is the standalone server-to-server call. It fits when your own application already collected the CPF, name and date of birth, for example during signup or a payout request, and you want one registry answer before you release value. This page is about Mode B.

Prerequisites
- A Didit account and an API key. In the Business Console, pick the Application and open Developers, then API keys. The primary key belongs to the Application; create a separate key for each service or partner that needs one. New keys start with
sk_test_for a sandbox application andsk_live_for a live one. - The key stays on your server. It is a secret and it is never shipped to a browser or a mobile bundle.
- Credit on the plan, or a sandbox application. The sandbox is free on every plan.
- The CPF, first name, last name and date of birth you are authorized to submit for this check.
- curl, or any HTTP client that can send a multipart form.
Authentication details for every Didit host are in API authentication, and key scoping is in API keys.
The request to send
This is the documented call, with one line added to pin the Brazilian CPF service:
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" \
-F 'services=["bra_cpf"]'
The services line names bra_cpf explicitly. Remove it and the call runs Brazil's default service for issuing_state=BRA. The documented Brazilian CPF request sends first_name, last_name, and date_of_birth alongside the CPF. Use those fields in your request. List several services in that array only when you want more than one to run, because each service that hits can be billed.
Validate a CPF: step by step
Get the API key from the console. Copy the sandbox key into an environment variable such as
DIDIT_API_KEYso the curl call reads it. Switch to the live key only when the organization has credit and you are ready to bill real checks.Choose the service. Keep the
servicesline to pinbra_cpf, or remove it to run the country default. Each extra service is another possible billed hit.Send the request. Run the call above unchanged, apart from your own key and your own test data.
Keep
request_id. It is the identifier for this API call.Read the outcome. Start at
database_validation.match_type, then openvalidations[]to see which fields matched on which service.Branch on the outcome. For the standalone call, branch on
database_validation.match_type. Workflow-configured decisions apply to hosted sessions.Record the warnings.
warnings[]uses theDATABASE_VALIDATIONrisk codes, for exampleDATABASE_VALIDATION_NO_MATCH,DATABASE_VALIDATION_PARTIAL_MATCHandCOULD_NOT_PERFORM_DATABASE_VALIDATION. They are what your fraud rules and your case reviewers read.
What the response looks like
The standalone response contains these fields. The documented response shape is request_id plus a database_validation object, and values vary by source and by what the registry holds.
| Field | What it carries |
|---|---|
request_id | The identifier for this call. |
database_validation.match_type | full_match, partial_match or no_match. |
database_validation.validation_type | The validation type recorded for the call. |
database_validation.services_used | Which services actually ran. |
database_validation.match_score | The score for the match, where the response carries one. |
database_validation.validations[] | Per service: service, status, matched_fields, record_details. |
database_validation.warnings | The risk codes, for example DATABASE_VALIDATION_NO_MATCH. |
matched_fields and record_details are populated where the service returns them. The canonical schema is documented in the data models reference.
Handling the three match outcomes
| Outcome | What it establishes | What to do |
|---|---|---|
full_match | All identity fields evaluated by the service matched the registry record. See validations[].matched_fields for the field-level result. | Continue the flow. |
partial_match | Some identity fields matched and others differed. The date of birth can match while the surname differs. | Send the result to review and use matched_fields to see which fields differed. |
no_match | The registry returned no matching record. | Check the submitted details for input errors and handle the result as a synthetic-identity risk under your policy. |
A full match settles the data question and nothing else. If you need to know that the person presenting the CPF is the holder of that record, compare a live capture against a verified ID document in a hosted session.
If the lookup returns no_match, the registry returned no matching record. Check the submitted details for input errors and handle the result as a synthetic-identity risk under your policy. Branch on database_validation.match_type. Check database_validation.warnings for codes such as DATABASE_VALIDATION_NO_MATCH.
A partial match is a review case, not an automatic decline. The date of birth can match while the surname differs. Send the result to review and use matched_fields to see which fields differed, so the reviewer works from the original source of the data rather than from one opaque failure.

Failure cases and how to recover
These are transport and service failures, not registry answers. Keep them separate from the match outcomes above so you can tell a registry miss from a lookup that never completed.
| Status | What happened | What to do | Billed |
|---|---|---|---|
| 400 | The service id is not eligible for that issuing_state, a required field is missing, or a service flagged requires_consent was called without consent=true | Fix the request body; do not retry unchanged | No |
| 401 | The key is wrong, malformed, revoked or expired | Check DIDIT_API_KEY or issue a new key | No |
| 403 | No key was sent, the key has no access to this endpoint, the call came from outside the key's IP list, or the balance cannot cover the call | Read the body, then fix the key scope or top up | No |
| 429 | A rate limit was hit; writes default to 300 per minute per key | Wait for Retry-After, then back off with jitter | No |
502 with validation_errors[] | Every selected upstream service failed | The request is not billed and a COULD_NOT_PERFORM_DATABASE_VALIDATION log is written; retry later or fall back to OCR-only for that user | No |
| 500 or 503 | An unexpected error on our side, or a dependency was unavailable or the request timed out | Retry with backoff and contact support if it persists | Billing treatment is unspecified in the supplied endpoint docs |
Retry guidance for every status code is in API errors, and the per-endpoint limits and backoff pattern are in rate limiting. The warning catalogue is in database validation warnings, and per-service outcome codes are in outcome codes.
Request fields
| Field | What to send | Notes |
|---|---|---|
issuing_state | Yes | BRA for a CPF. It also tells us how to map the universal identifier field. |
identification_number | Yes | The CPF. We map this field to the CPF because issuing_state is BRA. |
first_name | Send it | The documented Brazilian CPF request sends it, and a name you leave out is a field that cannot be confirmed. |
last_name | Send it | As above. |
date_of_birth | Send it | The documented example uses 1990-01-15. |
vendor_data | Included in the example. | Your reference, included in the documented request as user-1234. |
services | Optional | Omit to run the country default. Pass ["bra_cpf"] to name the CPF service, or list several. |
consent | Conditional | Required as true only for services flagged requires_consent in the catalogue, otherwise HTTP 400. |
Argentina (arg_renaper) and Panama (pan_sib) additionally take a selfie and gender for a face match against the registry photograph. The documented bra_cpf request uses identity fields only.
Paid steps and review boundaries
- Billing is per successful service hit. A request that lists two services and gets a hit on both produces two usage events.
- We do not charge for the attempt when every selected upstream service fails and the API returns HTTP 502 with
validation_errors[]. A later successful service hit can be billed. - Our pricing page notes that some no-match lookups and retries can be billable. Read the billing rules for the exact service before you assume every miss is free.
- The Database Validation rate is variable and set per service. Read the Brazil CPF rate from the per-service pricing table rather than guessing it.
- The review boundary belongs to your policy, not to the API. Use
database_validation.match_typeto route the result and checkdatabase_validation.warningsfor any returned codes. Routepartial_matchto review and usevalidations[].matched_fieldsto identify the fields that differed.

Worked cost example
Take rCPF as the Brazil CPF rate on the per-service pricing table. The live feed lists Database Validation as variable and the rate is set per service rather than per country, so read the exact figure for bra_cpf before you quote one. Every figure below is a usage charge before plan fees, credits and taxes.
CPF checks alone, 10,000 successful hits a month:
- At list price: 10,000 x rCPF.
- On Growth, 4% off every Didit price: 10,000 x (0.96 x rCPF).
- On Scale, 10% off every Didit price: 10,000 x (0.90 x rCPF).
CPF checks plus a full ID check for the same 10,000 people:
- Full ID check at list price: 10,000 x $0.33 = $3,300.00.
- On Growth, $0.3168 per check: 10,000 x $0.3168 = $3,168.00, which is $132.00 less than list.
- On Scale, $0.297 per check: 10,000 x $0.297 = $2,970.00, which is $330.00 less than list.
- Combined at list price: 10,000 x rCPF + $3,300.00. On Growth: 10,000 x (0.96 x rCPF) + $3,168.00. On Scale: 10,000 x (0.90 x rCPF) + $2,970.00.
Two services in one request:
- When two eligible services both return billable hits, add the two service rates. If one is
bra_cpf, the request costs rCPF + rSecondService. - A run where every selected upstream service fails with a 502 is not billed, so that attempt costs $0. The retry that succeeds can be billed.
Sources
- Didit Database Validation product page, read November 26, 2026.
- Didit docs: Database Validation API overview, read November 26, 2026.
- Didit docs: per-service database validation pricing, read November 26, 2026.
- Didit docs: database validation warnings, read November 26, 2026.
- Didit docs: database validation outcome codes, read November 26, 2026.
- Didit docs: canonical data model for database validation, read November 26, 2026.
- Didit docs: API authentication, read November 26, 2026.
- Didit docs: API keys, read November 26, 2026.
- Didit docs: API errors, status codes and retries, read November 26, 2026.
- Didit docs: rate limiting and 429 backoff, read November 26, 2026.
- Didit docs: sandbox test data, read November 26, 2026.
- Didit docs: pricing, plans and credit, read November 26, 2026.
- Didit pricing page and pricing.json, read November 26, 2026.
- Didit MCP server, read November 26, 2026.
Next step: open the Business Console, create a free sandbox application, and run the curl example with its API key. Sandbox checks are mocked, so use the response to verify your request and parsing. No sales call is required.
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
How do I validate a CPF against Receita Federal with an API?
Send a multipart POST to https://verification.didit.me/v3/database-validation/ with an x-api-key header, issuing_state=BRA, the CPF in identification_number, plus first_name, last_name and date_of_birth. Add services=["bra_cpf"] to name the Brazilian CPF service, or omit services to run the country default. The response carries a match_type of full_match, partial_match or no_match.
Does Didit query Receita Federal directly or through an aggregator?
We query the authoritative source for the country directly. For Brazil that source is Receita Federal, reached through SERPRO, not a reseller's copy of the same data. Record details are returned when the source supplies them.
What does a no_match mean for a Brazilian CPF?
The lookup returned no matching record, so the registry returned no record for the details you submitted. Branch on database_validation.match_type. Check database_validation.warnings for codes such as DATABASE_VALIDATION_NO_MATCH. Check the submitted details for input errors and handle the result as a synthetic-identity risk under your policy, which usually means decline or hold rather than a blind retry.
What does partial_match mean and what should I do with it?
Some of the submitted identity fields matched the registry record and others did not. The date of birth can match while the surname differs. Send the result to review and use matched_fields to see which fields differed, so the reviewer works from the original source of the data.
Is a CPF lookup billed when nothing is found?
Billing is per successful service hit. We do not charge for the attempt when every selected upstream service fails and the API returns HTTP 502 with validation_errors[], though a later successful service hit can be billed. Our pricing page also notes that some no-match lookups and retries can be billable, so read the per-service table before treating every miss as free.
Do I have to send the name and date of birth with the CPF?
Send first_name, last_name and date_of_birth alongside the CPF, as shown in the documented request. Use those fields in your request, because the fields you send are the fields the response can report in matched_fields.
What happens if I omit the services field?
Omitting services runs the default service for the country you named, which for issuing_state=BRA is the Brazilian default. Sending services=["bra_cpf"] chooses the CPF service explicitly, and you can list more than one service if you want several to run. Each service that hits can be billed separately.
Can I test CPF validation in the sandbox before paying?
Yes. The sandbox is free on every plan. Sandbox checks are mocked, so use the response to verify your request shape and your parsing, then switch to the sk_live_ key when the organization has credit. Details are in sandbox test data.
Can I run the CPF check inside a hosted Didit session instead?
Yes, that is Mode A. Add the Database Validation feature to a workflow in the Business Console or through POST /v3/workflows/, create a session with POST /v3/session/, and read database_validations[] from GET /v3/session/{sessionId}/decision/. Subscribe to session.status.updated for status updates. In a hosted session, Database Validation receives identity fields from preceding workflow steps.
Which HTTP errors should I retry?
Retry 429 after the Retry-After value and add backoff with jitter on top. Retry 500 with backoff, and for a 503 check the error code before you retry, because the cause can be an unavailable dependency or a request that timed out. A 502 where every selected upstream service failed can be retried later, or you can fall back to OCR-only for that user. Do not retry 400, 401 or 403 until you have fixed the request, the key or the balance.
Does a full_match prove the person is who they say they are?
It proves that the CPF and the personal details you sent correspond to a Receita Federal record. It does not prove that the person in front of your application owns that record, because no document was inspected and no face was compared. To verify the person presenting the CPF, compare a live capture against a verified ID document. The full ID check includes document verification, passive liveness and Face Match 1:1 at a $0.33 list price.
Is this available for other countries too?
Yes. Our Database Validation documentation covers 60+ live countries, and the same endpoint takes a different issuing_state with the matching identifier, which we map from identification_number. For Brazil, the documented bra_cpf request sends first_name, last_name and date_of_birth. Argentina and Panama also accept a selfie and gender for a face match against the registry photograph.
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


