Document Lifecycle (API)

Modified on Wed, 18 Nov at 6:01 PM

Every document in Signi passes through states. The state tells you what is happening with the document and what you can do with it at that moment.

Overview of states

State What it means
draft In progress — the document has been created but hasn't been sent to anyone. Signing invitations are not sent yet.
pending Waiting for signatures — an invitation e-mail has been sent to the signers.
waiting_for_answers Waiting for data to be filled in — the counterparty first needs to complete the required fields in the document.
completed Completed — everyone has signed or approved. Only now can you download the PDF with signatures.
rejected Rejected — one of the parties rejected the document.
expired Expired — the draft's validity lapsed before everyone signed.
deleted Deleted.

How the states connect

  1. You create the document via the API — either directly for signing (pending), or as a draft (draft) by setting "state": "draft" in the JSON instructions.
  2. For documents with fillable fields, signing may be preceded by the counterparty filling in data (waiting_for_answers).
  3. In the pending state the individual parties sign.
  4. It ends with one of three states: completed, rejected, or expired.

How to find out the state

By querying the document detail:

curl -H "x-api-key: VAS_API_KLIC" https://api.signi.com/api/v1/contract/ID_DOKUMENTU

The response contains the state in the state field:

{ "contract_id": "1234567", "contract_name": "…", "state": "pending", "creator": { "email": "…" } }

It's more convenient to have changes reported automatically via a webhook — Signi calls your application when the document transitions to the pending, completed, rejected, or expired state. Details in the article Webhooks — automatic notifications of document state changes.

Finding a document by internal number

When you only know your internal document number (the number field set at creation), you can look up the document ID:

curl -H "x-api-key: VAS_API_KLIC" \
  "https://api.signi.com/api/v1/contract/id?number=OBJ-2026-001"
[ { "contractId": 1234567 } ]
  • The search matches the number within the workspace of your key — it is case-insensitive and ignores diacritics and trailing spaces. If nothing is found, an empty array [] is returned.
  • The number is not unique — if reused, multiple items are returned. An envelope with attachments also returns the attachment IDs.
  • It also returns deleted documents — but their detail then returns a 404.
  • Encode special characters in the number into the URL (/ → %2F, space → %20, + → %2B, & → %26, # → %23) — an unencoded + is read as a space.

With the returned contractId you then work as usual: detail, downloading the PDF, etc.

What else the detail returns

  • pending_expiration_date — until when the document can be signed (RFC3339 with offset, e.g. 2026-10-02T23:59:59+02:00). Until the document transitions to pending, it returns null.
  • is_archived — true = the PDF is in the trusted archive; downloading then returns the archival copy (a ZIP in the case of batch archiving), to get just the PDF use ?ignoreArchive=true.
  • note — the note from the document's Internal settings as Markdown (a custom link is included in it as an MD link); without a note, null.

What to watch out for

  • The PDF with signatures can only be downloaded in the completed state — earlier you get the document without signatures.
  • Deleting documents has restrictions depending on the state — details in the article Cancelling and deleting a document.

Where to go next

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article