Kommo + Legalesign: E-Signature from the Sales Pipeline for UK Teams

Legalesign is a British electronic signature platform focused on legally binding documents for EU and UK markets. Integration with Kommo lets you send a contract for signing directly from the deal card and automatically move the deal to the next stage once all parties have signed.

Legalesign uses a REST API with API-key authentication. Webhooks fire on every document lifecycle event: created, viewed, signed, declined. This makes the integration reliable and observable - as opposed to polling-based approaches.

Why no native Legalesign + Kommo integration exists

Legalesign is a specialized tool for the UK and EU markets with a smaller market share than DocuSign or Adobe Sign. There is no Legalesign widget in the Kommo Marketplace. Companies that choose Legalesign for its UK eIDAS and GDPR compliance are left to either send documents manually or build workarounds through Zapier.

The Zapier problem: task limits, no retry on errors, inability to pass binary data (a finished contract PDF), and 1-15 minute delays. For B2B sales this is critical - the client expects the contract immediately after terms are agreed.

Custom integration via the Legalesign REST API solves all of those problems and adds:

  • Automatic population of document fields from the deal card
  • Signature status tracking in the Kommo card
  • Manager notifications when the client views or signs the document
  • Two-way sync: the signed PDF is saved as a note on the deal

Integration architecture

Components:

  • Python microservice (FastAPI)
  • Kommo Webhook: “Stage change” event to the “Send Contract” stage
  • Legalesign REST API v1: create document from template, send to recipients
  • Legalesign Webhooks: events document_signed, document_viewed, document_declined
  • PostgreSQL: stores the signer_id -> lead_id mapping
import requests
import hashlib
import hmac

LEGALESIGN_BASE = "https://api.legalesign.com/api/v1"

def create_document_from_template(
    api_key: str,
    template_id: str,
    signers: list,
    field_values: dict
) -> dict:
    """
    Create a document from a Legalesign template.
    field_values: {"company_name": "Acme Ltd", "deal_value": "£5,000"}
    """
    headers = {
        "Authorization": f"ApiKey {api_key}",
        "Content-Type": "application/json",
    }
    payload = {
        "template": f"/api/v1/template/{template_id}/",
        "signers": signers,
        "text_fields": [
            {"label": k, "value": v}
            for k, v in field_values.items()
        ],
        "auto_send": True,
    }
    resp = requests.post(
        f"{LEGALESIGN_BASE}/document/",
        headers=headers,
        json=payload
    )
    resp.raise_for_status()
    return resp.json()

def handle_legalesign_webhook(payload: dict, kommo_client):
    """
    Handle Legalesign events:
    - document_signed: move deal to the next stage
    - document_declined: add tag and notify manager
    """
    event = payload.get("event")
    document_id = payload.get("document", {}).get("id")
    lead_id = get_lead_id_by_document(document_id)  # from DB
    
    if event == "document_signed":
        kommo_client.update_lead(
            lead_id,
            status_id=SIGNED_STAGE_ID,
            custom_fields={LEGALESIGN_DOC_ID_FIELD: document_id}
        )
        # Download the signed PDF and attach to the deal
        pdf_url = payload.get("document", {}).get("signed_pdf_url")
        if pdf_url:
            attach_pdf_to_lead(lead_id, pdf_url, kommo_client)
    
    elif event == "document_declined":
        kommo_client.add_note(
            lead_id,
            text=f"Client declined to sign the document. Reason: {payload.get('decline_reason', 'not provided')}"
        )

Step-by-step implementation

Step 1 - get the Legalesign API key. In Legalesign account settings: Settings -> API. The API key is tied to the account, not to a user. We recommend creating a dedicated technical account for integrations.

Step 2 - create the document template. In Legalesign, create a contract template with variable fields (merge fields). Field names must exactly match the keys in your mapping.

Step 3 - Kommo webhook. Configure a webhook on stage change. Filter: only the transition to the “Send Contract” stage (set a specific stage_id).

Step 4 - Legalesign webhook. In Legalesign settings, enter your microservice URL to receive events. Legalesign supports HMAC-SHA256 verification - use it.

Step 5 - data mapping. From Kommo deal fields, extract: client name, company, email, deal amount, contract start date. Substitute into the template.

Step 6 - store the link. After the document is created, save the document_id in a custom Kommo deal field and in your database (document_id -> lead_id). This is required for reverse mapping when a webhook is received.

Real case: law agency, London

Corporate law agency with 18 employees. They handle B2B clients, averaging 30-40 new contracts per month. All documents go through Legalesign due to UK eIDAS compliance.

Before the integration: the manager manually opened Legalesign, uploaded the template, entered client details, and sent it. 15-20 minutes per contract. If data was wrong - revoke and resend.

After the integration: the manager moves the deal to the “Contract” stage in Kommo. Within 45 seconds the client receives an email with a signing link. All data is automatically populated from the deal card. On signing, the deal automatically moves to “Onboarding.”

Result: 7-8 hours saved per week on administrative work. Contract data errors dropped from 8% to 0 - data comes directly from the CRM rather than being typed manually.

Who this is for

The Kommo + Legalesign integration is relevant for:

  • Companies in the UK/EU market where eIDAS-compliant signatures matter
  • Agencies and consultancies processing 20+ contracts per month
  • B2B teams where contract sending delays affect conversion
  • Organizations already using Legalesign and not looking to switch platforms

If you are evaluating other signature platforms, the Exceltic registry includes breakdowns of integrations with Kommo + Dropbox Sign and Kommo + Yousign - the latter is also aimed at the EU market.

Frequently asked questions

Can a contract be sent to multiple signatories in a defined order?

Yes. Legalesign supports sequential signing. In the payload you specify an array of signers with a signing_order parameter. The second signer does not receive a notification until the first has signed. This is a typical scenario for corporate contracts where the client’s account manager signs first, followed by the director.

Where is the signed document stored?

Legalesign stores the signed PDF on its own servers and provides a secure link. When the document_signed webhook fires, it includes a signed_pdf_url. Our integration downloads the PDF and attaches it as a note in Kommo - so the manager sees the document directly in the deal card without going to Legalesign.

The Legalesign API supports resending a reminder via POST /api/v1/document/{id}/remind/. The integration can be configured to send an automatic reminder after X days if the document has not been signed. Alternatively, a button in Kommo can trigger a manual reminder request.

Legalesign creates electronic signatures compliant with the UK Electronic Communications Act 2000 and EU eIDAS Regulation. This is sufficient for most commercial contracts. For documents requiring a Qualified Electronic Signature (QES), Legalesign offers integration with certified trust services. Confirm requirements with your legal counsel.

Does the integration work with custom PDF templates?

Yes. Legalesign allows uploading PDFs with anchor tags for placing signature fields. You upload your branded template, place signature fields and variables. The API creates a document from that template with substituted data. This is more flexible than standard template editors.

Next step

If you need a Kommo + Legalesign integration - describe your requirements to the Exceltic.dev team. We will review your document template, field mapping, and compliance requirements. A standard project takes 1-2 weeks.

More articles

All →