e-Sign — Leegality

Created by Rajatha B M, Modified on Fri, 27 Mar at 2:33 PM by Rajatha B M

What does this API do?

The Leegality e-Sign API allows lenders integrated with the ULI Platform to initiate digital signing journeys for loan documents. It creates an eSigning request for one or more invitees (signers/reviewers) and returns a unique Document ID along with signing URLs. Invitees receive signing links via SMS, Email, or WhatsApp to complete the process.

Supported eSign types include:

  • Aadhaar eSign — Aadhaar OTP, Biometric, Iris, or Face verification-based digital signature.
  • Virtual Sign — Mobile/Email OTP-based approval.
  • DSC — USB-dongle based digital signature using a Certificate Authority-issued DSC.
  • Document Signer Certificate — Server-based, organisation-level signing certificate.
  • Automated Signer — Pre-configured signing using a Document Signer Certificate or Virtual Signature.
  • Quick Sign — Drawn, chosen, or fingerprint-based signature for a frictionless experience.

Once all signatories have signed, the platform sends a callback notification to the lender's registered callback URL with document status and invitee details.

Who can use it?

Lenders and financial institutions onboarded on the ULI Platform who need to digitise document signing workflows for loan agreements, sanction letters, or other legal documents.

Prerequisites

Complete all common platform prerequisites as described in Getting Started with ULI Platform APIs.

In addition, the following Leegality-specific steps must be completed before calling this API:

  • Leegality Account Onboarding — Complete the necessary Leegality account setup to obtain system access.
  • X-Auth-Token Setup — Retrieve your X-Auth-Token from the API Settings tab on your Leegality dashboard. This is required in every API request header.
  • Workflow Configuration — Define and publish at least one Workflow Profile in the Leegality dashboard. The profileId of a published workflow is mandatory in the request body.
  • Template Configuration (if applicable) — If using a Template-type workflow, configure the template with any fillable fields. Alternatively, a Base64-encoded PDF can be passed directly.
  • Callback URL Registration — Register a callback URL with the platform to receive post-signing webhook notifications from Leegality.

API endpoints

EnvironmentURL
Sandboxhttps://extgw.nonprod.rbihub.io/leegality/esign-estamp/1.0/en
Productionhttps://extgw.api.rbihub.io/leegality/esign-estamp/1.0/en

HTTP Method: POST

URL path convention: /{service name}/{ver}/{lang}

URL ParameterValueDescription
service nameleegality/esign-estampUnique name of the service
ver1.0Current API version
langenLanguage for the response (default: English)

Headers

HeaderDescriptionRemarks
AuthenticationJWT token generated by the ULI authentication server. Refer to the Authentication and Authorization API specification.Mandatory
client-idBase64-encoded value of the Client ID provided in the JWT token.Mandatory
providerService provider code. Value: 130 for Leegality.Mandatory
x-lender-auth-tokenLender's JWT token for data authentication.Mandatory
x-sp-auth-tokenLeegality's X-Auth-Token from the Leegality Dashboard.Mandatory
x-env-routeRequired to route requests to the sandbox environment. Value: /sbMandatory for Sandbox only; omit for Production
api-key24-character alphanumeric key assigned during lender registration.Optional — reserved for future use

Request body

All requests must be in JSON format. The top-level envelope parameters are:

ParameterDescription
tsDate and time of request initiation in ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ
txncodeUnique transaction code for this request
verVersion of the request template currently in use
hmacSHA-256 hash of the value of the data key
dataObject containing the eSign request payload (see key fields below)

Key fields within the data object:

