> **Source:** https://knowledge.leegality.com/document-execution/api/sdks/troubleshooting > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # Troubleshooting ## Invalid request JSON ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_000", "traceId": null, "errors": [ { "message": "Invalid request JSON, check logs for further details", "path": "/api/v4/pack/draft", "code": "i18n.code.app.bad.request" } ] } ``` **Cause:** The request body is malformed or a field value is in the wrong format. A common trigger is passing a truncated workflow ID (e.g. `a4b63dea`) instead of the full UUID. **Fix:** Make sure `workflowId` is the full UUID format — for example, `a4b63dea-fc45-40e1-8380-51d0e2f6433d`. You can find the full ID in the detailed view of the workflow on the Leegality dashboard. ## Workflow not found for given Id and version ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_000", "traceId": null, "errors": [ { "message": "Workflow not found for given Id and version.", "path": "/api/v4/pack/draft", "code": "i18n.code.di.upstream.error" } ] } ``` **Cause:** The workflow ID is valid but the workflow is not in **Published** status. The Draft API only works with published workflows — draft or archived workflows return this error. **Fix:** Open the workflow on the Leegality dashboard and publish it before calling the Draft API. ## Email is required when auth is true ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_264", "traceId": null, "errors": [ { "message": "email is required in journeyOptions when auth is true", "path": "/api/v4/pack/draft", "code": "i18n.code.di.invitation.email.required" } ] } ``` **Cause:** You set `auth: true` in `journeyOptions` but did not include an `email` field. **Fix:** Add `"email": "sender@example.com"` to `journeyOptions`. The email must belong to an existing user on your Leegality org. ## expiresIn does not match enforced default ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_256", "traceId": null, "errors": [ { "message": "expiresIn 60 does not match the department's enforced default of 5 minutes", "path": "/api/v4/pack/draft", "code": "i18n.code.di.invitation.expiry.override.not.allowed" } ] } ``` **Cause:** The department has **Enforce link expiry** turned ON, and the `expiresIn` value in your request differs from the department's configured default. **Fix:** Either omit `expiresIn` (the department default is used automatically), pass the exact department default value, or ask your admin to turn off Enforce link expiry in **Settings > Departments > Integration Configs**. ## expiresIn out of range ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_255", "traceId": null, "errors": [ { "message": "expiresIn must be between 1 and 10080 minutes", "path": "/api/v4/pack/draft", "code": "i18n.code.di.invitation.expiry.invalid" } ] } ``` **Cause:** `expiresIn` is less than 1 or greater than 10080 (7 days). **Fix:** Set `expiresIn` to a value between 1 and 10080. ## Stuck-sender configuration ``` HTTP 400 ``` ```json { "code": "LE_ERR_DI_257", "traceId": null, "errors": [ { "message": "okButtonVisible cannot be false when successScreenAutoCloseMs is 0", "path": "/api/v4/pack/draft", "code": "i18n.code.di.invitation.success.screen.invalid" } ] } ``` **Cause:** `okButtonVisible` is `false` and `successScreenAutoCloseMs` is `0`. The sender would have no way to leave the success screen. **Fix:** Either set `okButtonVisible: true` or set `successScreenAutoCloseMs` to a value greater than 0. ## Draft not found (re-issue) ``` HTTP 404 ``` ```json { "code": "LE_ERR_DI_258", "traceId": null, "errors": [ { "message": "No draft found for workflowRunContextId 00000000-0000-0000-0000-000000000000", "path": "/api/v4/pack/journey-url", "code": "i18n.code.di.draft.not.found" } ] } ``` **Cause:** The `workflowRunContextId` does not match any draft, or it belongs to a different user. **Fix:** Verify the `workflowRunContextId` matches the value returned from the create-draft call. ## Draft already submitted (re-issue) ``` HTTP 409 ``` ```json { "code": "LE_ERR_DI_259", "traceId": null, "errors": [ { "message": "Draft has already been submitted and can no longer be re-issued", "path": "/api/v4/pack/journey-url", "code": "i18n.code.di.draft.already.submitted" } ] } ``` **Cause:** The sender already completed and submitted the pack for this draft. Each draft can only be submitted once. **Fix:** Create a new draft by calling the Draft API again. ## Expired URL The popup shows: *"This link has expired. Please return to the host application to try again."* Your `onEvent` callback receives: ```json { "eventType": "ERROR", "eventData": { "journeyId": "mvz8f0vt-ef2086362d4e", "workflowRunContextId": null, "lastPage": null, "errors": [ { "errorCode": "LE_ERR_SU_CMP_410", "errorMessage": "Expired URL" } ], "source": "leegality-sdk", "timestamp": "02-11-2026 17:55:17" } } ``` **Cause:** The signed launch URL has passed its `expiresIn` time (default 60 minutes). **Fix:** Call the [re-issue endpoint](https://knowledge.leegality.com/document-execution/api/sdks/draft-api#re-issue-a-url) to get a fresh URL for the same draft, or create a new draft. ## Invalid signature (tampered URL) The popup shows: *"This link is not valid. Please return to the host application to try again."* Your `onEvent` callback receives: ```json { "eventType": "ERROR", "eventData": { "journeyId": "mvz8h3r7-2f55bd7e256a", "workflowRunContextId": null, "lastPage": null, "errors": [ { "errorCode": "LE_ERR_SU_CMP_401", "errorMessage": "Invalid Signature" } ], "source": "leegality-sdk", "timestamp": "02-11-2026 17:56:53" } } ``` **Cause:** The signed launch URL was modified — a query parameter was added, removed, re-encoded, or reordered. **Fix:** Pass `data.url` from the Draft API response exactly as-is. Never modify the URL. ## Pack already sent (reused draft) The popup shows: *"This pack has already been sent. You may close this window."* Your `onEvent` callback receives: ```json { "eventType": "ERROR", "eventData": { "journeyId": "mvz8bhbr-1", "workflowRunContextId": null, "lastPage": null, "errors": [ { "errorCode": "LE_ERR_WR_090", "errorMessage": "Workflow run 6161710c-1d2a-4ac5-8743-34562f8d453b cannot start a journey session in status COMPLETED" } ], "source": "leegality-sdk", "timestamp": "02-11-2026 17:52:32" } } ``` **Cause:** The draft has already been used to send a pack. Each draft can only be sent once. **Fix:** Create a new draft by calling the Draft API again.