Skip to main content

Custom ID Document Templates: Extract Any Document (2026)

Custom templates on Didit are a field list sent with one file: Document AI reads the fields you name at $0.20 per document. It extracts and checks the file for manipulation, not issuer authenticity.

Custom ID Document Templates: Extract Any Document (2026)

Contents

In this guide

Jump to the part you need.

A custom document template on Didit is not a model you train. It is a field list you send with one file, and Document AI reads those fields from any PDF or image at $0.20 per document. It fits teams that receive payslips, bank statements, tax documents or invoices that no fixed step covers. The caveat matters: Document AI checks the file for manipulation, but it does not establish issuer authenticity for an unknown document design.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Custom document templates at a glance

Custom ID document templates on Didit, key facts
QuestionAnswer
What it isA list of 1 to 30 fields sent with a document to POST /v3/document-ai/, or the Document AI step inside a workflow
Price$0.20 per document, the same on the workflow step and on the standalone API
Known government IDs14,000+ document types in 220+ countries, $0.15 per check in a workflow, $0.20 on the ID Verification API
Fields per request1 to 30, typed as text, number or date; fields the model cannot find return null
FilesOne PDF or image per call
Name matchingname_match_score from 0 to 100, warning below the 80 default
Authenticity boundaryChecks the submitted file for manipulation; does not establish issuer authenticity for an unknown document design
Authenticationx-api-key header
Free to try$10 of monthly credit on the Free plan, unlimited sandbox

Start free in the sandbox at business.didit.me, with no sales call. Developers can connect Didit to an AI assistant through the Didit MCP server. For the extraction route, the Document AI overview documents the fields and warnings, and the public price list lets you size a run.

Two routes that people both call a custom template

We have two mechanisms that people mean when they say custom template, and picking the wrong one is where most of the wasted work happens. ID Verification handles government-issued documents that already exist in the library. Document AI handles everything else, from a payslip to a tax document, by reading the fields you name. Document AI takes a PDF or image and a field list of 1 to 30 fields, and it returns null for any field it cannot find. It checks the file for manipulation, not whether an unknown issuer is authentic.

Which Didit route to use for an unusual document
RouteWhat it acceptsWhat it establishesPrice
ID Verification, document capturePassports, ID cards, driver's licences and residence permits. 14,000+ types in 220+ countries and 54 languages, classified automaticallyDocumentary assurance: the document was captured, read and checked for authenticity$0.15 in a workflow, $0.20 on the standalone API
Document AIAny PDF or image, plus your own field list of 1 to 30 fields; fields it cannot find return nullWhat the file says and whether it looks manipulated, not issuer authenticity$0.20 per document
Non-document lookup or walletA national ID number and personal details, or a digital identity sign-inData match or cryptographic assurance, where the country supports itVariable for lookup, per-wallet prices published

ID Verification never asks you to declare the country or the type. It classifies the document, reads the visual zone with OCR, decodes the MRZ and any barcodes, then cross-checks dates, number formats and MRZ check digits. When the front image does not match a known official document design with high confidence, the standalone endpoint returns COULD_NOT_DETECT_DOCUMENT_TYPE and declines the request. That is exactly the case Document AI exists for. The distinction is simple: Document AI can tell you the file looks manipulated; it cannot tell you that a document was printed by the authority that supposedly issued it.

The Document AI step in the Didit Business Console with its configured field list
The hosted Document AI step and the standalone API support the same field-definition model.

Prerequisites

  • A Didit organization and an API key from the Business Console. Sandbox testing is free and unlimited, and nothing is charged in sandbox.
  • One sample file per document type. For ID Verification, use TIFF, JPG, JPEG, PNG, WebP or PDF up to 5 MB per file, uncropped, because the service detects, aligns and crops the document itself. Document AI accepts a PDF or image.
  • The field list written down before you send anything: a key, a name, an instruction and a type for each field.
  • The name you expect on the document, if you want the extracted name compared against it.
  • A decision on what happens on a warning. Every Document AI risk maps to an action parameter that accepts DECLINE, REVIEW or NO_ACTION.

