Developer use case

EMI reminder calls with promise-to-pay back into your LMS

Each morning your loan system sends the EMIs due; the AI calls each borrower with their own amount and date, and each promise to pay goes back to your LMS.

All use cases

Before you start

  • A calling campaign made once on Campaigns, with your collections agent and its calling hours.
  • A live key with campaigns:write and calls:read.
  • API access is on Growth and above. Without it every request answers 402, and the key works again once the plan includes it.

How it works

Each morning your loan system hands over the EMIs due; the AI calls each borrower with their own amount and date, and every promise to pay lands back in your LMS.

  • Permission campaigns:write
  • Permission calls:read
  • Event lead.captured
  • Event call.completed
  • Places billed calls
  1. Make a calling campaign once, on the Campaigns page, with your collections agent and calling hours. Its script can use {amount}, {due_date} and {loan_id}.

  2. Each morning, add the borrowers due, up to 100 a request, with their amount and due date as fields. They are found by number, never duplicated, and rung within the campaign's hours. POST /api/v1/campaigns/{campaign_id}/contacts

  3. When a borrower promises to pay, the captured date and amount arrive at your webhook. Write them to the loan. lead.captured

  4. Every call's outcome follows, so a refusal or a wrong number can go to your team. call.completed

Each morning (Node)
await fetch(`https://aicallstudio.com/api/v1/campaigns/${CAMPAIGN_ID}/contacts`, {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.AICALLSTUDIO_KEY,
    "Content-Type": "application/json",
    "Idempotency-Key": "emi-" + today,
  },
  body: JSON.stringify({
    contacts: dueToday.map(l => ({
      phone: l.mobile,
      name: l.borrower,
      custom_fields: { loan_id: l.id, amount: l.emi, due_date: l.dueDate },
    })),
  }),
});

// Every delivery is signed: check it before you trust the body.
const crypto = require("crypto");
function signed(rawBody, header, secret) {
  const want = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return header && crypto.timingSafeEqual(Buffer.from(header), Buffer.from(want));
}

// Your webhook: lead.captured
app.post("/aicallstudio", express.raw({ type: "*/*" }), (req, res) => {
  if (!signed(req.body, req.get("X-Aicallstudio-Signature"), process.env.WEBHOOK_SECRET)) return res.sendStatus(401);
  const { event, data } = JSON.parse(req.body);
  if (event === "lead.captured" && data.fields.promise_date) {
    lms.recordPromise(data.contact_id, data.fields.promise_date, data.fields.amount);
  }
  res.sendStatus(200);
});

When are borrowers rung?

Within the campaign's own calling hours. Agents made from the collections templates keep to 9 am to 7 pm IST, and no call is placed outside 9 am to 9 pm IST whatever the setting. Borrowers are found by number, so adding one twice does not duplicate them.

Costs and what to watch

  • Every call the API places is a real call to a real person, billed from your wallet like any other call, at your plan's rates. Try it on your own number first.
  • Recovery calls have sector rules of their own. The product enforces your Do-Not-Call list and the calling hours; what a recovery call may say stays your responsibility.

Put AI Call Studio on your phone lines.

Book a 30-minute walkthrough, or call us right now: +91 922 222 1378