legesis docs

Envelope lifecycle

Every state an envelope passes through, and what triggers each transition.

An envelope is the unit of signing in legesis. It bundles one or more files, a list of recipients, and the metadata required to produce a legally valid signed PDF.

Envelopes move through a small, well-defined state machine.

States

StateMeaning
draftCreated but not yet sent. Fields and recipients can be edited.
sentRecipients have been notified. Fields are locked.
in_progressAt least one signer has interacted, but signing is incomplete.
completedAll recipients have signed. Final PDF is generated.
voidedCancelled by sender. Cannot be reopened.
expiredReached its expiry without completion.
declinedA recipient explicitly declined to sign.

Transitions

FromEventTo
draftPOST /envelopes/:id/sendsent
sentFirst signer opens the envelopein_progress
in_progressLast signer completescompleted
draft / sent / in_progressPOST /envelopes/:id/voidvoided
draft / sent / in_progressPOST /envelopes/:id/expireexpired
draft / sent / in_progressA recipient declinesdeclined

A visual state diagram (Mermaid) ships with the API reference in week 2.

Why this matters for webhooks

Each transition emits an event. Subscribe to them via webhook endpoints to keep your own systems in sync without polling.

EventFires when
envelope.sentSender calls /send.
envelope.viewedAny signer opens.
envelope.signedA signer completes.
envelope.completedLast signer completes.
envelope.voidedSender voids.
envelope.expiredExpiry timestamp passes.
envelope.declinedA signer declines.
envelope.field_addedSender adds a field while in draft.

The full payload schema for each event ships with the webhook reference (coming in week 2).

On this page