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

> Didit API से पूरे हो चुके KYC सत्र के पहचान सत्यापन या पते के प्रमाण परिणाम में अतिरिक्त छवि या PDF जोड़ें, जैसे दस्तावेज़ का पिछला हिस्सा।

सत्र API प्रॉम्प्ट में इमेज जोड़ें
प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें

<pre>
  \`Attach an extra image or PDF to a finished Didit User Verification (KYC) session through the API.

  Endpoint:
  PATCH [https://verification.didit.me/v3/session/\{session\_id}/add-images/](https://verification.didit.me/v3/session/\{session_id}/add-images/)

  Authentication:
  Send my Didit API key in the x-api-key header. A scoped key needs sessions: write.

  Goal:

  * Add evidence collected outside the verification flow (for example the back of an ID document, or a supporting letter) to the session's ID verification or Proof of Address result, so reviewers see it with the rest of the session.

  Request (multipart/form-data):

  * file (required): JPG, JPEG, PNG, WEBP, TIFF or PDF, at most 15 MB as uploaded. Didit compresses it and rejects it if it is still over 2 MB (2,097,152 bytes) after compression.
  * model\_type (required): "kyc" for the ID verification, "poa" for the Proof of Address.
  * file\_password (optional): the password of an encrypted PDF.

  Behavior:

  * The session must be Approved, Declined, In Review or Kyc Expired, and must have the result named by model\_type. Business (KYB) sessions are not supported.
  * When the step ran more than once, the file goes to the most recent result.
  * Each call adds one file and keeps the existing ones.
  * The file then appears in extra\_files of id\_verifications\[] or poa\_verifications\[] in GET /v3/session/{session_id}/decision/.
  * A FILE\_ADDED entry is added to the session's activity log. No webhook is sent and the session status does not change.
  * Rate limit: 10 requests per minute per API key.

  Example call:
  curl -X PATCH "[https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/add-images/](https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/add-images/)" \
  -H "x-api-key: YOUR\_API\_KEY" \
  -F "file=@back-of-id.jpg" \
  -F "model\_type=kyc"

  What to read from the response:

  * extra\_files: short-lived presigned links to every extra file of that result, including the new one. A scoped key without media: read receives them as null.

  Failure modes:

  * 400: file or model\_type missing, unsupported format, file too large before or after compression, encrypted PDF without the right file\_password.
  * 401: the API key has expired.
  * 403: missing key (a wrong, revoked or expired key gets 401), a key of another application, a scoped key without sessions: write, or a request from outside the key's IP allowlist.
  * 404: the session does not exist, was deleted, is outside a scoped key's limits, is not in a reviewable status, or has no result of that model\_type.
  * 429: more than 10 calls in a minute. Wait for Retry-After seconds.

  Side effects: stores the file with the session and adds an activity entry.

  For the full integration shape, see /integration/integration-prompt.\`
</pre>

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

`extra_files` में दिए गए पूर्व-हस्ताक्षरित लिंक समय-सीमा समाप्त होने पर अमान्य हो जाते हैं। बाद में फ़ाइलों की ज़रूरत हो तो [सत्र निर्णय](https://docs.didit.me/hi/sessions-api/retrieve-session.md) से नए लिंक पढ़ें। दस्तावेज़ से निकाले गए डेटा को सुधारने के लिए इसके बजाय [सत्र डेटा अपडेट करें](https://docs.didit.me/hi/sessions-api/update-data.md) का उपयोग करें।


## OpenAPI

````yaml hi/openapi-25.json PATCH /v3/session/{sessionId}/add-images/
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/session/{sessionId}/add-images/:
    patch:
      tags:
        - Sessions
      summary: सत्र में एक छवि जोड़ें
      description: >-
        पूर्ण हो चुके उपयोगकर्ता सत्यापन (KYC) सत्र के पहचान सत्यापन
        (`model_type=kyc`) या पते का प्रमाण (`model_type=poa`) परिणाम में एक
        अतिरिक्त छवि या PDF संलग्न करें, उदाहरण के लिए प्रवाह के बाहर एकत्र किए
        गए साक्ष्य। सत्र `Approved`, `Declined`, `In Review` या `Kyc Expired`
        होना चाहिए और इसमें `model_type` द्वारा नामित परिणाम शामिल होना चाहिए;
        व्यवसाय सत्यापन (KYB) सत्र समर्थित नहीं हैं। प्रत्येक कॉल एक फ़ाइल
        जोड़ती है (चरण एक से अधिक बार चलने पर नवीनतम परिणाम में), मौजूदा फ़ाइलों
        को बनाए रखती है और सत्र गतिविधि लॉग में एक `FILE_ADDED` प्रविष्टि दर्ज
        करती है; अपलोड कोई webhook नहीं भेजता है और सत्र की स्थिति नहीं बदलता
        है। अपलोड होने पर फ़ाइल को कंप्रेस किया जाता है और इसे सत्र निर्णय के
        `extra_files` में लौटाया जाता है। यह endpoint प्रति API कुंजी प्रति मिनट
        10 अनुरोधों तक सीमित है। स्कोप्ड API कुंजी के लिए `sessions: write`
        आवश्यक है, और `media: read` के बिना यह `extra_files` लिंक को `null` के
        रूप में प्राप्त करती है।
      operationId: patch_v3_session_add_images
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            उपयोगकर्ता सत्यापन (KYC) सत्र का UUID जिसमें फ़ाइल जोड़ी जानी है
            (`POST /v3/session/` द्वारा लौटाया गया `session_id`)। व्यवसाय
            सत्यापन (KYB) सत्र ID `404` लौटाती है।
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - model_type
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    छवि या PDF। अनुमत एक्सटेंशन: `jpg`, `jpeg`, `png`, `webp`,
                    `tiff`, `pdf`। अपलोड किए जाने पर अधिकतम 15 MB; इसके बाद
                    फ़ाइल को कंप्रेस किया जाता है और यदि यह अभी भी 2 MB
                    (2,097,152 बाइट्स) से बड़ी है तो इसे `400` के साथ अस्वीकार
                    कर दिया जाता है। खाली फ़ाइलों को अस्वीकार कर दिया जाता है।
                model_type:
                  type: string
                  enum:
                    - kyc
                    - poa
                  description: >-
                    `kyc` फ़ाइल को पहचान सत्यापन परिणाम में जोड़ता है, `poa` पते
                    का प्रमाण परिणाम में।
                  example: kyc
                file_password:
                  type: string
                  description: >-
                    एन्क्रिप्टेड PDF का पासवर्ड। इसके बिना, या गलत पासवर्ड के
                    साथ, एक एन्क्रिप्टेड PDF `400` लौटाता है।
            example:
              file: (binary)
              model_type: kyc
      responses:
        '200':
          description: >-
            फ़ाइल जोड़ी गई। नए परिणाम सहित उस परिणाम की प्रत्येक अतिरिक्त फ़ाइल
            लौटाता है।
          content:
            application/json:
              schema:
                type: object
                required:
                  - extra_files
                properties:
                  extra_files:
                    type: array
                    description: >-
                      `model_type` द्वारा नामित परिणाम की सभी अतिरिक्त फ़ाइलों
                      के अल्पकालिक प्रीसाइन्ड लिंक, सबसे पुराना पहले। बिना
                      `media: read` वाली स्कोप्ड API कुंजी के लिए प्रत्येक लिंक
                      `null` है। बाद में सत्र निर्णय से नए लिंक पढ़ें।
                    items:
                      type: string
                      format: uri
                      nullable: true
              example:
                extra_files:
                  - >-
                    https://media.example.com/session/11111111-2222-3333-4444-555555555555/kyc-extra-files/66666666-7777-8888-9999-000000000000.jpg?expires=1789383731&signature=abc123
        '400':
          description: >-
            सत्यापन त्रुटि। फ़ील्ड त्रुटियां `{"<field>": ["<message>"]}` के रूप
            में आती हैं; एन्क्रिप्टेड-PDF त्रुटियां `{"detail": "..."}` के रूप
            में आती हैं।
          content:
            application/json:
              examples:
                Missing file:
                  summary: फ़ॉर्म में कोई फ़ाइल भाग नहीं है
                  value:
                    file:
                      - No file was submitted.
                Missing model_type:
                  summary: model_type छोड़ दिया गया
                  value:
                    model_type:
                      - This field is required.
                Invalid model_type:
                  summary: model_type kyc या poa नहीं है
                  value:
                    model_type:
                      - '"passport" is not a valid choice.'
                File too large:
                  summary: 15 MB से अधिक का अपलोड
                  value:
                    file:
                      - File size should not exceed 15 MB
                Too large after compression:
                  summary: कंप्रेशन के बाद भी 2 MB से अधिक
                  value:
                    file:
                      - File size is too big. Max allowed size is 2097152 bytes.
                Encrypted PDF:
                  summary: बिना file_password के एन्क्रिप्टेड PDF
                  value:
                    detail: >-
                      The PDF is encrypted. Please upload a decrypted PDF or a
                      photo instead.
                Wrong PDF password:
                  summary: file_password PDF नहीं खोलता है
                  value:
                    detail: >-
                      The PDF password is incorrect. Please provide the correct
                      password.
        '401':
          description: >-
            स्कोप्ड API कुंजी की समय-सीमा समाप्त हो गई है। यह एकमात्र मामला है
            जो `401` लौटाता है: अनुपलब्ध, अमान्य या निरस्त कुंजी `403` लौटाती
            है।
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: मानव-पठनीय त्रुटि संदेश।
              examples:
                Expired key:
                  summary: कुंजी की समाप्ति तिथि बीत चुकी है
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            प्रमाणीकरण या प्राधिकरण विफलता। अनुपस्थित कुंजी `403` लौटाती है, और
            किसी अन्य एप्लिकेशन की कुंजी, इस endpoint के लिए आवश्यक अनुमति के
            बिना वाली स्कोप्ड कुंजी, तथा कुंजी की IP अनुमति सूची (allowlist) के
            बाहर से किया गया अनुरोध भी यही लौटाता है; गलत, निरस्त या समय-सीमा
            समाप्त कुंजी `401` लौटाती है। उन्हें `detail` द्वारा पहचानें।
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: मानव-पठनीय त्रुटि संदेश।
              examples:
                Missing or invalid credentials:
                  summary: कोई x-api-key हेडर नहीं है, या कुंजी सत्यापन में विफल रही
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: एक मान्य कुंजी जो सत्र से भिन्न एप्लिकेशन से संबंधित है
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without sessions write:
                  summary: 'स्कोप्ड कुंजी में sessions: write की कमी है'
                  value:
                    detail: This API key has no write access to sessions.
                IP not allowed:
                  summary: कुंजी की IP अनुमति सूची से बाहर का अनुरोध
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            सत्र मौजूद नहीं है, हटा दिया गया था या स्कोप्ड कुंजी की सीमाओं से
            बाहर है; यह एक KYB सत्र है या `Approved`, `Declined`, `In Review` या
            `Kyc Expired` में नहीं है; या इसमें अनुरोधित `model_type` का कोई
            परिणाम नहीं है (फ़ाइल के मान्य होने से पहले जाँचा जाता है)। सत्र
            लुकअप क्रेडेंशियल जांच से पहले चलता है, इसलिए एक अज्ञात `sessionId`
            वैध कुंजी के बिना भी `404` लौटाता है।
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: मानव-पठनीय त्रुटि संदेश।
              examples:
                Unknown session:
                  summary: इस ID वाला कोई सत्र मौजूद नहीं है, या इसे हटा दिया गया था
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: >-
                    सत्र स्कोप्ड कुंजी के वर्कफ़्लो या केवल-स्वीकृत सीमाओं से
                    बाहर है
                  value:
                    detail: Session not found.
                Not eligible:
                  summary: सत्र अभी समाप्त नहीं हुआ है, या एक KYB सत्र ID है
                  value:
                    detail: No Session matches the given query.
                No ID verification:
                  summary: पहचान सत्यापन के बिना किसी सत्र पर model_type=kyc
                  value:
                    detail: The session does not have KYC data.
                No Proof of Address:
                  summary: पते के प्रमाण के बिना किसी सत्र पर model_type=poa
                  value:
                    detail: The session does not have POA data.
        '429':
          description: >-
            रेट लिमिट पार हो गई: प्रति मिनट प्रति API कुंजी 10 ऐड-इमेज अनुरोध
            (अस्वीकृत अनुरोध भी गिने जाते हैं)। प्रति मिनट 300 राइट अनुरोधों का
            साझा बजट भी लागू होता है। पुनः प्रयास करने से पहले `Retry-After`
            सेकंड प्रतीक्षा करें; `X-RateLimit-*` हेडर बजट दिखाते हैं।
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: मानव-पठनीय त्रुटि संदेश।
              examples:
                Rate limited:
                  summary: वर्तमान मिनट का बजट समाप्त हो गया
                  value:
                    detail: >-
                      Session add-images rate limit exceeded. You can make up to
                      10 requests per minute.
          headers:
            Retry-After:
              description: पुनः प्रयास करने से पहले प्रतीक्षा करने के सेकंड।
              schema:
                type: integer
                minimum: 1
                example: 30
        '503':
          $ref: '#/components/responses/DocumentProcessingBusy'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X PATCH
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/add-images/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -F 'file=@./back-of-id.jpg' \
              -F 'model_type=kyc'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.add_images(
                "11111111-2222-3333-4444-555555555555",
                file=open("image.jpg", "rb"),
                model_type="kyc",
            )
            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.sessions.addImages("11111111-2222-3333-4444-555555555555", {
              file: await fileFromPath("image.jpg"),
              model_type: "kyc",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.AddImages(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SessionsAddImagesParams{\n\tFile:      didit.FileFromPath(\"image.jpg\"),\n\tModelType: \"kyc\",\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.SessionsAddImagesParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().addImages("11111111-2222-3333-4444-555555555555",
            SessionsAddImagesParams.builder()
                    .file(Path.of("image.jpg"))
                    .modelType(SessionsAddImagesParams.ModelType.of("kyc"))
                    .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->sessions->addImages('11111111-2222-3333-4444-555555555555',
            [
                'file' => File::fromPath('image.jpg'),
                'model_type' => 'kyc',
            ]);

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

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

            result = didit.sessions.add_images(
              "11111111-2222-3333-4444-555555555555",
              file: Pathname("image.jpg"),
              model_type: "kyc"
            )
            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.Sessions.AddImagesAsync("11111111-2222-3333-4444-555555555555",
            new SessionsAddImagesParams

            {
                File = FileUpload.FromPath("image.jpg"),
                ModelType = "kyc",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  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.