> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# दस्तावेज़ AI API: कस्टम दस्तावेज़ डेटा निष्कर्षण

> Didit का POST /v3/document-ai/ PDF या इमेज से आपके परिभाषित फ़ील्ड निकालता है, नाम मिलान और छेड़छाड़ जाँच के साथ। $0.20 प्रति दस्तावेज़।

एक दस्तावेज़ और उससे पढ़े जाने वाले फ़ील्ड की सूची भेजें। Didit दस्तावेज़ पर अपना डिफ़ॉल्ट एक्सट्रैक्शन मॉडल चलाता है, हर फ़ील्ड को उसके टाइप के साथ लौटाता है (`text`, `number`, या `date` जो `YYYY-MM-DD` के रूप में हो), समर्थित QR कोड और बारकोड का पता लगाकर उन्हें डिकोड करता है, फ़ाइल में छेड़छाड़ की जाँच करता है, और चाहें तो दस्तावेज़ पर लिखे नाम की तुलना उस व्यक्ति या कंपनी से कर सकता है जिसकी आप अपेक्षा करते हैं। इसका उपयोग धन का प्रमाण, वेतन पर्ची, बैंक स्टेटमेंट, कर दस्तावेज़, इनवॉइस, या किसी भी ऐसे दस्तावेज़ के लिए करें जो किसी निश्चित टेम्पलेट में फ़िट नहीं होता।

