> ## 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.

# प्रश्नावली अपडेट API: KYC फ़ॉर्म संपादित करें

> Didit KYC प्रश्नावली संपादित करें: नाम बदलें, क्रमबद्ध प्रश्न बदलें, बहु-भाषा लेबल अपडेट करें। प्रोग्रामेटिक अनुपालन फ़ॉर्म प्रबंधन, प्रति कॉल भुगतान।



Update Questionnaire API Prompt
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Update a simple Didit questionnaire through the Management API.

Endpoint:
PATCH https://verification.didit.me/v3/questionnaires/{questionnaire_uuid}/

Authentication:
Use the x-api-key header with my Didit API key.

Requirements:
\- Use PATCH and include only the fields I want to change.
\- To rename the questionnaire, send title or description only.
\- To change questions, send the full desired form_elements array. This replaces the existing question list.
\- Do not send graph, branches, next, required_if, or conditional logic.
\- Keep languages consistent with the questionnaire. Include en labels for every form element.
\- Capture the questionnaire_id returned by the response because published updates may return a new version id.

Example metadata update body:
\{
"title": "Updated Customer Onboarding"
}

Example full question replacement body:
\{
"form_elements": [
\{
  "id": "occupation",
  "element_type": "short_text",
  "label": { "en": "What is your occupation?" },
  "is_required": true
},
\{
  "id": "source_of_funds",
  "element_type": "multiple_choice",
  "label": { "en": "Source of funds" },
  "options": [
    \{ "value": "employment", "label": { "en": "Employment" } },
    \{ "value": "business", "label": { "en": "Business" } }
  ]
}
]
}

