Docs

Examples

Replace COLLECTION_ID and YOUR_API_KEY with your own. Find both on the collection's Integrate tab in the app.

curl

curl -X POST \
  "https://crm.api.kushicorp.com/public/v1/collections/COLLECTION_ID/records?source=facebook-ads" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "full_name": "Ada Obi",
    "phone": "+2348012345678",
    "address": "12 Marina, Lagos",
    "product": "Wireless earbuds",
    "cod_amount": 18000
  }'

JavaScript (fetch)

Use this from your landing page's submit handler:

async function submitLead(values) {
  const res = await fetch(
    'https://crm.api.kushicorp.com/public/v1/collections/COLLECTION_ID/records',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ ...values, source: 'landing-page' })
    }
  );
  if (!res.ok) throw new Error('Capture failed');
  return res.json(); // { id, status }
}

Plain HTML form

A no-JavaScript starting point — progressively enhance as needed:

<form id="lead-form">
  <input name="full_name" placeholder="Full name" required />
  <input name="phone" placeholder="Phone" required />
  <input name="address" placeholder="Delivery address" />
  <button type="submit">Order now</button>
</form>

<script>
  document.getElementById('lead-form').addEventListener('submit', async (e) => {
    e.preventDefault();
    const data = Object.fromEntries(new FormData(e.target).entries());
    await fetch(
      'https://crm.api.kushicorp.com/public/v1/collections/COLLECTION_ID/records',
      {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({ ...data, source: 'website' })
      }
    );
    e.target.reset();
    alert('Thanks! We\'ll be in touch shortly.');
  });
</script>

Updating status later

For example, marking an order confirmed after a call:

curl -X PATCH \
  "https://crm.api.kushicorp.com/public/v1/records/RECORD_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "Confirmed" }'