Envelope Signing (eSign)CallbacksCallback Overview

Overview

After configuring the CallbackUrl on the AppId settings page in the console, the server will send a POST request to the CallbackUrl whenever an envelope status changes. Every delivery carries three request headers: X-ESign-Delivery-Id (delivery task ID, identical across all retries of the same event — recommended deduplication key), X-ESign-Attempt (delivery attempt number, starting from 1) and X-ESign-Timestamp (UNIX timestamp of this attempt, which you can use to bound the replay window). Every retry re-encrypts the payload with a new nonce, so do not deduplicate by ciphertext. > ⚠️ Note: All callbacks are POST requests. If you receive a GET request, please check whether your CallbackUrl has an HTTP-to-HTTPS 301/302 redirect.

Configuration

  1. 1. Log in to the console, click 'Management' in the top navigation, then click 'Apps & Keys' under the 'Integration' group on the left sidebar
  2. 2. Select the target app, open the 'App Details' page, and switch to the 'Integration Configuration' tab
  3. 3. Click 'Add Integration', and fill in the 'Callback URL' in the dialog (must be a publicly accessible HTTPS address)
  4. 4. Fill in the 'Encryption Key' (i.e., CallbackKey): click 'System Generated' on the right of the input box to auto-generate, or enter a 32-character key yourself
  5. 5. After saving, the platform will no longer display the key. Copy and store it securely immediately; if lost, edit the integration in 'Integration Configuration' and regenerate it (the old key is invalidated immediately, and your decryption program must be updated accordingly)
⚠️Callback URL must use HTTPS
Callback URL must be publicly accessible (internal IPs and localhost are not allowed)
The encryption key (CallbackKey) is 32 characters (256 bits), used as UTF-8 bytes when decrypting
Each app can create up to 5 integration configurations, each with its own independent encryption key

Data Format & Encryption

Data Format & Encryption

{
  "encrypt": "dGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIGV4YW1wbGU..."
}
Algorithm
AES-256-GCM
Key
32 bytes (256 bits)
Nonce
12 bytes (96 bits, randomly generated)
Ciphertext Format
Base64( nonce[12 bytes] + GCM_ciphertext + GCM_tag[16 bytes] )

Decryption Steps

  1. 1. Extract the encrypt field from the request body
  2. 2. Base64-decode to get raw bytes
  3. 3. First 12 bytes = nonce, remainder = GCM ciphertext (includes 16-byte auth tag)
  4. 4. Use CallbackKey (32 bytes, UTF-8) to create AES-256-GCM decryptor
  5. 5. GCM.Open(nonce, ciphertext) to decrypt to JSON plaintext
  6. 6. Deserialize JSON to EnvelopeCallbackPayload

Delivery Policy

HTTP Timeout
5 seconds (HTTP request timeout)
Success Condition
Client returns HTTP 200 within 5 seconds
Max Retries
36
Retry Schedule
1s, 2s, 3s, 4s, 5s → 10s, 15s, 20s, 25s, 30s, 35s, 40s, 45s, 50s, 55s → 1min, 2min, 3min, 4min, 5min, 6min, 7min, 8min, 9min, 10min → 15min, 25min, 35min, 45min, 55min → 1h, 2h, 3h, 4h, 5h, 6h
Ordering
Callbacks for the same envelope + integration are delivered in event order
ℹ️Retry intervals grow with attempt count. Once HTTP 200 is received, the platform stops re-sending this callback. After 36 failed retries, the platform considers the message undeliverable and discards it.

Best Practices

💡
  1. Keep CallbackKey secure; use environment variables or a secrets manager instead of hardcoding
  2. Keep callback handling lightweight; return HTTP 200 within 5 seconds; process complex logic asynchronously
  3. Implement idempotent handling, as the same event may be delivered more than once in edge cases
  4. Log all callback events for troubleshooting
  5. Use EnvelopeId + EventType + OccurredAt to determine event uniqueness