How to define and run a custom document template

  1. Write the field list. Send 1 to 30 items. Each item has a key (lowercase letters, digits and underscores, unique within the request), a human-readable name, an instruction that tells the model what to look for, and a type of text, number or date. Set required on the fields you will not accept a document without, and is_full_name on at most one.
  2. Choose the action for each risk. The parameters are document_ai_unreadable_document_action, document_ai_missing_required_fields_action, document_ai_document_tampering_action, document_ai_name_mismatch_action and document_ai_unsupported_file_action. The strictest triggered action decides document_ai.status.
  3. Send the file and the list in one request. The endpoint is POST https://verification.didit.me/v3/document-ai/, the file goes in document, and the array goes in fields as a single JSON-encoded string. Bracket-style keys such as fields[0][key] return 400 before any extraction runs, so nothing is billed.
  4. Add the expected name. For a person send expected_first_name and expected_last_name, for a company send expected_company_name with an optional two-letter expected_company_country. Send one group or the other, never both.
  5. Read the status before the data. Check document_ai.status and document_ai.warnings first. Declined outranks In Review, which outranks Approved.
  6. Persist what you need. The response echoes the normalized fields and returns extracted_data keyed by your own keys, with null for anything the model could not find, so your downstream code maps to your vocabulary rather than to a fixed schema.
  7. Move it into a workflow once the field list is stable. Document AI is a feature node in the graph builder, so the same extraction runs beside ID Verification, liveness and face match in one session with one decision.

The call below defines two fields, one text and one number, and asks for the extracted name to be compared against Jane Doe.

curl -X POST https://verification.didit.me/v3/document-ai/ -H "x-api-key: $DIDIT_API_KEY" -F "document=@./bank-statement.pdf" -F 'fields=[{"key":"account_holder","name":"Account holder","instruction":"Full name of the account holder","type":"text","required":true,"is_full_name":true},{"key":"balance","name":"Closing balance","instruction":"Closing balance as a number","type":"number","required":true}]' -F "expected_first_name=Jane" -F "expected_last_name=Doe"

The endpoint does not change for a payslip, a bank statement or a tax document. You change the field instructions while keeping the same multipart API call.

Expected output

  • extracted_data, keyed by your field keys, typed as text, number or date, with dates returned as YYYY-MM-DD, and null for anything not found.
  • document_ai.detected_codes, one entry per QR code or barcode with its symbology, page number, position and parsed_payload. A located but damaged code comes back with parsed_payload: null, and a code-detection failure does not fail the request.
  • name_match_score from 0 to 100 plus name_on_document. A score below document_ai_name_match_score_threshold, which defaults to 80, raises DOCUMENT_AI_NAME_MISMATCH. The score is null when no name was found or no expected name was sent.
  • document_ai.status and document_ai.warnings, listing every triggered risk.
  • The normalized fields echoed back, so you can see exactly which instructions produced the result.

If the document is a known government ID, use the ID Verification endpoint instead. It returns { request_id, id_verification: { status, full_name, document_type, document_number, date_of_birth, expiration_date, parsed_address, mrz, barcodes, portrait_image, front_document_image, back_document_image, warnings } }, with status one of Not Started, In Progress, Approved, In Review, Declined, Abandoned or Kyc Expired.

Inputs and outputs

Inputs and outputs of POST /v3/document-ai/
NameDirectionWhat it does
documentInputThe PDF or image to read
fieldsInputJSON array string with 1 to 30 field definitions
expected_first_name, expected_last_nameInputPerson name to compare against the extracted name
expected_company_name, expected_company_countryInputCompany name to compare against, with an optional two-letter ISO country
document_ai_name_match_score_thresholdInputDefaults to 80
extracted_dataOutputValues keyed by your field keys, null when not found
document_ai.statusOutputApproved, In Review or Declined
document_ai.warningsOutputEvery triggered risk
detected_codesOutputQR and barcode payloads with page positions

