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-Tokenfrom 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
profileIdof 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
| Environment | URL |
|---|---|
| Sandbox | https://extgw.nonprod.rbihub.io/leegality/esign-estamp/1.0/en |
| Production | https://extgw.api.rbihub.io/leegality/esign-estamp/1.0/en |
HTTP Method: POST
URL path convention: /{service name}/{ver}/{lang}
| URL Parameter | Value | Description |
|---|---|---|
service name | leegality/esign-estamp | Unique name of the service |
ver | 1.0 | Current API version |
lang | en | Language for the response (default: English) |
Headers
| Header | Description | Remarks |
|---|---|---|
Authentication | JWT token generated by the ULI authentication server. Refer to the Authentication and Authorization API specification. | Mandatory |
client-id | Base64-encoded value of the Client ID provided in the JWT token. | Mandatory |
provider | Service provider code. Value: 130 for Leegality. | Mandatory |
x-lender-auth-token | Lender's JWT token for data authentication. | Mandatory |
x-sp-auth-token | Leegality's X-Auth-Token from the Leegality Dashboard. | Mandatory |
x-env-route | Required to route requests to the sandbox environment. Value: /sb | Mandatory for Sandbox only; omit for Production |
api-key | 24-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:
| Parameter | Description |
|---|---|
ts | Date and time of request initiation in ISO-8601 format: yyyy-MM-ddTHH:mm:ssZ |
txncode | Unique transaction code for this request |
ver | Version of the request template currently in use |
hmac | SHA-256 hash of the value of the data key |
data | Object containing the eSign request payload (see key fields below) |
Key fields within the data object:
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
profileId | Yes | string | ID of the published Workflow from the Leegality Dashboard |
file.name | No | string | Name of the file to be eSigned |
file.file | Yes | string | Base64-encoded PDF file to be signed (max 15 MB before encoding) |
file.fields | No | string | For Template-type workflows: fillable field values as per the Template Editor JSON |
file.additionalFiles | No | string | Array of Base64-encoded files to append to the main file or template |
invitees[].name | Yes | string | Full name of the invitee (signer or reviewer) |
invitees[].email | Conditional | string | Valid email address of the invitee. Either email or phone is required. |
invitees[].phone | Conditional | string | Valid 10-digit mobile number of the invitee. Either email or phone is required. |
invitees[].defaultLanguageSelect | No | string | Language for the signing journey. Accepted values: ENGLISH, HINDI, MARATHI, GUJARATI, BENGALI, MALAYALAM, TAMIL, TELUGU, KANNADA, ODIA |
invitees[].faceMatchImage | Conditional | string | Base64-encoded image required if Face Match is enabled in the workflow |
invitees[].aadhaarConfig | No | object | Aadhaar verification configuration (verifyName, verifyPincode, verifyYob, verifyGender, etc.) — applicable when Aadhaar validation is enabled in the workflow |
invitees[].dscConfig | No | object | DSC signing configuration — applicable when DSC validation is enabled |
invitees[].offlineSignConfig | No | object | Cloud DSC (Offline Sign) configuration — applicable when Cloud DSC is enabled in the workflow |
invitees[].gpsConfig | No | object | GPS-based location restriction configuration for the signer |
cc[].name | No | string | Name of a CC recipient |
cc[].email | No | string | Valid email ID of a CC recipient |
irn | No | string | Internal 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
| Parameter | Description |
|---|---|
ts | Date and time of the response |
txncode | Unique transaction code echoed from the request |
ver | API version |
errcode | E000 on success; a specific error code on failure |
status | success or fail |
info | Empty string on success; error message on failure |
hmac | HMAC generated by the platform on the response data |
publickey | Public key shared by the lender |
sig-algo | Algorithm used for signing the response (e.g., SHA256withECDSA) |
signature | Platform-generated signature on the response data |
data.documentId | Unique Leegality Document ID for this eSigning request. Used in callbacks and subsequent API calls. |
data.irn | Internal Reference Number as passed in the request |
data.invitees[].name | Name of the invitee |
data.invitees[].email | Email of the invitee |
data.invitees[].phone | Phone number of the invitee |
data.invitees[].signUrl | Signing URL for this invitee |
data.invitees[].active | Invitation status of the invitee |
data.invitees[].expiryDate | Expiry date of the invitee's signing link |
data.messages[].code | Response code from Leegality |
data.messages[].message | Response message from Leegality |
Callback (Webhook): After each invitee signs, Leegality sends a POST to the lender's registered callback URL. Key callback body fields:
| Field | Description |
|---|---|
webhookType | Type of webhook event: Success or Error |
documentId | Leegality Document ID for the transaction |
documentStatus | Current document status: Draft, Sent, or Completed |
mac | HMAC-SHA1 on documentId using the private salt — use this to verify the call originates from Leegality |
request.action | Action taken: Signed, Approved, or Rejected |
request.signType | Type of signature used: AADHAAR, VIRTUAL_SIGN, DSC, NESL_SIGN, OFFLINE_SIGN, DOC_SIGNER, AUTOMATED_SIGN |
request.inviteeType | Role of the invitee: signer or reviewer |
request.active | Whether the invitation is active (true/false) |
request.expired | Whether 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 Code | Description |
|---|---|
E000 | Success — no error |
E099 | Invalid lender JWT token |
ELG001 | Invalid or incorrect x-sp-auth-token |
E043 | Provider-specific dynamic error — see the error message for details |
ELG003 | Missing or empty signUrls array (Retrigger API) |
ELG004 | Missing 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
Feedback sent
We appreciate your effort and will try to fix the article