Skip to main content

Document Signing Workflow

DokStamp supports a three-party signature workflow: a document can be signed by external third parties (via email link) and/or signed institutionally using a digital certificate stored in the platform.

Overview


Step-by-step

1 — Create a Document Type

Document types define the template for a category of documents, including the indexer fields (metadata fields for classification).
The indexers array defines custom metadata fields for documents of this type. The rule field validates the input: "Outro" (any text), "CPF" (Brazilian tax ID), "E-mail" (email address).

2 — Upload the PDF

Save the returned uuid as file_uuid.

3 — Create the Document

The indexers array values must be in the same order as the indexers defined in the Document Type. The API maps them positionally to their configured fields.

4 — Register the Signer

Signers are third-party individuals who need to sign the document. They are identified by name, email, and CPF (Brazilian tax ID).
Use GET /signers?where[user][email]=carlos@acme.com first to avoid creating duplicate records.
This step both links the signer and triggers the signature request email automatically. This endpoint is public — no Authorization header is required.
The signer receives an email with a secure link to view and sign the document electronically.

6 — Check Signature Status

Poll the document detail endpoint to check whether all signatures have been collected:
The signatures array in the response shows the status of each signer:
"signed": true means the signer has completed their signature. false means pending.

Party signature types

While the document is in draft, each party can only have signature coordinates configured. The visible signature type is chosen by the party at signing time.

Configure coordinates on create or update (draft only)

  • signature_type and signature_image_file_uuid are not accepted on this endpoint.
  • Confirmation only requires all parties to have valid coordinates.

Choose the type when signing

The party sends the type together with the security code on the public sign endpoint:
For stamp signatures, use application/json or multipart/form-data without a file:
  • signature_type is required (stamp or image).
  • signature_image is required when signature_type is image (PNG, JPEG, or WebP).
  • signature_image cannot be sent when signature_type is stamp.
  • The endpoint uploads the image internally; POST /files is not required.

7 — Sign Institutionally

Once third-party signatures are collected, sign the document with the institution’s digital certificate:
The cert_id refers to the institutional digital certificate configured in the platform. The pin is the certificate’s PIN protection code.

8 — Download the Signed PDF

This endpoint is public — no authentication required. Share the UUID with the signer or store the link in your system.

Batch operations

For high-volume scenarios, batch endpoints are available:

Resending signature requests

If a signer did not receive or lost the email: