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.
| Status | Description |
|---|---|
| setup | Document is currently in setup (fields can be placed, not yet sent for signatures) |
| awaiting_signatures | Document is awaiting signatures |
| complete | Document has been signed by all parties |
| conversion_error | An 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.
| Type | Description |
|---|---|
| document | A standard document that can be signed |
| template | A 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.
| Type | Description |
|---|---|
| signature | Signature field where the user signs |
| initial | Initials field |
| text | Free-form text |
| date | Date field (accepts date input) |
| check | Checkbox (value is either checked or unchecked) |
| block | Blocks out content (e.g., a clause that doesn’t apply to the user) |
| file | File upload field |
| choice | Field 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.
| Status | Description |
|---|---|
| setup | Signature request has not been sent |
| awaiting_signatures | Signature request sent but not yet completed |
| complete | Signatory 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 Code | Description |
|---|---|
| bad_request | Generic error if no specific code is returned. Check the message for details |
| unauthorized | Credentials are invalid or insufficient permissions |
| invalid_access_token | Access token is no longer valid or has been revoked |
| conversion_failed | Document failed to convert (PDF or image generation failed) |
| status_change_denied | Attempted invalid status update |
| operation_denied | Entity cannot be updated or deleted |
| signatory_detail_error | Missing or duplicate signatory information |
| conflict_error | Entity updated previously; system cannot resolve version |
| not_supported | The feature is currently unsupported |
| insufficient_funds | The API client lacks funds to perform the operation |
| service_unavailable | Should not happen; returned if the system is down for maintenance |
| not_found | Entity could not be found |
| internal_server_error | Unexpected 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.
| Event | Description |
|---|---|
| entity_updated | Entity you subscribed to has been updated |
| document_status_changed | Document status has changed |
| audit_trail_updated | Audit trail updated |
| signatory_updated | Signatory details updated (email count, status, etc.) |
| data_field_updated | Data field has been updated |
| final_document_generated | Final 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 Type | Description |
|---|---|
| signature_request_sent | Signature request was sent |
| signature_request_reminder_sent | Reminder to sign was sent |
| user_details_changed | User details (name/email/mobile) were changed |
| sms_delivered | OTP delivered via SMS |
| sms_sent | OTP sent via SMS |
| sms_failure | OTP failed to deliver |
| email_failure | Email failed to deliver |
| email_tracking_info | General email tracking info (sent, opened, delivered) |
| document_status_changed | Document status changed (e.g., complete) |
| document_created | Document created |
| document_opened | Document opened |
| document_completed | Document signed and completed |
| document_uploaded | Document uploaded |
| document_deleted | Document deleted |
| user_signed | User signed the document |
| user_signed_in_person | User signed in-person |
| user_opted_to_sign_later | User opted to sign later |
| log | Generic entry when no other type fits |
| entered_incorrect_otp | Incorrect OTP entered |
| entered_correct_otp | Correct OTP entered |
| in_person_signing_link_generated | In-person signing link generated |
| document_downloaded | Completed document downloaded |
| document_preview_generated | Preview of the document generated |
| document_preview_downloaded | Preview downloaded |
| document_opened_via_in_person_signing_link | Document opened via in-person signing link |
Constants Cheat Sheet
Quick reference showing which constants apply to each major API feature.
| Area | Relevant Constants | Description |
|---|---|---|
| Document Packs | STATUS, DOCUMENT_TYPE | Track document lifecycle stages; distinguish normal documents vs templates |
| Signatories | SIGNATORY_STATUS | Determine if a signatory is in setup, awaiting signatures, or complete |
| Data Fields | DATA_FIELD_TYPE | Define field types on a document (signature, text, date, file, etc.) |
| Error Handling | ERROR_CODES | Standard error codes returned by the API |
| Webhooks & Event Hooks | CALLBACK_EVENT | Events you can subscribe to (status changes, audit trail updates, final document generation, etc.) |
| Audit Trails | AUDIT_TRAIL_ENTRY_TYPE | Exact types of actions recorded in the audit trail |
Updated 19 days ago
