Undersign
v1.1
Create Free Account
API Reference Reference · Error Handling
Reference

Error Handling

Practical guidance for handling failures: authentication, validation, resource and temporary problems.

1. Check the HTTP response

Inspect the HTTP status of every response before processing the body. Non-successful statuses indicate the request failed.

2. Check success

Where the response includes a success field, verify it before trusting the payload. A response with success: false should be treated as an error even if the HTTP layer looks fine.

3. Log the request_id

Log the request_id returned in the response envelope. It's the correlation identifier Undersign support uses to trace a request.

4. Log endpoint and transaction

Log the endpoint you called and your own internal transaction ID alongside the request_id so failures are traceable in both directions.

5. Handle failure categories

6. Avoid infinite retries

Cap retries and back off with increasing delays. See Rate Limits for operational guidance.

7. Error code reference

Every failure carries an error.code. Handle the code, not just the HTTP status:

Error codeHTTPMeaning
TEMPLATES_REQUIRED400templates empty or missing on create.
SIGNER_COUNT_MISMATCH400Signer count does not match the template requirement.
SIGNER_ORDER_MISMATCH400Same-position signers differ across templates in sequential mode.
PROCESSING_ERROR400Database transaction or storage copy failure.
VALIDATION_ERROR400Bulk request has an empty templates or requests array.
BATCH_SIZE_EXCEEDED400Bulk requests array exceeds 100 items.
INVALID_SIGNER_DATA400Missing name or email in a bulk signer row.
INVALID_EMAIL400Invalid email format in a bulk signer row.
CREATE_LINK_FAILED400Public link could not be created (database error).
VALIDATION_FAILED422Public link payload invalid; inspect error.details.
MONTHLY_API_QUOTA_EXCEEDED403Monthly API credits exhausted.
CREDIT_LIMIT_REACHED403Insufficient API credits for a bulk batch.
STORAGE_LIMIT_EXCEEDED403Account storage quota exceeded.
TEMPLATE_NOT_FOUND404Template UUID not found, deleted, or draft.
PACKAGE_NOT_FOUND404Signature request not found.
LINK_NOT_FOUND404Public link missing or owned by another company.
RATE_LIMIT_EXCEEDED429More than 100 requests per minute.

Example check

Node.js
const response = await fetch(url, options);
const data = await response.json();

if (!response.ok || data.success === false) {
  console.error({
    status: response.status,
    requestId: data.request_id
  });
  return;
}