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

# E-Sign Generate API

> Generate an Aadhaar e-sign request and send signing link to the signer via email and SMS.

### Invitees

List of invitees who will receive the e-sign request.

* A minimum of **1** and a maximum of **2 invitees** are allowed.
* The **order of invitees in the list determines the signing sequence**.
* The **first invitee** will receive the signing request and must complete signing first.
* After the first invitee signs the document, the **second invitee (if provided)** will automatically receive a notification to proceed with signing.

This ensures a **sequential signing workflow** where each signer is notified only after the previous signer completes their action.

### Callback URL

To receive status of e-signing as each signer takes action on the links shared to them.
Make sure this is a HTTPS Webhook URL accepting POST request with request body and
allows any hosts with CSRF excemption to recieve the event properly.

Structure of the payload on the event webhook will be same as the response for he retrieve API.
Please refer to the E-sign retrieve api for more information on the event payload structure.


## OpenAPI

````yaml POST /esign/generate/
openapi: 3.0.0
info:
  title: KonnectNXT API Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://bgv.konnectnxt.com/api
    description: Production
  - url: https://testbgv.konnectnxt.com/api
    description: QA
security:
  - bearerAuth: []
paths:
  /esign/generate/:
    post:
      tags:
        - E-Sign
      summary: Generate E-Sign request
      description: >-
        Creates an Aadhaar e-sign request for the provided document and sends
        signing links to up to two invitees via email and SMS.
      operationId: generateEsignRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EsignGenerateRequest'
            examples:
              Example:
                summary: Basic E-Sign generate request with multiple invitees
                value:
                  file_name: offer_letter.pdf
                  file_base64: JVBERi0xLjcKCjQgMCBvYmoKPDwKL0JpdHNQZXJDb21wb25lbnQgOAov...
                  status_callback_url: https://yourcompany.com/callback
                  invitees:
                    - esigner_name: John Doe
                      esigner_email: john@example.com
                      esigner_phone: '9874563210'
                    - esigner_name: Alice
                      esigner_email: alice@example.com
                      esigner_phone: '8974521532'
      responses:
        '201':
          description: E-Sign link generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EsignGenerateSuccessResponse'
              examples:
                Success:
                  summary: Successful E-Sign generation
                  value:
                    code: 201
                    status: success
                    message: >-
                      E-Sign link generated successfully and sent to signer's
                      email and phone.
                    data:
                      request_id: 53ecfa78-2bb0-48a0-a4f3-d1caa1e79b35
                      esign_doc_id: 01KH6407707YBFWJ642WRWC5D3
                      esign_url: >-
                        https://app1.leegality.com/sign/241d83bd-56df-49c6-8635-97c2c7bfde78
                      expires_at: '2026-02-21T18:29:59Z'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    EsignGenerateRequest:
      type: object
      required:
        - file_name
        - file_base64
        - invitees
      properties:
        file_name:
          type: string
          description: Name of the PDF file to be signed
        file_base64:
          type: string
          description: Base64 encoded PDF file content
        status_callback_url:
          type: string
          description: >-
            HTTPS URL accepting POST requests on it. Here you'll recieve the
            status of the document signing as the signers take action and
            completes the siging process. The event will send the data in the
            same format as the retrieve APIs response. Please refere to E-sign
            Retrieve API for more info.
        invitees:
          type: array
          description: >-
            List of invitees who will receive the e-sign request (maximum 2
            allowed). First invitee will sign the doc and then the second will
            get the notification to proceed further signing.
          minItems: 1
          maxItems: 2
          items:
            type: object
            required:
              - esigner_name
              - esigner_email
              - esigner_phone
            properties:
              esigner_name:
                type: string
                example: John Doe
              esigner_email:
                type: string
                format: email
                example: signer@email.com
              esigner_phone:
                type: string
                description: 10 digit Indian phone number
                example: '9874563210'
    EsignGenerateSuccessResponse:
      type: object
      required:
        - code
        - status
        - message
        - data
      properties:
        code:
          type: integer
          example: 201
        status:
          type: string
          example: success
        message:
          type: string
          example: >-
            E-Sign link generated successfully and sent to signer's email and
            phone.
        data:
          type: object
          required:
            - request_id
            - esign_doc_id
            - esign_url
            - expires_at
          properties:
            request_id:
              type: string
              description: Unique identifier for tracking this e-sign request
              example: 53ecfa78-2bb0-48a0-a4f3-d1caa1e79b35
            esign_doc_id:
              type: string
              description: Document ID assigned by the e-sign provider
              example: 01KH6407707YBFWJ642WRWC5D3
            esign_url:
              type: string
              format: uri
              description: URL where the signer can access and sign the document
              example: >-
                https://app1.leegality.com/sign/241d83bd-56df-49c6-8635-97c2c7bfde78
            expires_at:
              type: string
              format: date-time
              description: Expiration timestamp of the e-sign link
              example: '2026-02-21T18:29:59Z'
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        code:
          type: integer
          example: 400
        message:
          type: string
          example: Validation failed
        errors:
          type: object
          additionalProperties: true
  responses:
    BadRequestError:
      description: Bad request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Unauthorized - authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Unexpected system error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````