Developer docs

    iContract API v1

    Create contracts, send documents for e-signature, and subscribe to lifecycle webhooks. Works great with Zapier, n8n, and Make.

    Authentication

    Every request must include your API key as a Bearer token:

    Authorization: Bearer ic_...

    Create keys in Settings → API. The raw key is shown once — store it in a password manager or secrets vault.

    Create a contract

    POST https://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/contracts

    curl -X POST https://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/contracts \
      -H "Authorization: Bearer ic_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "title": "Freelance NDA",
        "contract_type": "nda",
        "party_a": "Acme Inc.",
        "party_b": "Jane Doe",
        "party_b_email": "jane@example.com",
        "additional_notes": "Mutual, 2 year term",
        "send": true
      }'

    Response includes a share_url the recipient can open to sign.

    Send a document

    POST https://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/documents/send

    curl -X POST https://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/documents/send \
      -H "Authorization: Bearer ic_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "document_id": "<uuid>" }'

    Webhooks

    Subscribe a URL to receive JSON events:

    • contract.signed — a counterparty completed signing
    • contract.rejected — a counterparty rejected the contract
    • document.completed — all signers finished a document
    curl -X POST https://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/webhooks \
      -H "Authorization: Bearer ic_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "url": "https://hooks.zapier.com/hooks/catch/...", "events": ["contract.signed"] }'

    The response includes a secret. Each delivery is signed:

    X-iContract-Event: contract.signed
    X-iContract-Timestamp: 1735689600
    X-iContract-Signature: t=1735689600,v1=<hex-hmac-sha256>

    Verify in Node:

    import crypto from "node:crypto";
    function verify(rawBody, header, secret) {
      const { t, v1 } = Object.fromEntries(header.split(",").map(p => p.split("=")));
      const expected = crypto.createHmac("sha256", secret).update(t + "." + rawBody).digest("hex");
      return crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
    }

    In Python:

    import hmac, hashlib
    def verify(raw_body: bytes, header: str, secret: str) -> bool:
        parts = dict(p.split("=") for p in header.split(","))
        mac = hmac.new(secret.encode(), f"{parts['t']}.{raw_body.decode()}".encode(), hashlib.sha256).hexdigest()
        return hmac.compare_digest(mac, parts["v1"])

    Zapier

    Use a Webhooks by Zapier — Catch Hook trigger, paste the URL into iContract's Add endpoint form, and events flow into Zapier immediately. To create contracts from Zapier, use Webhooks by Zapier — POST pointed athttps://dabbkwahjxuiyrobeqqr.supabase.co/functions/v1/api-v1/contracts with your API key as a Bearer header.

    Rate limits & retries

    Failed webhook deliveries retry up to 6 times with exponential backoff (30s → 2h). Deliveries older than 6 attempts are marked dead and visible in the API settings console.