यह होस्टेड [Document AI](https://docs.didit.me/hi/core-technology/document-ai/overview.md) चरण का सर्वर-से-सर्वर संस्करण है। अनुरोध `multipart/form-data` होता है: फ़ाइल `document` में जाती है, और फ़ील्ड परिभाषाएँ `fields` में एक JSON-एन्कोड की गई ऐरे स्ट्रिंग के रूप में जाती हैं।

## निकालने के लिए फ़ील्ड परिभाषित करें

`fields` 1 से 30 आइटम की JSON ऐरे है, जिसे एकल स्ट्रिंग के रूप में भेजा जाता है। हर आइटम में एक `key` (केवल लोअरकेस अक्षर, अंक और अंडरस्कोर, अनुरोध के भीतर अद्वितीय), एक मानव-पठनीय `name`, एक `instruction` जो मॉडल को बताता है कि क्या खोजना है, एक `type` (`text`, `number`, या `date`), और दो फ़्लैग होते हैं: `required` और `is_full_name`।

```json theme={null}
[
  {
    "key": "account_holder",
    "name": "Account holder",
    "instruction": "Full name of the person or company the account belongs to",
    "type": "text",
    "required": true,
    "is_full_name": true
  },
  {
    "key": "balance",
    "name": "Closing balance",
    "instruction": "Closing balance shown on the statement, as a number without the currency symbol",
    "type": "number",
    "required": true
  },
  {
    "key": "currency",
    "name": "Currency",
    "instruction": "Three-letter currency code of the balance",
    "type": "text"
  },
  {
    "key": "statement_date",
    "name": "Statement date",
    "instruction": "Date the statement was issued",
    "type": "date",
    "required": true
  }
]
```

multipart अनुरोध में पूरा ऐरे एक ही फ़ॉर्म मान होता है:

```bash theme={null}
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"
```

रिस्पॉन्स सामान्यीकृत `fields` लौटाता है और `extracted_data` लौटाता है, जो आपके `key` मानों से कुंजीबद्ध होता है, जिसमें मॉडल को जो नहीं मिला उसके लिए `null` होता है। हर आइटम पर `name`, `instruction`, और `type` वैकल्पिक हैं (`type` का डिफ़ॉल्ट `text` है); `key` अनिवार्य है। `fields` को bracket-style form keys (`fields[0][key]=...`) के रूप में, या JSON ऐरे के अलावा किसी और रूप में भेजने पर कोई भी एक्सट्रैक्शन चलने से पहले `400` लौटता है, इसलिए कोई बिलिंग नहीं होती।

## QR कोड और बारकोड

हर सफल रिस्पॉन्स में `document_ai.detected_codes` शामिल होता है। हर आइटम में ये फ़ील्ड होते हैं:

| फ़ील्ड | विवरण |
| - | - |
| `type` | पहचानी गई कोड-प्रणाली, जैसे `QR_CODE`, `CODE_128`, `EAN_13`, `DATA_MATRIX`, या `PDF_417` |
| `page_number` | 1-आधारित पृष्ठ संख्या |
| `position` | रेंडर किए गए पेज के पिक्सेल में पहचाना गया बहुभुज, या कोई भरोसेमंद स्थान उपलब्ध न होने पर `null` |
| `x`, `y`, `width`, `height` | रेंडर किए गए पेज के पिक्सेल में बाउंडिंग बॉक्स, या कोई भरोसेमंद स्थान उपलब्ध न होने पर `null` |
| `page_width`, `page_height` | रेंडर किए गए पेज के आयाम, जिनसे निर्देशांक की गणना होती है |
| `parsed_payload` | डिकोड की गई स्ट्रिंग या संरचित मान, या केवल स्थान पता चलने पर `null` |
| `raw_payload` | उपलब्ध होने पर base64 स्ट्रिंग के रूप में रॉ डिकोडर payload; अन्यथा खाली स्ट्रिंग |

यह ऐरे PDF के हर संसाधित पृष्ठ को कवर करता है और कोई समर्थित कोड न मिलने पर खाली होता है। Didit कभी payload का अनुमान नहीं लगाता: क्षतिग्रस्त QR कोड उनके स्थान और `parsed_payload: null` के साथ लौटाए जा सकते हैं, जबकि कोड का पता लगाने में विफलता Document AI अनुरोध को विफल नहीं करती।

## नाम मिलान

अधिकतम एक फ़ील्ड को `is_full_name: true` के साथ चिह्नित करें और बताएं कि दस्तावेज़ किसका होना चाहिए:

| आप सत्यापन कर रहे हैं | भेजें | नाम की तुलना किससे होती है |
| - | - | - |
| व्यक्ति | `expected_first_name` + `expected_last_name` | व्यक्ति का पूरा नाम |
| कंपनी | `expected_company_name` (+ वैकल्पिक `expected_company_country`, 2-अक्षरों वाला ISO कोड) | कंपनी का नाम |

कोई एक समूह भेजें, दोनों नहीं। जब कोई नाम निकाला जाता है और अपेक्षित नाम मौजूद होता है, तो रिस्पॉन्स में `name_match_score` (0 से 100) और `name_on_document` शामिल होते हैं। `document_ai_name_match_score_threshold` (डिफ़ॉल्ट `80`) से कम स्कोर `DOCUMENT_AI_NAME_MISMATCH` चेतावनी उठाता है और `document_ai_name_mismatch_action` लागू करता है। यदि कोई फ़ील्ड `is_full_name` के रूप में चिह्नित नहीं है, तो Didit पहले टेक्स्ट फ़ील्ड पर वापस लौटता है जिसकी key नाम जैसी दिखती है (`name`, `holder`, `full_name`, `account_holder`); जब आप यह नियंत्रित करना चाहें कि किस मान की तुलना हो, तो फ़ील्ड को स्पष्ट रूप से चिह्नित करें। जब दस्तावेज़ पर कोई नाम मान नहीं मिलता, या कोई अपेक्षित नाम नहीं भेजा जाता, तो नाम जाँच छोड़ दी जाती है और `name_match_score` `null` होता है।

## जोखिम और कार्रवाइयाँ

नीचे का हर जोखिम एक कार्रवाई पैरामीटर से मेल खाता है जिसे आप प्रति अनुरोध सेट कर सकते हैं: `DECLINE`, `REVIEW`, या `NO_ACTION`। सबसे सख्त ट्रिगर हुई कार्रवाई `document_ai.status` तय करती है (`Declined` > `In Review` > `Approved`), और हर ट्रिगर हुआ जोखिम `document_ai.warnings` में सूचीबद्ध होता है। डिफ़ॉल्ट होस्टेड वर्कफ़्लो चरण से मेल खाते हैं; यह जानने के लिए कि हर जोखिम कैसे पहचाना जाता है, [Document AI नियम और चेतावनियाँ](https://docs.didit.me/hi/core-technology/document-ai/warnings-document-ai.md) देखें।

| जोखिम | पैरामीटर | डिफ़ॉल्ट |
| - | - | - |
| `DOCUMENT_AI_UNREADABLE_DOCUMENT` | `document_ai_unreadable_document_action` | `REVIEW` |
| `DOCUMENT_AI_MISSING_REQUIRED_FIELDS` | `document_ai_missing_required_fields_action` | `REVIEW` |
| `DOCUMENT_AI_SUSPECTED_MANIPULATION` | `document_ai_document_tampering_action` | `DECLINE` |
| `DOCUMENT_AI_NAME_MISMATCH` | `document_ai_name_mismatch_action` | `NO_ACTION` |
| `DOCUMENT_AI_UNSUPPORTED_FILE` | `document_ai_unsupported_file_action` | `REVIEW` |

## फ़ाइलें, सहेजना और बिलिंग

* **समर्थित फ़ाइलें:** PDF (कई पृष्ठों वाली PDF समर्थित), JPG, JPEG, PNG, TIFF, WebP, या दस्तावेज़ वाली ZIP फ़ाइल, 30 MB तक। एन्क्रिप्टेड PDF के लिए `400` लौटता है; इसके बजाय डिक्रिप्ट किया हुआ PDF या फ़ोटो अपलोड करें।
* **`save_api_request`** (डिफ़ॉल्ट `true`): अनुरोध, निकाले गए फ़ील्ड और पहचाने गए कोड Business Console में **Manual Checks** के अंतर्गत दिखते हैं, जहाँ आपकी टीम उनकी समीक्षा कर सकती है। सहेजना छोड़ने के लिए इसे `false` पर सेट करें।
* **`vendor_data`** और **`metadata`** रिस्पॉन्स में बिना बदले लौटाए जाते हैं, ताकि आप परिणाम को अपने रिकॉर्ड से जोड़ सकें।
* **कीमत:** प्रति दस्तावेज़ \$0.20, जिसका बिल दस्तावेज़ संसाधित होने और स्थिति लौटाए जाने पर किया जाता है। आपके प्लान की छूट लागू होती है। [मूल्य निर्धारण](https://docs.didit.me/hi/getting-started/pricing.md#स्टैंडअलोन-api-मूल्य-निर्धारण-सर्वर-से-सर्वर) देखें।

> [!NOTE]
>
> उपयोगकर्ता से दस्तावेज़ खुद अपलोड करवाना है, एक प्रवाह में 3 दस्तावेज़ तक जमा करने हैं, अपलोड स्क्रीन का स्वतः अनुवाद करना है, या निकाले गए फ़ील्ड को ID या प्रश्नावली डेटा से मिलाना है? तो इसके बजाय होस्टेड [Document AI वर्कफ़्लो चरण](https://docs.didit.me/hi/core-technology/document-ai/overview.md) का उपयोग करें।


## OpenAPI

````yaml hi/openapi-25.json POST /v3/document-ai/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: पहचान सत्यापन API। x-api-key हेडर के साथ प्रमाणीकृत करें।
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/document-ai/:
    post:
      tags:
        - Standalone APIs
      summary: Document AI (कस्टम फ़ील्ड निष्कर्षण + छेड़छाड़ जांच)
      description: >-
        किसी भी सहायक दस्तावेज़ — पेस्लिप, धन का प्रमाण, धन-संपत्ति के स्रोत
        संबंधी पत्र, कर विवरण, अनुबंध, इनवॉइस — से **आपके** द्वारा निर्धारित
        फ़ील्ड्स को एक ही कॉल में निकालें। फ़ाइल के साथ `fields` परिभाषा (key,
        नाम, निष्कर्षण निर्देश, प्रकार) भेजें और टाइप किए गए मान (`text`,
        `number`, `YYYY-MM-DD` के रूप में `date`), अपेक्षित व्यक्ति या कंपनी के
        विरुद्ध एक वैकल्पिक नाम-मिलान स्कोर, PDF/EXIF छेड़छाड़ संकेत, एक
        `Approved`/`Declined`/`In Review` `status`, और पाए गए प्रत्येक मुद्दे को
        समझाने वाली `warnings` सूची वापस प्राप्त करें। यह होस्ट किए गए Document
        AI वर्कफ़्लो चरण (देखें `/core-technology/document-ai/overview`) का
        सर्वर-टू-सर्वर समकक्ष है; यह Didit के डिफ़ॉल्ट निष्कर्षण मॉडल का उपयोग
        करता है और प्रदाता चयन उपलब्ध नहीं कराता है।


        **विलंबता (Latency)।** निष्कर्षण LLM-आधारित है: सामान्य कॉल्स में **5–15
        सेकंड** लगते हैं, बहु-पृष्ठ PDF में **~30 सेकंड** तक का समय लग सकता है।
        **कम से कम 45 सेकंड** का क्लाइंट टाइमआउट कॉन्फ़िगर करें और कॉल पूरा होने
        से पहले पुनः प्रयास न करें।


        **अनुरोध प्रारूप।** केवल `multipart/form-data`। `fields` **एक
        JSON-एन्कोडेड ऐरे स्ट्रिंग** है (1–30 आइटम, अधिकतम 16 KB); ब्रैकेट-शैली
        वाले फ़ॉर्म ऐरे को `400` के साथ अस्वीकार कर दिया जाता है। प्रत्येक आइटम
        `{key, name, instruction, type, required, is_full_name}` है — `key` वह
        JSON कुंजी है जो आपको वापस मिलती है (`^[a-z0-9_]{1,64}$`, अद्वितीय),
        `instruction` मॉडल को बताता है कि क्या पढ़ना है, `type` `text`
        (डिफ़ॉल्ट) | `number` | `date` है, मान न पढ़े जा सकने पर `required`
        `DOCUMENT_AI_MISSING_REQUIRED_FIELDS` उत्पन्न करता है, और अपेक्षित नाम
        से तुलना किए जाने वाले मान को चिह्नित करने के लिए अधिकतम एक फ़ील्ड
        `is_full_name: true` सेट कर सकता है।


        **नाम मिलान।** `expected_first_name` + `expected_last_name` (व्यक्ति)
        **या** `expected_company_name` (+ वैकल्पिक `expected_company_country`)
        पास करें — दोनों नहीं। `is_full_name` फ़ील्ड के मान (या, जब कोई चिह्नित
        न हो, तो पहला टेक्स्ट फ़ील्ड जिसकी कुंजी नाम जैसी दिखती है) की फ़ज़ी
        तुलना की जाती है; दोनों पक्ष मौजूद होने पर `name_match_score` (0–100) और
        `name_on_document` हमेशा लौटाए जाते हैं, और
        `document_ai_name_match_score_threshold` (डिफ़ॉल्ट 80) से कम स्कोर
        `DOCUMENT_AI_NAME_MISMATCH` जोड़ता है, जो
        `document_ai_name_mismatch_action` द्वारा नियंत्रित होता है।


        **निर्णय तर्क।** प्रत्येक जोखिम एक कॉन्फ़िगर करने योग्य कार्रवाई से मैप
        होता है: `DECLINE` → `status: "Declined"`, `REVIEW` → `status: "In
        Review"`, `NO_ACTION` → केवल सूचनात्मक। डिफ़ॉल्ट वर्कफ़्लो चरण को
        दर्शाते हैं: न पढ़ा जा सकने वाला दस्तावेज़ `REVIEW`, अनुपस्थित आवश्यक
        फ़ील्ड्स `REVIEW`, संदिग्ध हेरफेर `DECLINE`, नाम बेमेल `NO_ACTION`,
        असमर्थित फ़ाइल `REVIEW`। जिस दस्तावेज़ को संसाधित नहीं किया जा सकता वह
        `400` लौटाता है; एक पठनीय लेकिन समस्याग्रस्त दस्तावेज़ `Declined`/`In
        Review` के साथ `200` लौटाता है — हमेशा केवल HTTP कोड ही नहीं, बल्कि
        `document_ai.status` और `document_ai.warnings` की भी जांच करें।


        **बिलिंग।** प्रत्येक `200` रिस्पॉन्स एक Document AI API क्रेडिट का उपभोग
        करता है — सूची मूल्य पर **$0.20 प्रति दस्तावेज़**, जिसका भुगतान आपके
        प्लान क्रेडिट या टॉप-अप बैलेंस से किया जाता है। जब संगठन का बैलेंस कॉल
        को कवर नहीं कर सकता, तो endpoint किसी भी प्रसंस्करण से पहले `403` लौटाता
        है। सैंडबॉक्स API कुंजियाँ एक नियतात्मक मॉक रिस्पॉन्स लौटाती हैं और उनसे
        कोई शुल्क नहीं लिया जाता है।


        **स्थायित्व (Persistence)।** `save_api_request=true` (डिफ़ॉल्ट) के साथ
        कॉल को API-प्रकार के सत्र के रूप में संग्रहीत किया जाता है: दस्तावेज़,
        निकाले गए मान, फ़ील्ड परिभाषाएँ और नाम-मिलान स्नैपशॉट रखे जाते हैं, सत्र
        Business Console में दिखाई देता है, और `request_id` `GET
        /v3/session/{sessionId}/decision/` के साथ काम करता है।
      operationId: post_v3document-ai
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - document
                - fields
              properties:
                document:
                  type: string
                  format: binary
                  description: >-
                    रीड किया जाने वाला दस्तावेज़। अनुमत एक्सटेंशन: `tiff`,
                    `jpg`, `jpeg`, `png`, `pdf`, `webp`, `zip`। अधिकतम अपलोड
                    आकार: **30 MB** (बड़ी फ़ाइलों को `400` के साथ अस्वीकार कर
                    दिया जाता है)। मल्टी-पेज PDF समर्थित हैं (अधिक विलंबता की
                    अपेक्षा करें); एन्क्रिप्टेड PDF को `400` के साथ अस्वीकार कर
                    दिया जाता है। प्रोसेसिंग से पहले छवियों को स्वचालित रूप से
                    कंप्रेस किया जाता है।
                fields:
                  type: string
                  description: >-
                    **1–30** फ़ील्ड परिभाषाओं (अधिकतम 16 KB) के साथ एक
                    JSON-एन्कोडेड ऐरे स्ट्रिंग। प्रत्येक आइटम: `key` (आवश्यक,
                    `^[a-z0-9_]{1,64}$`, अद्वितीय — `extracted_data` में लौटाई
                    गई कुंजी), `name` (≤100 वर्ण, संदेशों में दिखाया गया),
                    `instruction` (≤500 वर्ण, मॉडल को क्या पढ़ना चाहिए), `type`
                    (`text` डिफ़ॉल्ट | `number` | `date`), `required` (बूलियन,
                    डिफ़ॉल्ट `false`), `is_full_name` (बूलियन, डिफ़ॉल्ट `false`,
                    प्रति अनुरोध अधिकतम एक)। ब्रैकेट-शैली के फ़ॉर्म ऐरे, अमान्य
                    JSON, डुप्लिकेट कुंजियाँ, या एक से अधिक `is_full_name` किसी
                    भी प्रोसेसिंग या बिलिंग से पहले `400` लौटाते हैं।
                  example: >-
                    [{"key": "employer_name", "name": "Employer name",
                    "instruction": "The employer or company issuing the
                    payslip.", "type": "text", "required": true, "is_full_name":
                    false}, {"key": "employee_name", "name": "Employee name",
                    "instruction": "The full name of the employee as printed on
                    the payslip.", "type": "text", "required": true,
                    "is_full_name": true}, {"key": "net_pay", "name": "Net pay",
                    "instruction": "The net amount paid to the employee for the
                    period.", "type": "number", "required": true,
                    "is_full_name": false}, {"key": "pay_date", "name": "Pay
                    date", "instruction": "The payment date shown on the
                    payslip.", "type": "date", "required": false,
                    "is_full_name": false}]
                expected_first_name:
                  type: string
                  description: >-
                    दस्तावेज़ के नाम फ़ील्ड के विरुद्ध सत्यापित करने के लिए पहला
                    नाम (फ़ज़ी मिलान, लिप्यंतरण-सचेत)। `expected_last_name` के
                    साथ उपयोग करें; इसे `expected_company_name` के साथ संयोजित
                    नहीं किया जा सकता है।
                  example: Sophia
                expected_last_name:
                  type: string
                  description: >-
                    दस्तावेज़ के नाम फ़ील्ड के विरुद्ध सत्यापित करने के लिए
                    अंतिम नाम, `name_match_score` के लिए `expected_first_name`
                    के साथ संयुक्त।
                  example: Martinez
                expected_company_name:
                  type: string
                  description: >-
                    दस्तावेज़ के नाम फ़ील्ड के विरुद्ध सत्यापित करने के लिए
                    कंपनी का नाम (व्यावसायिक दस्तावेज़ों के लिए)। इसे
                    `expected_first_name` / `expected_last_name` के साथ संयोजित
                    नहीं किया जा सकता है (उद्देश्यपूर्ण रूप से कोई उदाहरण मान
                    नहीं है — जनरेट किया गया अनुरोध नमूना व्यक्ति फ़ील्ड का
                    उपयोग करता है; व्यावसायिक दस्तावेज़ को सत्यापित करते समय
                    उन्हें इसके लिए बदलें)।
                expected_company_country:
                  type: string
                  description: >-
                    वैकल्पिक ISO 3166-1 alpha-2 देश कोड (दो ASCII अक्षर, उदा.
                    `FR`) जो `expected_company_name` के लिए कंपनी-नाम
                    सामान्यीकरण को ट्यून करता है। केवल `expected_company_name`
                    के साथ उपयोग किया जाता है।
                document_ai_name_match_score_threshold:
                  type: integer
                  minimum: 0
                  maximum: 100
                  default: 80
                  description: >-
                    नाम को मिलान माना जाने के लिए न्यूनतम `name_match_score`
                    (0–100)। कम स्कोर `DOCUMENT_AI_NAME_MISMATCH` जोड़ता है, जो
                    `document_ai_name_mismatch_action` द्वारा नियंत्रित होता है।
                  example: 80
                document_ai_unreadable_document_action:
                  type: string
                  enum:
                    - DECLINE
                    - REVIEW
                    - NO_ACTION
                  default: REVIEW
                  description: >-
                    जब दस्तावेज़ से कोई फ़ील्ड नहीं पढ़ा जा सका
                    (`DOCUMENT_AI_UNREADABLE_DOCUMENT`) तो क्या कार्रवाई करें।
                document_ai_missing_required_fields_action:
                  type: string
                  enum:
                    - DECLINE
                    - REVIEW
                    - NO_ACTION
                  default: REVIEW
                  description: >-
                    जब कम से कम एक `required` फ़ील्ड नहीं पढ़ा जा सका
                    (`DOCUMENT_AI_MISSING_REQUIRED_FIELDS`;
                    `additional_data.missing_fields` उन्हें सूचीबद्ध करता है) तो
                    क्या कार्रवाई करें।
                document_ai_document_tampering_action:
                  type: string
                  enum:
                    - DECLINE
                    - REVIEW
                    - NO_ACTION
                  default: DECLINE
                  description: >-
                    जब PDF/EXIF फ़ोरेंसिक्स में हेरफेर का संदेह हो तो क्या
                    कार्रवाई करें — डिजिटल हस्ताक्षर के बाद संशोधित, ज्ञात PDF
                    संपादक, ओवरले-टेक्स्ट हेरफेर, संदिग्ध पुनः एक्सपोर्ट, छवि
                    विसंगतियाँ (`DOCUMENT_AI_SUSPECTED_MANIPULATION`)।
                document_ai_name_mismatch_action:
                  type: string
                  enum:
                    - DECLINE
                    - REVIEW
                    - NO_ACTION
                  default: NO_ACTION
                  description: >-
                    जब `name_match_score` थ्रेशोल्ड से कम हो तो क्या कार्रवाई
                    करें (`DOCUMENT_AI_NAME_MISMATCH`)।
                document_ai_unsupported_file_action:
                  type: string
                  enum:
                    - DECLINE
                    - REVIEW
                    - NO_ACTION
                  default: REVIEW
                  description: >-
                    अपलोड के रिक्त होने या प्रोसेस करने योग्य फ़ाइल न होने
                    (`DOCUMENT_AI_UNSUPPORTED_FILE`) पर क्या कार्रवाई की जाए।
                save_api_request:
                  type: boolean
                  default: true
                  description: >-
                    `true` (डिफ़ॉल्ट) होने पर, कॉल को API-प्रकार के सत्र के रूप
                    में बनाए रखता है — Business Console में दृश्यमान, लौटाए गए
                    `request_id` का उपयोग करके `GET
                    /v3/session/{sessionId}/decision/` के माध्यम से प्राप्त करने
                    योग्य, जिसमें अपलोड किया गया दस्तावेज़, निकाले गए मान,
                    फ़ील्ड परिभाषाएँ और नाम-मिलान स्नैपशॉट संग्रहीत होते हैं।
                    `false` होने पर, कुछ भी संग्रहीत नहीं किया जाता है और
                    `request_id` केवल रिस्पॉन्स सहसंबंध के लिए एक अस्थायी UUID
                    होता है; कॉल के लिए बिलिंग अभी भी की जाती है।
                  example: true
                vendor_data:
                  type: string
                  description: >-
                    वैकल्पिक अपारदर्शी स्ट्रिंग (आपकी आंतरिक उपयोगकर्ता ID,
                    ईमेल, UUID…) जो स्थायी सत्र पर संग्रहीत होती है और रिस्पॉन्स
                    में वापस भेजी जाती है। इसका उपयोग अपने स्वयं के रिकॉर्ड के
                    साथ API कॉल को सहसंबंधित करने और बाद में सत्रों को फ़िल्टर
                    करने के लिए करें।
                  example: user-123
                metadata:
                  type: object
                  additionalProperties: true
                  description: >-
                    सत्र के साथ संग्रहीत वैकल्पिक JSON ऑब्जेक्ट (जब
                    `save_api_request=true`) और रिस्पॉन्स में वापस प्रतिध्वनित
                    होता है। मल्टीपार्ट अनुरोधों में, इसे JSON-एन्कोडेड स्ट्रिंग
                    फ़ील्ड (उदा. `metadata={"flow":"onboarding"}`) के रूप में
                    भेजें — इसे एक ऑब्जेक्ट में पार्स किया जाता है।
                  example:
                    flow: onboarding
      responses:
        '200':
          description: >-
            दस्तावेज़ संसाधित। `document_ai.status` `Approved`, `Declined`, या
            `In Review` है; हर संसूचित समस्या को `document_ai.warnings` में
            सूचीबद्ध किया गया है। समस्याग्रस्त दस्तावेज़ भी `200` लौटाता है —
            केवल HTTP कोड ही नहीं, बल्कि बॉडी का भी निरीक्षण करें। जब
            `save_api_request=true` हो, तो `request_id` स्थायी सत्र id होती है।
          content:
            application/json:
              examples:
                Approved:
                  summary: पेस्लिप स्पष्ट रूप से पढ़ी गई, नाम मेल खा गया
                  value:
                    request_id: 9d6a3b1e-2f0c-4a8e-9b7d-1c2e3f4a5b6c
                    document_ai:
                      status: Approved
                      extracted_data:
                        employer_name: Acme Payments Ltd
                        employee_name: Sophia Martinez
                        net_pay: 3120.5
                        pay_date: '2026-07-31'
                      detected_codes:
                        - type: CODE_128
                          page_number: 1
                          position:
                            - - 96
                              - 456
                            - - 96
                              - 616
                            - - 1012
                              - 611
                            - - 1015
                              - 456
                          x: 96
                          'y': 456
                          width: 919
                          height: 160
                          page_width: 1200
                          page_height: 1700
                          raw_payload: SU5WLTIwMjYtMDA0Mg==
                          parsed_payload: INV-2026-0042
                      fields:
                        - key: employer_name
                          name: Employer name
                          instruction: The employer or company issuing the payslip.
                          type: text
                          required: true
                          is_full_name: false
                        - key: employee_name
                          name: Employee name
                          instruction: >-
                            The full name of the employee as printed on the
                            payslip.
                          type: text
                          required: true
                          is_full_name: true
                        - key: net_pay
                          name: Net pay
                          instruction: The net amount paid to the employee for the period.
                          type: number
                          required: true
                          is_full_name: false
                        - key: pay_date
                          name: Pay date
                          instruction: The payment date shown on the payslip.
                          type: date
                          required: false
                          is_full_name: false
                      name_match_score: 100
                      name_on_document: Sophia Martinez
                      warnings: []
                    vendor_data: user-123
                    metadata:
                      flow: onboarding
                    created_at: '2026-08-19T16:40:12.318Z'
                In Review — missing required field:
                  summary: '`net_pay` को पढ़ा नहीं जा सका; डिफ़ॉल्ट कार्रवाई REVIEW'
                  value:
                    request_id: 3f2a9c7b-5d4e-4b1a-8c6f-0e9d8c7b6a5f
                    document_ai:
                      status: In Review
                      extracted_data:
                        employer_name: Acme Payments Ltd
                        employee_name: Sophia Martinez
                        net_pay: null
                        pay_date: '2026-07-31'
                      detected_codes: []
                      fields:
                        - key: employer_name
                          name: Employer name
                          instruction: The employer or company issuing the payslip.
                          type: text
                          required: true
                          is_full_name: false
                        - key: employee_name
                          name: Employee name
                          instruction: >-
                            The full name of the employee as printed on the
                            payslip.
                          type: text
                          required: true
                          is_full_name: true
                        - key: net_pay
                          name: Net pay
                          instruction: The net amount paid to the employee for the period.
                          type: number
                          required: true
                          is_full_name: false
                        - key: pay_date
                          name: Pay date
                          instruction: The payment date shown on the payslip.
                          type: date
                          required: false
                          is_full_name: false
                      name_match_score: 100
                      name_on_document: Sophia Martinez
                      warnings:
                        - risk: DOCUMENT_AI_MISSING_REQUIRED_FIELDS
                          feature: DOCUMENT_AI
                          additional_data:
                            missing_fields:
                              - Net pay
                          log_type: warning
                          short_description: Required fields could not be extracted
                          long_description: >-
                            One or more fields configured as required could not
                            be extracted from the uploaded document.
                    vendor_data: null
                    metadata: null
                    created_at: '2026-08-19T16:41:05.002Z'
                Declined — suspected manipulation:
                  summary: >-
                    PDF फोरेंसिक ने एक ज्ञात एडिटर को फ़्लैग किया; डिफ़ॉल्ट
                    कार्रवाई DECLINE
                  value:
                    request_id: 7c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f
                    document_ai:
                      status: Declined
                      extracted_data:
                        employer_name: Acme Payments Ltd
                        employee_name: Sophia Martinez
                        net_pay: 3120.5
                        pay_date: '2026-07-31'
                      detected_codes: []
                      fields:
                        - key: employer_name
                          name: Employer name
                          instruction: The employer or company issuing the payslip.
                          type: text
                          required: true
                          is_full_name: false
                        - key: employee_name
                          name: Employee name
                          instruction: >-
                            The full name of the employee as printed on the
                            payslip.
                          type: text
                          required: true
                          is_full_name: true
                        - key: net_pay
                          name: Net pay
                          instruction: The net amount paid to the employee for the period.
                          type: number
                          required: true
                          is_full_name: false
                        - key: pay_date
                          name: Pay date
                          instruction: The payment date shown on the payslip.
                          type: date
                          required: false
                          is_full_name: false
                      name_match_score: null
                      name_on_document: Sophia Martinez
                      warnings:
                        - risk: DOCUMENT_AI_SUSPECTED_MANIPULATION
                          feature: DOCUMENT_AI
                          additional_data:
                            detection_method: known_editor
                            processed_by_known_editor: ilovepdf
                          log_type: error
                          short_description: Suspected document manipulation
                          long_description: >-
                            The system detected signs of potential manipulation
                            or editing in the uploaded document.
                    vendor_data: null
                    metadata: null
                    created_at: '2026-08-19T16:42:40.771Z'
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    format: uuid
                    description: >-
                      `save_api_request=true` होने पर सहेजी गई सत्र ID (`GET
                      /v3/session/{sessionId}/decision/` के साथ उपयोग योग्य);
                      अन्यथा एक क्षणिक सहसंबंध UUID।
                  document_ai:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - Approved
                          - Declined
                          - In Review
                        description: >-
                          `Approved` जब कोई चेतावनी अस्वीकृति या समीक्षा में
                          नहीं बदलती है; `Declined` जब कम से कम एक जोखिम
                          `DECLINE` पर मैप होता है; अन्यथा `In Review` जब कम से
                          कम एक जोखिम `REVIEW` पर मैप होता है। `warnings` सूची
                          बताती है कि ऐसा क्यों है।
                      extracted_data:
                        type: object
                        additionalProperties: true
                        description: >-
                          अनुरोधित प्रति फ़ील्ड कुंजी एक प्रविष्टि। मान फ़ील्ड
                          `type` के अनुसार टाइप किए जाते हैं — `text` के लिए
                          स्ट्रिंग, `number` के लिए संख्याएं, `date` के लिए
                          `YYYY-MM-DD` स्ट्रिंग — या मान न पढ़े जा सकने पर
                          `null`।
                        example:
                          employer_name: Acme Payments Ltd
                          employee_name: Sophia Martinez
                          net_pay: 3120.5
                          pay_date: '2026-07-31'
                      detected_codes:
                        type: array
                        description: >-
                          प्रत्येक संसाधित पृष्ठ पर पहचाने गए QR कोड और बारकोड।
                          कोई न मिलने पर खाली। पहचाना गया लेकिन डिकोड न किया जा
                          सकने वाला QR कोड `parsed_payload: null` रखता है।
                        items:
                          $ref: '#/components/schemas/DocumentAIDetectedCode'
                      fields:
                        type: array
                        description: >-
                          इस निष्कर्षण के लिए उपयोग की गई सामान्यीकृत फ़ील्ड
                          परिभाषाएँ, जो वापस दी गई हैं (`save_api_request=true`
                          होने पर सत्र के साथ भी संग्रहीत)।
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            name:
                              type: string
                            instruction:
                              type: string
                            type:
                              type: string
                              enum:
                                - text
                                - number
                                - date
                            required:
                              type: boolean
                            is_full_name:
                              type: boolean
                      name_match_score:
                        type: number
                        nullable: true
                        minimum: 0
                        maximum: 100
                        description: >-
                          `name_on_document` और अपेक्षित व्यक्ति/कंपनी के नाम के
                          बीच फ़ज़ी समानता (0–100)। जब भी नाम मान और अपेक्षित
                          नाम दोनों मौजूद होते हैं, तब लौटाया जाता है — मिलानों
                          **और** बेमेलों पर; अन्यथा `null`।
                        example: 96
                      name_on_document:
                        type: string
                        nullable: true
                        description: >-
                          दस्तावेज़ से लिया गया नाम मान (`is_full_name` फ़ील्ड,
                          या पहला नाम जैसा टेक्स्ट फ़ील्ड) जिसकी अपेक्षित नाम के
                          विरुद्ध तुलना की गई थी। कोई नाम मान उपलब्ध न होने पर
                          `null`।
                        example: Sophia Martinez
                      warnings:
                        type: array
                        description: >-
                          बिना किसी जोखिम वाली स्वीकृति पर खाली। प्रत्येक
                          प्रविष्टि पहचाने गए एक जोखिम की व्याख्या करती है;
                          `log_type: "error"` वाली प्रविष्टियाँ `status` को
                          `Declined` पर सेट करती हैं, `log_type: "warning"` वाली
                          प्रविष्टियाँ इसे `In Review` पर सेट करती हैं।
                        items:
                          type: object
                          properties:
                            risk:
                              type: string
                              enum:
                                - DOCUMENT_AI_UNREADABLE_DOCUMENT
                                - DOCUMENT_AI_MISSING_REQUIRED_FIELDS
                                - DOCUMENT_AI_SUSPECTED_MANIPULATION
                                - DOCUMENT_AI_NAME_MISMATCH
                                - DOCUMENT_AI_UNSUPPORTED_FILE
                              description: >-
                                मशीन-पठनीय जोखिम कोड। प्रत्येक मिलान वाले
                                `document_ai_*_action` अनुरोध विकल्प द्वारा
                                नियंत्रित होता है।
                              example: DOCUMENT_AI_MISSING_REQUIRED_FIELDS
                            feature:
                              type: string
                              enum:
                                - DOCUMENT_AI
                              description: >-
                                सुविधा जिसने चेतावनी उत्पन्न की। इस endpoint पर
                                हमेशा `DOCUMENT_AI`।
                            additional_data:
                              type: object
                              nullable: true
                              additionalProperties: true
                              description: >-
                                जोखिम के लिए अतिरिक्त संदर्भ: अनुपलब्ध आवश्यक
                                फ़ील्ड के लिए `{"missing_fields": ["Net pay"]}`,
                                नाम बेमेल होने पर `{"name_on_document", "score",
                                "threshold"}`, और संदिग्ध हेरफेर के लिए
                                फ़ोरेंसिक निष्कर्ष (`detection_method`,
                                निर्माता/संपादक विवरण)। जोड़ने के लिए कुछ न होने
                                पर `null`।
                              example:
                                missing_fields:
                                  - Net pay
                            log_type:
                              type: string
                              enum:
                                - error
                                - warning
                                - information
                              description: >-
                                कॉन्फ़िगर की गई कार्रवाई से प्राप्त गंभीरता:
                                `error` (DECLINE), `warning` (REVIEW),
                                `information` (NO_ACTION)।
                            short_description:
                              type: string
                              description: जोखिम के लिए मानव-पठनीय एक पंक्ति का विवरण।
                              example: Required fields could not be extracted
                            long_description:
                              type: string
                              description: >-
                                मानव-पठनीय स्पष्टीकरण, जहाँ प्रासंगिक हो
                                `additional_data` के साथ इंटरपोलेट किया गया।
                  vendor_data:
                    type: string
                    nullable: true
                    description: आपके द्वारा भेजे गए `vendor_data` का इको, या `null`।
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: आपके द्वारा भेजे गए `metadata` ऑब्जेक्ट का इको, या `null`।
                  created_at:
                    type: string
                    format: date-time
                    description: अनुरोध कब प्रोसेस किया गया था (UTC, ISO 8601)।
        '400':
          description: >-
            सत्यापन या प्रोसेसिंग त्रुटि। फ़ील्ड-स्तरीय समस्याएं DRF का मानक
            एनवेलप (प्रत्येक समस्याग्रस्त फ़ील्ड के लिए संदेशों का एक एरे)
            लौटाती हैं। एन्क्रिप्टेड या पढ़ने में असमर्थ दस्तावेज़ और निष्कर्षण
            विफलताएं `{"error": ...}` लौटाती हैं।
          content:
            application/json:
              examples:
                Missing document:
                  summary: फ़ॉर्म डेटा में `document` शामिल नहीं है
                  value:
                    document:
                      - No file was submitted.
                Invalid fields payload:
                  summary: '`fields` एक JSON-एन्कोडेड ऐरे स्ट्रिंग नहीं है'
                  value:
                    fields:
                      - fields must be a valid JSON array string.
                Duplicate field keys:
                  summary: दो आइटम समान `key` साझा करते हैं
                  value:
                    fields:
                      - Every fields item must have a unique key.
                Conflicting expectations:
                  summary: व्यक्ति और कंपनी की अपेक्षाएं एक साथ भेजी गईं
                  value:
                    non_field_errors:
                      - >-
                        Provide either person expected-name fields or
                        expected_company_name, not both.
                Invalid metadata:
                  summary: >-
                    `metadata` एक JSON ऑब्जेक्ट नहीं है (या इसमें NUL वर्ण शामिल
                    है)
                  value:
                    metadata:
                      - Metadata must be a JSON object.
                Oversized vendor_data:
                  summary: '`vendor_data` 2,000-बाइट की सीमा से अधिक है'
                  value:
                    vendor_data:
                      - vendor_data is too long (maximum 2000 bytes).
                Encrypted PDF:
                  summary: पासवर्ड से सुरक्षित PDF
                  value:
                    error: >-
                      The PDF is encrypted. Please upload a decrypted PDF or a
                      photo instead.
                Extraction failed:
                  summary: निष्कर्षण पाइपलाइन दस्तावेज़ को प्रोसेस नहीं कर सकी
                  value:
                    error:
                      - Error extracting Document AI information
              schema:
                type: object
                additionalProperties: true
        '403':
          description: >-
            अनुमति अस्वीकृत। तब लौटाया जाता है जब `x-api-key` हेडर अनुपलब्ध हो,
            और तब भी जब कॉल करने वाले संगठन का बैलेंस कॉल को कवर नहीं कर सकता;
            गलत, निरस्त या समय-सीमा समाप्त कुंजी `401` लौटाती है। अनुपलब्ध कुंजी
            `{"detail": ...}` के साथ `403` लौटाती है; गलत, निरस्त या समय-सीमा
            समाप्त कुंजी `401` लौटाती है। क्रेडिट की कमी — और अनुबंध के आधार पर
            बिल किए जाने वाले संगठन जिनकी दर सूची में Document AI API की कोई
            प्रविष्टि नहीं है — किसी भी दस्तावेज़ प्रोसेसिंग से पहले `{"error":
            ...}` के साथ `403` लौटाते हैं।
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  summary: कोई `x-api-key` हेडर नहीं, या कुंजी अमान्य/निरस्त है
                  value:
                    detail: You do not have permission to perform this action.
                Not enough credits:
                  summary: संगठन का बैलेंस कॉल को कवर नहीं कर सकता
                  value:
                    error: >-
                      You don't have enough credits to perform this request.
                      Please top up at https://business.didit.me
                Contract rate missing:
                  summary: >-
                    अनुबंध के आधार पर बिल किया जाने वाला संगठन जिसकी दर सूची में
                    कोई Document AI API प्रविष्टि नहीं है
                  value:
                    error: >-
                      Document AI API is not included in your contract rate
                      card. Contact support@didit.me to enable it.
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error:
                    type: string
        '429':
          description: >-
            रेट लिमिट पार हो गई। POST/PATCH/DELETE endpoints प्रति मिनट प्रति
            API कुंजी 300 राइट अनुरोधों का बजट साझा करते हैं (लेन-देन निर्माण और
            इवेंट इनजेशन का 600 का एक अलग बजट है)। रिस्पॉन्स में
            `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` और
            `Retry-After` हेडर होते हैं।
          content:
            application/json:
              examples:
                Write rate limit exceeded:
                  summary: वर्तमान मिनट में 300 से अधिक राइट अनुरोध
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '503':
          $ref: '#/components/responses/DocumentProcessingBusy'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.document_ai.analyze(
                document=open("document.pdf", "rb"),
                fields="[{\"key\": \"employer_name\", \"name\": \"Employer name\", \"instruction\": \"The employer or company issuing the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": false}, {\"key\": \"employee_name\", \"name\": \"Employee name\", \"instruction\": \"The full name of the employee as printed on the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": true}, {\"key\": \"net_pay\", \"name\": \"Net pay\", \"instruction\": \"The net amount paid to the employee for the period.\", \"type\": \"number\", \"required\": true, \"is_full_name\": false}, {\"key\": \"pay_date\", \"name\": \"Pay date\", \"instruction\": \"The payment date shown on the payslip.\", \"type\": \"date\", \"required\": false, \"is_full_name\": false}]",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit, { fileFromPath } from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.documentAi.analyze({
              document: await fileFromPath("document.pdf"),
              fields: "[{\"key\": \"employer_name\", \"name\": \"Employer name\", \"instruction\": \"The employer or company issuing the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": false}, {\"key\": \"employee_name\", \"name\": \"Employee name\", \"instruction\": \"The full name of the employee as printed on the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": true}, {\"key\": \"net_pay\", \"name\": \"Net pay\", \"instruction\": \"The net amount paid to the employee for the period.\", \"type\": \"number\", \"required\": true, \"is_full_name\": false}, {\"key\": \"pay_date\", \"name\": \"Pay date\", \"instruction\": \"The payment date shown on the payslip.\", \"type\": \"date\", \"required\": false, \"is_full_name\": false}]",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.DocumentAi.Analyze(ctx, didit.DocumentAiAnalyzeParams{\n\tDocument: didit.FileFromPath(\"document.pdf\"),\n\tFields:   \"[{\\\"key\\\": \\\"employer_name\\\", \\\"name\\\": \\\"Employer name\\\", \\\"instruction\\\": \\\"The employer or company issuing the payslip.\\\", \\\"type\\\": \\\"text\\\", \\\"required\\\": true, \\\"is_full_name\\\": false}, {\\\"key\\\": \\\"employee_name\\\", \\\"name\\\": \\\"Employee name\\\", \\\"instruction\\\": \\\"The full name of the employee as printed on the payslip.\\\", \\\"type\\\": \\\"text\\\", \\\"required\\\": true, \\\"is_full_name\\\": true}, {\\\"key\\\": \\\"net_pay\\\", \\\"name\\\": \\\"Net pay\\\", \\\"instruction\\\": \\\"The net amount paid to the employee for the period.\\\", \\\"type\\\": \\\"number\\\", \\\"required\\\": true, \\\"is_full_name\\\": false}, {\\\"key\\\": \\\"pay_date\\\", \\\"name\\\": \\\"Pay date\\\", \\\"instruction\\\": \\\"The payment date shown on the payslip.\\\", \\\"type\\\": \\\"date\\\", \\\"required\\\": false, \\\"is_full_name\\\": false}]\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import me.didit.Didit;

            import me.didit.types.DocumentAiAnalyzeParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.documentAi().analyze(DocumentAiAnalyzeParams.builder()
                    .document(Path.of("document.pdf"))
                    .fields("[{\"key\": \"employer_name\", \"name\": \"Employer name\", \"instruction\": \"The employer or company issuing the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": false}, {\"key\": \"employee_name\", \"name\": \"Employee name\", \"instruction\": \"The full name of the employee as printed on the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": true}, {\"key\": \"net_pay\", \"name\": \"Net pay\", \"instruction\": \"The net amount paid to the employee for the period.\", \"type\": \"number\", \"required\": true, \"is_full_name\": false}, {\"key\": \"pay_date\", \"name\": \"Pay date\", \"instruction\": \"The payment date shown on the payslip.\", \"type\": \"date\", \"required\": false, \"is_full_name\": false}]")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;
            use Didit\File;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->documentAi->analyze([
                'document' => File::fromPath('document.pdf'),
                'fields' => '[{"key": "employer_name", "name": "Employer name", "instruction": "The employer or company issuing the payslip.", "type": "text", "required": true, "is_full_name": false}, {"key": "employee_name", "name": "Employee name", "instruction": "The full name of the employee as printed on the payslip.", "type": "text", "required": true, "is_full_name": true}, {"key": "net_pay", "name": "Net pay", "instruction": "The net amount paid to the employee for the period.", "type": "number", "required": true, "is_full_name": false}, {"key": "pay_date", "name": "Pay date", "instruction": "The payment date shown on the payslip.", "type": "date", "required": false, "is_full_name": false}]',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.document_ai.analyze(
              document: Pathname("document.pdf"),
              fields: "[{\"key\": \"employer_name\", \"name\": \"Employer name\", \"instruction\": \"The employer or company issuing the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": false}, {\"key\": \"employee_name\", \"name\": \"Employee name\", \"instruction\": \"The full name of the employee as printed on the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": true}, {\"key\": \"net_pay\", \"name\": \"Net pay\", \"instruction\": \"The net amount paid to the employee for the period.\", \"type\": \"number\", \"required\": true, \"is_full_name\": false}, {\"key\": \"pay_date\", \"name\": \"Pay date\", \"instruction\": \"The payment date shown on the payslip.\", \"type\": \"date\", \"required\": false, \"is_full_name\": false}]"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.DocumentAi.AnalyzeAsync(new
            DocumentAiAnalyzeParams

            {
                Document = FileUpload.FromPath("document.pdf"),
                Fields = "[{\"key\": \"employer_name\", \"name\": \"Employer name\", \"instruction\": \"The employer or company issuing the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": false}, {\"key\": \"employee_name\", \"name\": \"Employee name\", \"instruction\": \"The full name of the employee as printed on the payslip.\", \"type\": \"text\", \"required\": true, \"is_full_name\": true}, {\"key\": \"net_pay\", \"name\": \"Net pay\", \"instruction\": \"The net amount paid to the employee for the period.\", \"type\": \"number\", \"required\": true, \"is_full_name\": false}, {\"key\": \"pay_date\", \"name\": \"Pay date\", \"instruction\": \"The payment date shown on the payslip.\", \"type\": \"date\", \"required\": false, \"is_full_name\": false}]",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    DocumentAIDetectedCode:
      type: object
      required:
        - type
        - page_number
        - position
        - x
        - 'y'
        - width
        - height
        - page_width
        - page_height
        - raw_payload
        - parsed_payload
      properties:
        type:
          type: string
          description: >-
            पहचाना गया सिम्बोलॉजी, उदाहरण के लिए `QR_CODE`, `CODE_128`,
            `EAN_13`, `DATA_MATRIX`, या `PDF_417`।
        page_number:
          type: integer
          minimum: 1
          description: 1-आधारित पेज संख्या।
        position:
          type: array
          nullable: true
          description: >-
            रेंडर किए गए पेज के पिक्सेल निर्देशांक में पहचाना गया बहुभुज। कोई
            विश्वसनीय स्थान उपलब्ध न होने पर `null`।
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              type: integer
        x:
          type: integer
          nullable: true
          description: रेंडर किए गए पेज पिक्सेल में बाउंडिंग बॉक्स का बायाँ किनारा।
        'y':
          type: integer
          nullable: true
          description: रेंडर किए गए पेज के पिक्सेल में बाउंडिंग बॉक्स का ऊपरी किनारा।
        width:
          type: integer
          nullable: true
          description: रेंडर किए गए पेज के पिक्सल में बाउंडिंग-बॉक्स की चौड़ाई।
        height:
          type: integer
          nullable: true
          description: रेंडर किए गए पेज के पिक्सल में बाउंडिंग-बॉक्स की ऊंचाई।
        page_width:
          type: integer
          description: रेंडर किए गए पेज की चौड़ाई पिक्सेल में।
        page_height:
          type: integer
          description: रेंडर किए गए पेज की ऊंचाई पिक्सेल में।
        raw_payload:
          type: string
          description: >-
            उपलब्ध होने पर base64 स्ट्रिंग के रूप में रॉ डिकोडर payload; अन्यथा
            एक खाली स्ट्रिंग।
        parsed_payload:
          nullable: true
          description: >-
            डिकोड की गई स्ट्रिंग या संरचित मान। `null` जब कोड का पता चला था
            लेकिन उसे डिकोड नहीं किया जा सका।
  responses:
    DocumentProcessingBusy:
      description: >-
        वर्तमान में बहुत सारे दस्तावेज़ प्रोसेस किए जा रहे हैं, इसलिए यह अपलोड
        प्रोसेस नहीं हुआ: कुछ भी संग्रहीत नहीं किया गया और किसी भी प्रयास का
        उपयोग नहीं किया गया। `Retry-After` में दिए गए सेकंड की संख्या के बाद वही
        फ़ाइल दोबारा भेजें। `code` के आधार पर शाखा चुनें, संदेश टेक्स्ट के आधार
        पर नहीं।
      headers:
        Retry-After:
          description: समान अनुरोध दोबारा भेजने से पहले प्रतीक्षा करने की अवधि (सेकंड में)।
          schema:
            type: integer
            example: 10
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
              - code
            properties:
              detail:
                type: string
              code:
                type: string
                enum:
                  - document_processing_busy
          example:
            detail: We are busy processing documents. Please try again in a moment.
            code: document_processing_busy
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        आपकी एप्लिकेशन की API कुंजी, Business Console में Developers -> API keys
        से। प्राथमिक कुंजी के पास पूर्ण एक्सेस होता है। एक नामित कुंजी को स्कोप
        किया जा सकता है: प्रति संसाधन none, read या write, कुछ वर्कफ़्लो या
        स्वीकृत सत्रों तक सीमित, IP पतों की सूची तक सीमित, और समाप्ति तिथि तक
        सीमित। 401 का अर्थ है कि कुंजी गलत है, निरस्त कर दी गई है या उसकी
        समय-सीमा समाप्त हो गई है; 403 का अर्थ है कि कोई कुंजी नहीं भेजी गई थी,
        कुंजी के पास इस संसाधन या कार्रवाई का एक्सेस नहीं है, या अनुरोध उसकी IP
        सूची से बाहर के पते से आया था; सत्र रूट पर 404 का अर्थ है कि सत्र कुंजी
        के वर्कफ़्लो या स्थितियों से बाहर है। मीडिया एक्सेस के बिना एक कुंजी को
        छवि, वीडियो और PDF URL null के रूप में प्राप्त होते हैं, और सत्र write
        के बिना एक कुंजी को सत्र लिंक और token null के रूप में प्राप्त होते हैं।
        देखें https://docs.didit.me/console/api-keys।

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.