Prachar API

Connect your website and tools to Prachar: put every website enquiry straight into Leads, create posts, and check what went out.

1. Get a key

In Prachar, open Settings → API keys and create a key. It is shown once. Each key works for one business. Call the API only from your own server — never put the key in a web page or an app.

Authorization: Bearer pk_live_…

2. Send a website enquiry to Leads

Send a phone or an email (or both). source defaults to website.

curl -X POST https://prachar.si/api/v1/leads \
  -H "Authorization: Bearer $PRACHAR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ravi Kumar","phone":"98765 43210","interest":"Wedding saree, budget 15k"}'

3. Create a post

Without scheduledAt it is saved as a draft you can finish in Prachar. With it, the post is scheduled to every connected account of the chosen platforms. API posts are text only, so Instagram (which needs an image) is made in Prachar.

curl -X POST https://prachar.si/api/v1/posts \
  -H "Authorization: Bearer $PRACHAR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"We are open on Sunday for Dussehra!","platforms":["FACEBOOK"],"scheduledAt":"2026-10-18T10:00:00+05:30"}'

Endpoints

Webhooks

In Settings → Webhooks, add your https address and choose events: post.published, post.failed, lead.created. Prachar sends a JSON POST and expects a 2xx answer within 10 seconds. Failed deliveries are retried after 1, 5, 30 and 120 minutes; redirects are not followed.

{ "id": "evt_…", "type": "lead.created", "createdAt": "2026-10-12T10:00:00.000Z",
  "data": { "lead": { "id": "…", "name": "Ravi Kumar", "phone": "+919876543210", "source": "website" }, "via": "api" } }

Every request carries Prachar-Event, Prachar-Delivery (use it to ignore repeats) and Prachar-Signature: t=…,v1=…. Check the signature with your signing secret before trusting the message:

// Node.js — use the raw request body, before JSON parsing
import { createHmac, timingSafeEqual } from "node:crypto";
function isFromPrachar(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // too old
  const want = createHmac("sha256", secret).update(t + "." + rawBody).digest("hex");
  return v1.length === want.length && timingSafeEqual(Buffer.from(v1), Buffer.from(want));
}

Errors and limits

Errors return {"error":{"code","message"}} with a 4xx status. Up to 1,000 requests and 300 new leads an hour per business. A key stops working if it is revoked or its creator is no longer an owner or admin.