ParameterMandatoryTypeDescription
profileIdYesstringID of the published Workflow from the Leegality Dashboard
file.nameNostringName of the file to be eSigned
file.fileYesstringBase64-encoded PDF file to be signed (max 15 MB before encoding)
file.fieldsNostringFor Template-type workflows: fillable field values as per the Template Editor JSON
file.additionalFilesNostringArray of Base64-encoded files to append to the main file or template
invitees[].nameYesstringFull name of the invitee (signer or reviewer)
invitees[].emailConditionalstringValid email address of the invitee. Either email or phone is required.
invitees[].phoneConditionalstringValid 10-digit mobile number of the invitee. Either email or phone is required.
invitees[].defaultLanguageSelectNostringLanguage for the signing journey. Accepted values: ENGLISH, HINDI, MARATHI, GUJARATI, BENGALI, MALAYALAM, TAMIL, TELUGU, KANNADA, ODIA
invitees[].faceMatchImageConditionalstringBase64-encoded image required if Face Match is enabled in the workflow
invitees[].aadhaarConfigNoobjectAadhaar verification configuration (verifyName, verifyPincode, verifyYob, verifyGender, etc.) — applicable when Aadhaar validation is enabled in the workflow
invitees[].dscConfigNoobjectDSC signing configuration — applicable when DSC validation is enabled
invitees[].offlineSignConfigNoobjectCloud DSC (Offline Sign) configuration — applicable when Cloud DSC is enabled in the workflow
invitees[].gpsConfigNoobjectGPS-based location restriction configuration for the signer
cc[].nameNostringName of a CC recipient
cc[].emailNostringValid email ID of a CC recipient
irnNostringInternal Reference Number for the document, usable for search via API or Dashboard

Sample request skeleton:

{
  "ts": "2025-05-01T10:00:00Z",
  "txncode": "TXN123456789",
  "ver": "1.0",
  "hmac": "<SHA-256 hash of data value>",
  "data": {
    "profileId": "<workflow-profile-id>",
    "file": {
      "name": "LoanAgreement.pdf",
      "file": "<base64-encoded-pdf>"
    },
    "invitees": [
      {
        "name": "Borrower Name",
        "email": "borrower@example.com",
        "phone": "9876543210"
      }
    ],
    "irn": "LENDER-REF-001"
  }
}

Response fields

ParameterDescription
tsDate and time of the response
txncodeUnique transaction code echoed from the request
verAPI version
errcodeE000 on success; a specific error code on failure
statussuccess or fail
infoEmpty string on success; error message on failure
hmacHMAC generated by the platform on the response data
publickeyPublic key shared by the lender
sig-algoAlgorithm used for signing the response (e.g., SHA256withECDSA)
signaturePlatform-generated signature on the response data
data.documentIdUnique Leegality Document ID for this eSigning request. Used in callbacks and subsequent API calls.
data.irnInternal Reference Number as passed in the request
data.invitees[].nameName of the invitee
data.invitees[].emailEmail of the invitee
data.invitees[].phonePhone number of the invitee
data.invitees[].signUrlSigning URL for this invitee
data.invitees[].activeInvitation status of the invitee
data.invitees[].expiryDateExpiry date of the invitee's signing link
data.messages[].codeResponse code from Leegality
data.messages[].messageResponse message from Leegality

Callback (Webhook): After each invitee signs, Leegality sends a POST to the lender's registered callback URL. Key callback body fields:

FieldDescription
webhookTypeType of webhook event: Success or Error
documentIdLeegality Document ID for the transaction
documentStatusCurrent document status: Draft, Sent, or Completed
macHMAC-SHA1 on documentId using the private salt — use this to verify the call originates from Leegality
request.actionAction taken: Signed, Approved, or Rejected
request.signTypeType of signature used: AADHAAR, VIRTUAL_SIGN, DSC, NESL_SIGN, OFFLINE_SIGN, DOC_SIGNER, AUTOMATED_SIGN
request.inviteeTypeRole of the invitee: signer or reviewer
request.activeWhether the invitation is active (true/false)
request.expiredWhether the invitation has expired (true/false)

The lender's callback endpoint must return an HTTP 200 response. If not received, Leegality will retry the callback 3 times.

Error codes

Error CodeDescription
E000Success — no error
E099Invalid lender JWT token
ELG001Invalid or incorrect x-sp-auth-token
E043Provider-specific dynamic error — see the error message for details
ELG003Missing or empty signUrls array (Retrigger API)
ELG004Missing or empty documentId

For a comprehensive list of platform-level error codes, refer to the Latest Platform Error Code document.

Who to contact?

If you encounter an issue with the e-Sign API, email support@rbihub.in with the following details:

  • Subject: Leegality eSign API Error
  • Service Name: esign-estamp
  • Environment: Sandbox or Production
  • Service Provider: Leegality
  • Request Headers
  • Request Payload
  • Error Code and Error Message
  • Screenshot or log of the error
  • Prerequisites status: IP Whitelisting, URL Whitelisting, Service Subscription, Token Generation

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article