> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Document

> Pass the session id and the document type to fetch the document.

<Card title="Run in Postman" icon="https://mintcdn.com/sandboxfinancialtechnologiesprivatelimited/gviqebbpT5NUt_6i/static/svg/Postman.svg?fit=max&auto=format&n=gviqebbpT5NUt_6i&q=85&s=da47f2b7e10d87befec951aed9468de3" horizontal href="https://www.postman.com/in-co-sandbox/sandbox-api/request/ysw106q/fetch-document" arrow="true" width="2030" height="2031" data-path="static/svg/Postman.svg" />

<Info>
  A document can only be fetched if the user has provided consent for it.
</Info>

<Card title="Sample Responses" icon="file-code" href="/api-reference/kyc/entitylocker/sample-responses">
  See sample XML response returned by EntityLocker for GSTN Details and Udyam Certificate.
</Card>


## OpenAPI

````yaml api-reference/kyc/openapi.json GET /kyc/entitylocker/sessions/{session_id}/documents/{doc_type}
openapi: 3.1.0
info:
  title: in-co-sandbox-kyc
  description: ''
  version: 1.0.0
servers:
  - url: https://test-api.sandbox.co.in
    description: test
  - url: https://api.sandbox.co.in
    description: prod
security: []
tags:
  - name: kyc
  - name: digilocker-sdk
  - name: digilocker
  - name: aadhaar
  - name: bank
  - name: pan
  - name: mca
  - name: entitylocker
  - name: entitylocker-sdk
paths:
  /kyc/entitylocker/sessions/{session_id}/documents/{doc_type}:
    get:
      tags:
        - kyc
        - entitylocker
      summary: Fetch Document
      operationId: getDocument
      parameters:
        - name: session_id
          in: path
          description: >-
            Session identifier generated during EntityLocker [Initiate Session
            API](https://developer.sandbox.co.in/api-reference/kyc/entitylocker/endpoints/initiate_session)
            .
          required: true
          example: eed074e1-3bf0-4733-bc5a-4718fced542e
          schema:
            type: string
        - name: doc_type
          in: path
          description: >-
            Document type identifying which EntityLocker document to retrieve.
            Must match one of the consented doc_types values.
          required: true
          example: company_master_details
          schema:
            type: string
            enum:
              - company_master_details
              - gstn_details
              - udhyam_certificate
        - name: Authorization
          in: header
          description: >-
            JWT access token. For token-generation steps, refer to the
            [Quickstart
            Guide](https://developer.sandbox.co.in/guides/get-started/quickstart).
          required: true
          example: '{{access_token}}'
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key used to identify and authenticate the client.
          required: true
          example: '{{api_key}}'
          schema:
            type: string
        - name: x-api-version
          in: header
          description: Specifies the API version for the request.
          required: false
          example: 1.0.0
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code
                  timestamp:
                    type: integer
                    description: >-
                      Unix timestamp (in milliseconds) indicating when the
                      server generated the response
                  data:
                    type: object
                    properties:
                      files:
                        type: array
                        description: >-
                          An array containing details of the requested files.
                          Each item in the array represents a single file.
                        items:
                          type: object
                          properties:
                            '@entity':
                              type: string
                            url:
                              type: string
                              description: >-
                                The URL from which the file can be downloaded.
                                This is a direct link to the file's location.
                            size:
                              type: integer
                              description: >-
                                The size of the file in bytes. This value
                                indicates the total data volume of the file.
                            metadata:
                              type: object
                              description: >-
                                An object containing additional descriptive
                                information about the file. This includes
                                details like content type, issuer, and
                                modification date.
                              properties:
                                ContentType:
                                  type: string
                                  description: >-
                                    The MIME type of the file. This specifies
                                    the format of the file, e.g.,
                                    "application/pdf".
                                issuer_id:
                                  type: string
                                  description: >-
                                    A unique identifier for the entity that
                                    issued or created the file. This ID helps in
                                    tracing the origin of the document.
                                issuer:
                                  type: string
                                  description: >-
                                    The name of the entity that issued or
                                    created the file. This provides a
                                    human-readable name for the file's source.
                                LastModified:
                                  type: string
                                  description: >-
                                    The date and time when the file was last
                                    modified. This timestamp is typically in ISO
                                    8601 format.
                                description:
                                  type: string
                                  description: >-
                                    A textual description of the file's content
                                    or purpose. This provides additional context
                                    about the file.
                              required:
                                - ContentType
                                - issuer_id
                                - issuer
                                - LastModified
                                - description
                    required:
                      - files
                  transaction_id:
                    type: string
                    description: Unique identifier for tracking the request across systems
                required:
                  - code
                  - timestamp
                  - data
                  - transaction_id
              examples:
                200 - Fetched Document:
                  summary: 200 - Fetched Document
                  value:
                    code: 200
                    timestamp: 1765781088023
                    data:
                      files:
                        - '@entity': org.quicko.drive.file
                          url: >-
                            https://in-co-sandbox-kyc-entitylocker-storage-dev.s3.ap-south-1.amazonaws.com/non-persistent/workspaces/d8203472-11b0-4dda-ae9b-ce4c2494f1dd/sessions/eed074e1-3bf0-4733-bc5a-4718fced542e/documents/in.gov.mca-CPMTD-U72900GJ2023PTC138457.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAWLM5S7CBMS6H2ZMW%2F20251215%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20251215T064454Z&X-Amz-Expires=3600&X-Amz-Signature=22eb8dfb06b4579cde97b6ab9f2a00776c59c414870fad65a037033ebf1aa427&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject
                          size: 108598
                          metadata:
                            ContentType: application/pdf
                            issuer_id: in.gov.mca
                            issuer: >-
                              Ministry of Corporate Affairs (MCA), Govt. of
                              India
                            LastModified: 19/12/2024
                            description: Company Master Details
                    transaction_id: aa10bddf-1fc6-45a9-b0af-dc13613de60c
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  message:
                    type: string
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - message
                  - transaction_id
              examples:
                400 - Consent not provided:
                  summary: 400 - Consent not provided
                  value:
                    code: 400
                    timestamp: 1765888053322
                    message: Consent for udhyam_certificate not provided
                    transaction_id: 3f0590ab-b977-43ae-8b9d-667d984cceb2
          headers: {}
        '503':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              examples:
                503 - Source unavailable:
                  summary: 503 - Source unavailable
                  value:
                    code: 503
                    timestamp: 1000000000000
                    transaction_id: 6c05f692-c32f-4de0-92b4-56684bdf16f0
                    message: Source Unavailable
          headers: {}
        '521':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  message:
                    type: string
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - message
                  - transaction_id
              examples:
                521 - Data Not Found:
                  summary: 521 - Data Not Found
                  value:
                    code: 521
                    timestamp: 1782806266274
                    message: 'Data not found for: 55470e27-3d8a-451f-ac1e-9c0f3d1454821'
                    transaction_id: a599615c-c732-4538-9840-4bb5cd3c19d2
          headers: {}
        '523':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  message:
                    type: string
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - message
                  - transaction_id
              examples:
                523 - Invalid Session Status:
                  summary: 523 - Invalid Session Status
                  value:
                    code: 523
                    timestamp: 1782806184804
                    message: 'Invalid session status: created'
                    transaction_id: de90173f-8255-4ac0-b26b-a41b8a872fee
          headers: {}
      deprecated: false
      security: []

````