Failure cases and recovery

Document AI and ID Verification failures, causes and recovery
SymptomCauseRecovery
400 before extraction startsfields sent as bracket-style form keys or as anything other than a JSON arraySend one JSON-encoded string. Nothing is billed.
DOCUMENT_AI_UNREADABLE_DOCUMENT, default REVIEWThe file could not be readAsk for a fresh capture. Set the action to DECLINE only if you will never accept a resubmission.
DOCUMENT_AI_MISSING_REQUIRED_FIELDS, default REVIEWA field marked required came back nullIf a required field is missing, review the field instruction and the returned warning before changing the action.
DOCUMENT_AI_SUSPECTED_MANIPULATION, default DECLINEManipulation detected in the fileDo not approve. Keep the file and the warning code with the decision.
DOCUMENT_AI_UNSUPPORTED_FILE, default REVIEWWrong file typeConvert to PDF or an image and resend.
DOCUMENT_AI_NAME_MISMATCH, default NO_ACTIONName score below the thresholdChange the action parameter if a mismatch should decline or go to review.
403 on the ID Verification endpointThe balance cannot cover the callTop up. Nothing is processed before the refusal.
400 with COULD_NOT_RECOGNIZE_DOCUMENTThe file cannot be processed at allRecapture. If a legitimate document keeps failing, route it to Document AI.
In Review with DOCUMENT_LIVENESS_NOT_COMPUTEDThe forgery check returned no usable scoreTreat the document as unchecked and send it to manual review. This escalation is not configurable and never overrides a decline.
A document being analysed during a Didit verification step
Extraction and the manipulation check run on the same file in one call, so one price covers both.

Putting the template inside a workflow

A standalone call is the fastest way to prove the field list. Once it works, add the Document AI node to a workflow in the visual graph builder and the extraction becomes one step in a session that also runs ID Verification, passive liveness and face match. The graph builder branches on extracted data, verification status, country, document type, document subtype, date of issue, age, webhook JSON paths or your own rules, so a user who submits a local permit can be routed down a different path from a user who submits a passport.

Accepted document types, subtypes, capture rules and thresholds for the ID Verification step live in documents_allowed on the feature config, and a workflow that says nothing about methods stays document capture only. Create the session with POST /v3/session/ using the workflow_id, send the user to the returned session.url, then read the result from GET /v3/session/{sessionId}/decision/ or from the session.status.updated webhook. Publish a new draft version when you change the field list, because sessions reference the exact version they were created with.

An ID document result inside a session in the Didit Business Console
A session shows the ID document result and its warnings next to the other steps, which is where a custom extraction belongs.

Worked cost example

Take an onboarding flow that runs 2,000 users a month. Every user gets a full ID check, which is $0.33: ID document verification $0.15, passive liveness $0.10, face match 1:1 $0.05 and device and IP analysis $0.03. Four hundred of those users submit a supporting document that no fixed step covers, a payslip or a tax document, so those 400 files go to Document AI at $0.20 each.

  • Full ID checks: 2,000 x $0.33 = $660.00
  • Document AI reads: 400 x $0.20 = $80.00
  • Monthly total at list price: $660.00 + $80.00 = $740.00

On Scale the same month costs less, because the plan discount is 10% on every Didit price:

  • Full ID checks: 2,000 x $0.297 = $594.00
  • Document AI reads: 400 x $0.18 = $72.00
  • Monthly total on Scale: $594.00 + $72.00 = $666.00

