Surepass
Esign

Initialize Esign

POST
/api/v1/esign/initialize-esign

Start an Esign session for one or more signers on an uploaded document.

  • auth_mode: needed only for the aadhaar sign type.
  • page inside elements is zero-indexed: 0 is the first page.
  • Multiple elements can be added per signer on different pages.
  • email_template_overrides customizes invite email branding; when company_name is provided, default Surepass branding is hidden for white-label emails.
  • stamp optionally reserves e-stamps into the flow, either by search (amount + state_code + article_id, optionally narrowed by party names) or by explicit stamp_instance_ids. Reserved stamp PDFs are prefixed to the uploaded PDF before signing starts.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication. Paste your access token below.

Request Body

application/json
  1. body
sign_type*SignType

Signing method.

  • aadhaar: Aadhaar Esign. Signers sign in signers order.
  • suresign: Signed with the Surepass certificate.
  • pfx: Signed with your PFX certificate. Requires pfx_id.
Value in"aadhaar""suresign""pfx"
auth_mode?|array<>

Needed only for the aadhaar sign type.

  • 1: OTP (default)
  • 2: Biometric
  • 3: Iris
  • 4: Face
file_id*string

File ID returned by POST /api/v1/files/upload-pdf.

folder?string

Folder name to organize the session under.

expiry_seconds?integer

Session expiry. Min 3600 (1 hour), max 2592000 (30 days).

Range3600 <= value <= 2592000
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.

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.

signers*array<>
Items1 <= items

Response Body

Esign session created.

application/json
  1. response

Standard response envelope.

status_code?integer

HTTP status code echoed in the response body.

message?string

Human-readable result message.

success?boolean

true when the request succeeded.

data?

Esign session and its current state.

Example Request
curl -X POST 'https://prod-esign-api-v2.surepass.app/api/v1/esign/initialize-esign' \
  -H 'Content-Type: application/json' \
  -d '{
  "sign_type": "aadhaar",
  "auth_mode": 1,
  "file_id": "file_onwEUoMxnWhewUzodZeW",
  "folder": "lehddsun",
  "expiry_seconds": 7200,
  "email_template_overrides": {
    "company_name": "Acme Corp",
    "legal_name": "Acme Corporation Pvt Ltd.",
    "support_email": "support@acme.com"
  },
  "signers": [
    {
      "full_name": "Test1",
      "email": "test1@example.com",
      "reason": "Test1 Sign",
      "verify_email": false,
      "verify_mobile": false,
      "name_match": true,
      "face_ref_file_id": "file_faceReferenceImage",
      "face_match_threshold": 80,
      "face_max_attempts": 5,
      "notification": {
        "invite": true,
        "completion": true,
        "whatsapp": true
      },
      "elements": [
        {
          "x": 100,
          "y": 10,
          "page": 0,
          "type": "signature",
          "label": "Test1 signature",
          "allow_wet_signature": false
        }
      ]
    },
    {
      "full_name": "Test2",
      "email": "test2@example.com",
      "mobile": "2222222222",
      "reason": "Test2 Sign",
      "verify_email": true,
      "verify_mobile": false,
      "notification": {
        "invite": false,
        "completion": true,
        "whatsapp": false
      },
      "elements": [
        {
          "x": 100,
          "y": 10,
          "page": 0,
          "type": "signature"
        }
      ]
    }
  ]
}'
Example Response
{
  "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"
  }
}