Constants

Overview

Constants define key values used across the QuicklySign API. These values are important when checking statuses, specifying document types, handling errors, and working with webhooks or audit trails.

Whenever possible, use these constants instead of hardcoding string values to reduce mistakes and improve readability.


Document Status

Documents go through different stages. Use these statuses to check or update the state of a document.

StatusDescription
setupDocument is currently in setup (fields can be placed, not yet sent for signatures)
awaiting_signaturesDocument is awaiting signatures
completeDocument has been signed by all parties
conversion_errorAn error occurred while creating or converting the document

JS Example:

var STATUS = {
  setup: "setup",
  awaiting_signatures: "awaiting_signatures",
  complete: "complete",
  conversion_error: "conversion_error"
};

Document Types

Documents can be a standard document or a template that can be reused.

TypeDescription
documentA standard document that can be signed
templateA reusable template that can be copied to create new documents

JS Example:

var DOCUMENT_TYPE = {
  document: "document",
  template: "template"
};

Data Field Types

Data fields specify the type of input required and the type of field on a document.

TypeDescription
signatureSignature field where the user signs
initialInitials field
textFree-form text
dateDate field (accepts date input)
checkCheckbox (value is either checked or unchecked)
blockBlocks out content (e.g., a clause that doesn’t apply to the user)
fileFile upload field
choiceField with predefined selectable options

JS Example:

var DATA_FIELD_TYPE = {
  signature: "signature",
  initial: "initial",
  text: "text",
  date: "date",
  check: "check",
  block: "block",
  file: "file",
  choice: "choice"
};

Signatory Status

Signatories have a status indicating if they have completed signing.

StatusDescription
setupSignature request has not been sent
awaiting_signaturesSignature request sent but not yet completed
completeSignatory has signed the document

JS Example:

var SIGNATORY_STATUS = {
  setup: "setup",
  awaiting_signatures: "awaiting_signatures",
  complete: "complete"
};

Error Codes

Error codes help identify problems when interacting with the API.

Error CodeDescription
bad_requestGeneric error if no specific code is returned. Check the message for details
unauthorizedCredentials are invalid or insufficient permissions
invalid_access_tokenAccess token is no longer valid or has been revoked
conversion_failedDocument failed to convert (PDF or image generation failed)
status_change_deniedAttempted invalid status update
operation_deniedEntity cannot be updated or deleted
signatory_detail_errorMissing or duplicate signatory information
conflict_errorEntity updated previously; system cannot resolve version
not_supportedThe feature is currently unsupported
insufficient_fundsThe API client lacks funds to perform the operation
service_unavailableShould not happen; returned if the system is down for maintenance
not_foundEntity could not be found
internal_server_errorUnexpected server error. Contact [email protected] if it occurs

JS Example:

var ERROR_CODES = {
  bad_request: "bad_request",
  unauthorized: "unauthorized",
  invalid_access_token: "invalid_access_token",
  conversion_failed: "conversion_failed",
  status_change_denied: "status_change_denied",
  operation_denied: "operation_denied",
  signatory_detail_error: "signatory_detail_error",
  conflict_error: "conflict_error",
  not_supported: "not_supported",
  insufficient_funds: "insufficient_funds",
  service_unavailable: "service_unavailable",
  not_found: "not_found",
  internal_server_error: "internal_server_error"
};

Subscription Callback Events

Events you can subscribe to via webhooks or event hooks.

EventDescription
entity_updatedEntity you subscribed to has been updated
document_status_changedDocument status has changed
audit_trail_updatedAudit trail updated
signatory_updatedSignatory details updated (email count, status, etc.)
data_field_updatedData field has been updated
final_document_generatedFinal document has been generated

JS Example:

var CALLBACK_EVENT = {
  entity_updated: "entity_updated",
  document_status_changed: "document_status_changed",
  audit_trail_updated: "audit_trail_updated",
  final_document_generated: "final_document_generated"
};

Audit Trail Entry Types

Audit trail entries track all actions on a document.

Audit Entry TypeDescription
signature_request_sentSignature request was sent
signature_request_reminder_sentReminder to sign was sent
user_details_changedUser details (name/email/mobile) were changed
sms_deliveredOTP delivered via SMS
sms_sentOTP sent via SMS
sms_failureOTP failed to deliver
email_failureEmail failed to deliver
email_tracking_infoGeneral email tracking info (sent, opened, delivered)
document_status_changedDocument status changed (e.g., complete)
document_createdDocument created
document_openedDocument opened
document_completedDocument signed and completed
document_uploadedDocument uploaded
document_deletedDocument deleted
user_signedUser signed the document
user_signed_in_personUser signed in-person
user_opted_to_sign_laterUser opted to sign later
logGeneric entry when no other type fits
entered_incorrect_otpIncorrect OTP entered
entered_correct_otpCorrect OTP entered
in_person_signing_link_generatedIn-person signing link generated
document_downloadedCompleted document downloaded
document_preview_generatedPreview of the document generated
document_preview_downloadedPreview downloaded
document_opened_via_in_person_signing_linkDocument opened via in-person signing link

Constants Cheat Sheet

Quick reference showing which constants apply to each major API feature.

AreaRelevant ConstantsDescription
Document PacksSTATUS, DOCUMENT_TYPETrack document lifecycle stages; distinguish normal documents vs templates
SignatoriesSIGNATORY_STATUSDetermine if a signatory is in setup, awaiting signatures, or complete
Data FieldsDATA_FIELD_TYPEDefine field types on a document (signature, text, date, file, etc.)
Error HandlingERROR_CODESStandard error codes returned by the API
Webhooks & Event HooksCALLBACK_EVENTEvents you can subscribe to (status changes, audit trail updates, final document generation, etc.)
Audit TrailsAUDIT_TRAIL_ENTRY_TYPEExact types of actions recorded in the audit trail