The $10 monthly credit on the Free plan covers 50 Document AI documents ($10.00 / $0.20) or 30 full ID checks ($10.00 / $0.33), which is enough to test a field list on real samples before you commit to a run.

  • Document AI is billed per document on its published line. The unit price does not change when you move from the standalone API to the workflow step.
  • ID Verification is $0.15 in a workflow and $0.20 on the standalone API. The API line is priced separately in the price book, and each 200 response consumes one credit.
  • Billing on rejected and completed calls. Malformed 400 requests rejected before extraction are not billed. A 403 for insufficient balance is also returned before processing; completed responses, including declines, follow the documented billing rules.
  • In Review is a stop, not an approval. Route those sessions to your own manual review queue and do not approve the user.
  • Manual review is your boundary to define. Decide before launch which warnings your team reviews and which you decline outright, and encode that in the action parameters rather than in a queue nobody owns.

When a custom template is the wrong tool

  • You need to prove a government ID is genuine. Use ID Verification, which compares the document against a known official design and returns documentary assurance. Document AI reads a file, it does not certify the issuer.
  • You want a model trained on your samples. Document AI runs Didit's default extraction model over the file with your instructions. There is no training step to wait for, and no per-customer model to maintain.
  • You only need the fields from a document that already has a dedicated step. A proof of address check has its own line price and comes with its own warnings and thresholds.

Sources

Next step: open business.didit.me, create a sandbox organization and run one of your own documents through Document AI with a three-field list. The sandbox is free and there is no sales call, so you can measure extraction accuracy on your real files before you spend anything.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What is a custom ID document template on Didit?

A custom ID document template on Didit is a list of 1 to 30 fields sent with one document to the Document AI API. Didit's default extraction model reads each field by its instruction and returns the values typed as text, number or date. You define the fields; you do not build or host a model.

Can Didit process a document type it has never seen?

Yes, with Document AI rather than ID Verification. Document AI extracts the fields you define from any PDF or image at $0.20 per document and checks the file for manipulation. It does not confirm issuer authenticity, so pair it with a registry or issuer check when that matters.

How much does a custom document extraction cost?

It is $0.20 per document on the Document AI line, the same whether you call the standalone API or run the step inside a workflow. The $10 monthly credit on the Free plan covers 50 documents. Plan discounts apply, 4% on Growth and 10% on Scale.

How many fields can I extract from one document?

A request accepts 1 to 30 field definitions, each with a key, a name, an instruction and a type. Mark at most one of them as the full name so name matching knows which value to compare. Anything the model cannot find comes back as null rather than as an error.

Does Didit train a model on my sample documents?

No. Document AI runs Didit's default extraction model over the file and you write the instructions for the fields. You change the field instructions while keeping the same multipart API call, so there is no training cycle to wait for.

What happens when a required field is missing?

A required field that comes back null raises DOCUMENT_AI_MISSING_REQUIRED_FIELDS, whose default action is REVIEW. The strictest triggered action decides document_ai.status, so one review risk keeps the document out of Approved. If a required field is missing, review the field instruction and the returned warning before changing the action.

Can I use a custom template for proof of address?

Yes. Bank statements and other supporting documents vary widely in layout, which is exactly what Document AI covers at $0.20 per document. Didit also has a dedicated Proof of Address step at $0.20 per check when the documents fit its supported set, and it appears as its own node in the workflow builder.

Can I run this inside a workflow instead of calling the API?

Yes. Document AI is a feature node in the graph builder, so the same field list runs beside ID Verification, liveness and face match in one session. The decision is then available from GET /v3/session/{sessionId}/decision/ or through the session.status.updated webhook.

Is a custom extraction the same as a KYC check?

Not by itself. The three assurance tiers describe the ID Verification methods, documentary for a document capture, data match for a lookup and cryptographic for a wallet sign-in. A Document AI read is not one of those methods, so use it next to ID Verification and biometrics rather than instead of them.

Can a coding agent write this integration for me?

Yes. Didit publishes an integration prompt a coding agent can follow end to end at didit.me/developers/integration-prompt, and the MCP server lets an assistant call Didit directly. The Document AI call is one multipart POST, so the agent's real work is writing and testing the field list.

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.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • 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.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • 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.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.