Build the API call, handle validation errors, and return the latest questionnaire_id from the response.`

\</pre>



      
      

यहाँ पेस्ट करें

आंशिक अपडेट के लिए `PATCH` का उपयोग करें। प्रश्नावली का नाम बदलने के लिए केवल `title` या `description` भेजें।```json theme={null}
{
  "title": "Updated Customer Onboarding"
}
```प्रश्न अपडेट करने के लिए पूरा वांछित `form_elements` array भेजें। यह पिछली प्रश्न सूची की जगह ले लेता है। जो मौजूदा प्रश्न आप अब भी दिखाना चाहते हैं, उन्हें शामिल रखें।```json theme={null}
{
  "form_elements": [
    {
      "id": "occupation",
      "element_type": "short_text",
      "label": { "en": "What is your occupation?" },
      "is_required": true
    },
    {
      "id": "source_of_funds",
      "element_type": "multiple_choice",
      "label": { "en": "Source of funds" },
      "options": [
        { "value": "employment", "label": { "en": "Employment" } },
        { "value": "business", "label": { "en": "Business" } }
      ]
    }
  ]
}
```v3 API केवल सरल रैखिक प्रश्नावलियों का समर्थन करता है। यह `graph`, `branches`, `next` और शर्तीय नियमों को अस्वीकार करता है।रिस्पॉन्स में `questionnaire_id` शामिल होता है। जब आप `published` प्रश्नावली अपडेट करते हैं, तो API नया संस्करण बना सकता है। लौटाए गए `questionnaire_id` को सहेजें और वर्कफ़्लो में उसी का उपयोग करें, यह मानकर न चलें कि URL में दिया गया id अब भी सबसे नया संस्करण है।


## OpenAPI

````yaml hi/openapi-25.json PATCH /v3/questionnaires/{questionnaire_uuid}/
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/questionnaires/{questionnaire_uuid}/:
    patch:
      tags:
        - Questionnaires
      summary: प्रश्नावली अपडेट करें
      description: >-
        प्रश्नावली अपडेट करें। वर्ज़निंग आपके द्वारा भेजे गए `status` फ़ील्ड और
        वर्ज़न की वर्तमान स्थिति पर निर्भर करती है: (1) **published** वर्ज़न पर
        कोई `status` नहीं → प्रकाशित वर्ज़न उसी स्थान पर अपडेट किया जाता है
        (समान `questionnaire_id`, समान `version`); (2) **draft** पर कोई `status`
        नहीं → ड्राफ़्ट अपडेट किया जाता है और तुरंत प्रकाशित किया जाता है; (3)
        **published** वर्ज़न पर `status: "published"` → समान
        `questionnaire_group_id` के तहत एक नया प्रकाशित वर्ज़न बनाया जाता है
        (नया `questionnaire_id`, `version` + 1) और वापस किया जाता है, और समूह
        में मौजूद कोई भी मौजूदा ड्राफ़्ट हटा दिया जाता है; (4) `status: "draft"`
        ड्राफ़्ट को ड्राफ़्ट के रूप में रखता है (ऑटोसेव) लेकिन प्रकाशित वर्ज़न
        पर 400 के साथ अस्वीकार कर दिया जाता है (`"Cannot revert a published
        version to draft."`)|
      operationId: update_questionnaire
      parameters:
        - name: questionnaire_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: अपडेट करने के लिए प्रश्नावली का प्रति-संस्करण UUID।
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimpleQuestionnaireUpdateRequest'
            examples:
              Rename:
                summary: प्रश्नावली का नाम बदलें
                value:
                  title: Updated Customer Onboarding
              Replace questions:
                summary: पूरी लीनियर प्रश्न सूची को बदलें
                value:
                  form_elements:
                    - id: occupation
                      element_type: short_text
                      label:
                        en: What is your occupation?
                      is_required: true
                    - id: source_of_funds
                      element_type: multiple_choice
                      label:
                        en: Source of funds
                      options:
                        - value: employment
                          label:
                            en: Employment
                        - value: business
                          label:
                            en: Business
      responses:
        '200':
          description: >-
            प्रश्नावली अपडेट की गई। body परिणामी संस्करण की नवीनतम स्थिति है —
            इन-प्लेस अपडेट किया गया संस्करण, या नया बनाया गया प्रकाशित संस्करण
            जब आपने प्रकाशित पंक्ति पर `status: "published"` भेजा था (उस स्थिति
            में `questionnaire_id` और `version` आपके द्वारा पैच किए गए संस्करणों
            से भिन्न होते हैं)। रिस्पॉन्स में `questionnaire_id` प्रति-संस्करण
            UUID है; यदि आपको स्थिर समूह पहचानकर्ता की आवश्यकता है तो
            `questionnaire_group_id` का उपयोग करें।
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionnaireDetail'
        '400':
          description: >-
            सत्यापन त्रुटि — अज्ञात `element_type`, अनुपलब्ध अनुवाद, असमर्थित
            ब्रांचिंग/सशर्त फ़ील्ड, `languages` में `en` का न होना,
            `default_language` का `languages` में न होना, बिना लेबल वाला विकल्प,
            रॉ `graph` भेजना, या किसी प्रकाशित वर्शन पर `status: "draft"` होना
            (`"Cannot revert a published version to draft."` )। रिस्पॉन्स बॉडी
            फ़ील्ड नाम के अनुसार व्यवस्थित DRF सत्यापन त्रुटि है।
        '403':
          description: API कुंजी अनुपलब्ध या अमान्य है।
          content:
            application/json:
              examples:
                Invalid token:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            प्रमाणित एप्लिकेशन के लिए इस `questionnaire_uuid` वाली कोई
            प्रश्नावली मौजूद नहीं है।
        '415':
          description: 'असमर्थित मीडिया प्रकार। `Content-Type: application/json` सेट करें।'
        '429':
          description: रेट लिमिट पार हो गई। घातीय बैकऑफ़ के साथ पुनः प्रयास करें।
        '500':
          description: अप्रत्याशित सर्वर त्रुटि। पुनः प्रयास करना सुरक्षित है।
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PATCH
            'https://verification.didit.me/v3/questionnaires/11111111-2222-3333-4444-555555555555/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"title": "Updated Customer Onboarding"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.questionnaires.update(
                "11111111-2222-3333-4444-555555555555",
                title="Updated Customer Onboarding",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.questionnaires.update("11111111-2222-3333-4444-555555555555",
            {
              title: "Updated Customer Onboarding",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Questionnaires.Update(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SimpleQuestionnaireUpdateRequest{\n\tTitle: didit.String(\"Updated Customer Onboarding\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.SimpleQuestionnaireUpdateRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.questionnaires().update("11111111-2222-3333-4444-555555555555",
            SimpleQuestionnaireUpdateRequest.builder()
                    .title("Updated Customer Onboarding")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->questionnaires->update('11111111-2222-3333-4444-555555555555',
            [
                'title' => 'Updated Customer Onboarding',
            ]);

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.questionnaires.update(
              "11111111-2222-3333-4444-555555555555",
              title: "Updated Customer Onboarding"
            )
            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.Questionnaires.UpdateAsync("11111111-2222-3333-4444-555555555555",
            new SimpleQuestionnaireUpdateRequest

            {
                Title = "Updated Customer Onboarding",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SimpleQuestionnaireUpdateRequest:
      type: object
      description: >-
        प्रश्नावली मेटाडेटा अपडेट करें या पूरी लीनियर `form_elements` सूची को
        बदलें।
      properties:
        title:
          type: string
        description:
          type: string
          nullable: true
        languages:
          type: array
          items:
            type: string
        default_language:
          type: string
        is_active:
          type: boolean
        status:
          type: string
          enum:
            - draft
            - published
        form_elements:
          type: array
          minItems: 1
          description: >-
            यदि प्रदान किया जाता है, तो यह पूरी लीनियर प्रश्न सूची को बदल देता
            है।
          items:
            $ref: '#/components/schemas/SimpleQuestionnaireElement'
    QuestionnaireDetail:
      type: object
      description: >-
        GET, POST (बनाएँ) और PATCH (अपडेट करें) endpoint से लौटाया गया पूर्ण
        प्रश्नावली विवरण।
      properties:
        questionnaire_id:
          type: string
          format: uuid
          description: >-
            प्रश्नावली का विशिष्ट पहचानकर्ता। वर्कफ़्लो से या बाद के अपडेट/डिलीट
            अनुरोधों में प्रश्नावली का संदर्भ देते समय इस id का उपयोग करें।
        title:
          type: string
        description:
          type: string
          nullable: true
        languages:
          type: array
          items:
            type: string
        default_language:
          type: string
        is_active:
          type: boolean
        is_simple_questionnaire:
          type: boolean
        graph:
          type: object
          description: start_node और nodes मैप के साथ ग्राफ़ संरचना।
        sections:
          type: array
          description: अनुभागों में समूहीकृत प्रश्नावली सामग्री (ग्राफ़ से प्राप्त)।
          items:
            type: object
        questionnaire_group_id:
          type: string
          format: uuid
          description: >-
            स्थिर पहचानकर्ता जो एक ही प्रश्नावली के सभी संस्करणों को समूहित करता
            है।
        version:
          type: integer
        status:
          type: string
          enum:
            - draft
            - published
        published_at:
          type: string
          format: date-time
          nullable: true
        is_editable:
          type: boolean
          description: >-
            True जब प्रश्नावली को अभी भी उसी स्थान पर संपादित किया जा सकता है
            (ड्राफ़्ट संस्करण)।
    SimpleQuestionnaireElement:
      type: object
      required:
        - element_type
        - label
      properties:
        id:
          type: string
          description: >-
            वैकल्पिक स्थिर प्रश्न id। यदि छोड़ दिया जाता है, तो API `q1`, `q2`,
            आदि जनरेट करता है। पठनीयता के लिए लोअरकेस अक्षरों, संख्याओं और
            अंडरस्कोर का उपयोग करें।
          example: source_of_funds
        element_type:
          type: string
          description: >-
            प्रश्न प्रकार। API इन लोअरकेस मानों और उनके अपरकेस समकक्षों को
            स्वीकार करता है।
          enum:
            - short_text
            - long_text
            - dropdown
            - single_choice
            - multiple_choice
            - number
            - image
            - file_upload
            - time
            - email
            - address
            - phone
            - country
            - date_picker
            - consent
            - section_header
            - separator
            - heading
            - paragraph
        label:
          type: object
          description: >-
            भाषा कोड के अनुसार प्रश्न लेबल, उदाहरण के लिए `{ "en": "Source of
            funds" }`।
          additionalProperties:
            type: string
        description:
          type: object
          nullable: true
          additionalProperties:
            type: string
        placeholder:
          type: object
          nullable: true
          additionalProperties:
            type: string
        is_required:
          type: boolean
          default: false
        options:
          type: array
          description: >-
            `dropdown`, `single_choice`, और `multiple_choice` के लिए उपयोग करें।
            यदि `value` छोड़ दिया जाता है, तो API विकल्प लेबल से एक जनरेट करता
            है।
          items:
            type: object
            required:
              - label
            properties:
              value:
                type: string
              label:
                type: object
                additionalProperties:
                  type: string
        max_files:
          type: integer
          minimum: 1
          maximum: 5
          description: '`file_upload` या `image` के साथ उपयोग करें।'
        validation:
          type: object
          nullable: true
          description: >-
            `short_text`, `long_text`, या `number` के लिए वैकल्पिक प्रारूप
            सत्यापन। जब उपयोगकर्ता फ़ील्ड भरता है तब लागू किया जाता है (वे तब तक
            आगे नहीं बढ़ सकते जब तक यह मान्य न हो जाए) और सबमिशन पर API द्वारा
            पुनः जाँचा जाता है।
          properties:
            pattern:
              type: string
              description: >-
                रेगुलर एक्सप्रेशन (ECMA-262 सबसेट) जिससे मान पूरी तरह मेल खाना
                चाहिए। `short_text` और `long_text` के लिए। ^/$ एंकर न जोड़ें;
                पूरे मान का मिलान किया जाता है।
            min_length:
              type: integer
              minimum: 0
              description: वर्णों की न्यूनतम संख्या। `short_text` और `long_text` के लिए।
            max_length:
              type: integer
              minimum: 0
              description: वर्णों की अधिकतम संख्या। `short_text` और `long_text` के लिए।
            min:
              type: number
              description: न्यूनतम संख्यात्मक मान। `number` के लिए।
            max:
              type: number
              description: अधिकतम संख्यात्मक मान। `number` के लिए।
            error_message:
              type: object
              description: >-
                सत्यापन विफल होने पर दिखाया जाने वाला अनुवादित संदेश, भाषा कोड
                द्वारा कुंजीबद्ध।
              additionalProperties:
                type: string
  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.