Initialize Esign from template
Start an Esign session using a previously saved template. The template
contributes file_id, signer elements, and signer defaults; the
request contributes top-level Esign options plus runtime signer data
in the same order as the template's signers array.
- Runtime signer count must match the template signer count.
element_valuesoverrides template elementvalues at runtime by templatefield_id; position and type still come from the template.- Template signer defaults are merged with runtime signer input before
the normal
initialize-esignvalidation flow runs. full_nameshould be supplied,reasonmust be supplied unless saved in the template, and at least one ofemailormobilemust be present.- This endpoint creates a real Esign flow, just like
initialize-esign.
bearerAuthAuthorizationBearer <token>Bearer token authentication. Paste your access token below.
application/json- body
template_id*stringTemplate ID returned by POST /api/v1/templates/save.
sign_type?SignTypeSigning method.
aadhaar: Aadhaar Esign. Signers sign insignersorder.suresign: Signed with the Surepass certificate.pfx: Signed with your PFX certificate. Requirespfx_id.
"aadhaar""suresign""pfx"auth_mode?|array<>Needed only for the aadhaar sign type.
1: OTP (default)2: Biometric3: Iris4: Face
folder?stringFolder name to organize the session under.
allow_download?booleanAllow downloading the signed document.
expiry_seconds?integerOptional. Min 3600 (1 hour), max 2592000 (30 days).
3600 <= value <= 2592000redirect_url?stringURL the signer is redirected to after completing the Esign.
backend?stringSigning backend to use.
stamp?Optional e-stamping configuration. Use either the amount-based
reservation flow (amount + state_code + article_id, required
together) or pass pre-reserved stamp_instance_ids.
email_template_overrides?Optional invite email branding overrides. When company_name is
provided, the default Surepass logo and branding are hidden, allowing
white-label emails.
signers*array<>Count must match the template signer count, in the same order.
1 <= itemsEsign session created from the template.
application/json- response
Standard response envelope.
status_code?integerHTTP status code echoed in the response body.
message?stringHuman-readable result message.
success?booleantrue when the request succeeded.
data?Esign session and its current state.
curl -X POST 'https://prod-esign-api-v2.surepass.app/api/v1/esign/initialize-from-template' \
-H 'Content-Type: application/json' \
-d '{
"template_id": "template_xxx",
"sign_type": "suresign",
"auth_mode": 1,
"folder": "HR",
"allow_download": true,
"expiry_seconds": 7200,
"redirect_url": "https://example.com/esign/complete",
"email_template_overrides": {
"company_name": "Acme Corp"
},
"signers": [
{
"full_name": "Employer A",
"email": "employer@example.com",
"reason": "Employer sign",
"face_ref_file_id": "file_faceReferenceImage",
"notification": {
"invite": true,
"completion": true,
"whatsapp": true
},
"element_values": {
"field_xxx": "INV-1001",
"field_yyy": "now"
}
},
{
"full_name": "Employee B",
"email": "employee@example.com",
"reason": "Employee sign",
"name_match": true,
"element_values": {
"field_zzz": "Employee B"
}
}
]
}'{
"status_code": 0,
"message": "string",
"success": true,
"data": {
"actor_id": "string",
"actor_type": "user",
"allow_download": true,
"archived": true,
"auth_mode": 1,
"backend": "nsdl",
"client_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"current_pdf_file_id": "string",
"email_template_overrides": {
"company_name": "string",
"legal_name": "string",
"support_email": "string"
},
"expiry_seconds": 0,
"file_id": "string",
"filename": "string",
"folder": "string",
"redirect_url": "http://example.com",
"sender": "string",
"sign_type": "aadhaar",
"signers": [
{
"signer_id": "string",
"eligible": true,
"invite_url": "http://example.com",
"token": "string",
"sign_type": "aadhaar",
"auth_mode": 1,
"max_retry": 1,
"pfx_id": "string",
"full_name": "string",
"email": "user@example.com",
"country_code": "string",
"mobile": "string",
"verify_email": true,
"verify_mobile": true,
"reason": "string",
"accept_virtual_sign": true,
"status": "pending",
"elements": [
{
"field_id": "string",
"x": 0,
"y": 0,
"page": 0,
"type": "signature",
"alignment": "left",
"label": "string",
"width": 0,
"height": 0,
"allow_wet_signature": true,
"font_size": 0,
"format": "string",
"value": "string"
}
],
"aadhaar_cert_details": {
"name": "string",
"country": "string",
"state": "string",
"pin_code": "string",
"aadhaar": "string",
"year_of_birth": "string",
"gender": "string"
},
"verify_location": true,
"location_source": "device",
"enforce_geofence": true,
"latitude": 0,
"longitude": 0,
"radius": 0,
"name_match": {
"enforce": true,
"prefill_name": "string",
"signer_name": "string",
"score": 0,
"status": "pending"
},
"face_match": {
"enforce": true,
"ref_file_id": "string",
"live_file_id": "string",
"match_threshold": 0,
"max_attempts": 0,
"liveness_score": 0,
"match_score": 0
},
"notification": {
"invite": true,
"completion": true,
"whatsapp": true
}
}
],
"status": "pending"
}
}