KaserkDevelopers

Register a lead with Make

Turn one form submission into a company, a contact and a deal with retry protection.

Permissions
catalogs.read · contacts.write · companies.write · deals.write

  1. Only active pipelines and stages appear in these catalogs. External references belong to the integration that created them. Search by external_reference and compare the returned ID to verify a previous submission.
  2. In Make, start with the form trigger. Keep a stable submission ID. Discover the destination with GET /pipelines and GET /pipelines/{id}/stages. Select the pipeline and stage by name and retain their IDs.
  3. Add three HTTP modules in the order in the example. Select POST, send JSON, supply Authorization using the key stored in Make and map Idempotency-Key to the submission ID plus the operation suffix.
  4. For POST /companies map the company name. For POST /contacts map the person’s name and the company’s data.id. For POST /deals map the pipeline, stage and contact IDs. Store the resulting deal data.id.
curl --fail-with-body \
  -H "Authorization: Bearer ${KASERK_API_KEY}" \
  "https://api.kaserk.com/v1/pipelines"

JavaScript example

import { request } from './client.mjs';

export function findSubmission(submissionId) {
  return request('/deals/search', {method:'POST',body:{external_reference:submissionId}});
}

export async function registerLead({ submissionId, name, companyName, pipelineId, stageId }) {
  // Save the submission ID at the source. Reuse it on every retry of this form.
  const { data: company } = await request('/companies', { method: 'POST',
    key: submissionId + ':company', body: { name: companyName, external_reference: submissionId } });
  const { data: contact } = await request('/contacts', { method: 'POST',
    key: submissionId + ':contact', body: { name, company_id: company.id, external_reference: submissionId } });
  return request('/deals', { method: 'POST', key: submissionId + ':deal', body: {
    pipeline_id: pipelineId, stage_id: stageId, company_id: company.id, contact_ids: [contact.id],
    title: companyName, external_reference: submissionId,
  } });
}

Recovery

If Make loses the response, replay the same body and key. Find an older submission with POST /deals/search, deals.read and the body {"external_reference":"form-123"}. Keep names, phones, emails and reference filters in the JSON body. Search uses the read quota and requires no idempotency key. If a shared email matches multiple people, resolve the contact before linking the deal.