Guides & reference

Put the bot anywhere. Connect it to everything.

Add the chat to any website in two minutes, drive it from your own buttons, and send every lead, conversation and call into your CRM with a REST API and signed webhooks.

1. Put the bot on your website

Get your code from Dashboard → Website chat → Copy code. It already has your key in it. It looks like this:

<script>
  (function(w,d){
    w.ProphBotConfig = { apiKey: "YOUR_PUBLIC_KEY", baseUrl: "https://prophecius.in" };
    var s=d.createElement('script'); s.src=w.ProphBotConfig.baseUrl+"/widget/widget.js"; s.async=true;
    (d.body||d.head||d.documentElement).appendChild(s);
  })(window, document);
</script>

Paste it once, on every page (a shared footer is easiest). It loads after your page, so it never slows it down. Then use Dashboard → Website chat → Check my site to confirm it is live.

Any website (HTML)⌄
  1. Open the HTML of every page, or the shared footer file.
  2. Paste the code just before the closing </body> tag.
  3. Save and upload. The chat bubble appears in the bottom corner.
WordPress⌄
  1. Plugins → Add New → search “WPCode” (free) → Install → Activate.
  2. Code Snippets → Header & Footer → paste the code in “Footer”.
  3. Save Changes.
  4. Without a plugin: Appearance → Theme File Editor → footer.php → paste above </body>. (A theme update can undo this, so the plugin is safer.)
Elementor⌄
  1. Elementor → Custom Code → Add New.
  2. Paste the code, set Location to “</body> - End”.
  3. Publish, and choose “Entire Site” as the condition.
Shopify⌄
  1. Online Store → Themes → ⋯ next to your live theme → Edit code.
  2. Open layout/theme.liquid and find </body> near the bottom.
  3. Paste the code just above it and Save.
Wix⌄
  1. Settings → Custom Code (under Advanced) → + Add Custom Code.
  2. Paste the code, choose “All pages” and place it in “Body - end”.
  3. Apply, then Publish the site. (Custom code needs a Wix premium plan with a connected domain.)
Squarespace⌄
  1. Settings → Advanced → Code Injection.
  2. Paste the code into “Footer”.
  3. Save. (Code Injection needs a Business plan or higher.)
Webflow⌄
  1. Site settings → Custom code.
  2. Paste the code into “Footer code”.
  3. Save, then Publish.
GoDaddy Website Builder⌄
  1. Edit site → Add section → search “HTML” → add the HTML section to the footer.
  2. Paste the code and click Done.
  3. Publish.
Framer⌄
  1. Site settings → General → Custom Code.
  2. Paste the code in “End of <body> tag”.
  3. Publish.
Zoho Sites⌄
  1. Settings → SEO / Header & Footer code (or Page settings → Footer code).
  2. Paste the code in the footer section.
  3. Publish.
Blogger⌄
  1. Theme → ⋮ → Edit HTML.
  2. Find </body> and paste the code just above it.
  3. Save.
Google Tag Manager⌄
  1. Tags → New → Tag type “Custom HTML”.
  2. Paste the code. Trigger: “All Pages”.
  3. Save, then Submit and Publish the container.
React⌄
  1. Load it once, when the app starts.
import { useEffect } from 'react';

export function ProphBot() {
  useEffect(() => {
    if (document.getElementById('prophbot')) return;
    (window as any).ProphBotConfig = { apiKey: 'YOUR_PUBLIC_KEY', baseUrl: 'https://prophecius.in' };
    const s = document.createElement('script');
    s.id = 'prophbot'; s.src = 'https://prophecius.in/widget/widget.js'; s.async = true;
    document.body.appendChild(s);
  }, []);
  return null;
}
Next.js⌄
  1. Add it to app/layout.tsx (or pages/_app.tsx).
import Script from 'next/script';

// inside <body>, after {children}:
<Script id="prophbot-config" strategy="afterInteractive">
  {`window.ProphBotConfig = { apiKey: "YOUR_PUBLIC_KEY", baseUrl: "https://prophecius.in" };`}
</Script>
<Script src="https://prophecius.in/widget/widget.js" strategy="afterInteractive" />
Vue, Angular, Svelte⌄
  1. Paste the code into public/index.html (or src/index.html), just before </body>.
  2. Rebuild and deploy.
Mobile app (Android, iOS, Flutter)⌄
  1. Host a one-line page with the code on your site, for example yoursite.com/chat.
  2. Open that page in a WebView. Allow the microphone in the WebView if you want voice calls.
  3. Or skip the widget and use POST /api/v1/chat from your app for a fully native chat screen.

Only on some pages

Wrap the code so it only loads where you want it, for example only on pages under /products:

<script>
  if (location.pathname.startsWith('/products')) {
    /* paste the inside of your code here */
  }
</script>

It doesn't show?

  • Clear your site's cache (WP Rocket, LiteSpeed, Cloudflare) and your browser's, then reload.
  • The bot must be switched on in Dashboard → My bots.
  • A strict Content-Security-Policy must allow https://prophecius.in in script-src and connect-src.
  • Voice calls need https and Chrome, Edge or Safari. The microphone permission is asked on the first call.

2. Control it from your page

Once the code is on the page, window.ProphBot lets your own buttons drive the chat. Calls made before it has loaded are remembered and run as soon as it is ready.

<button onclick="ProphBot.open()">Chat with us</button>
<button onclick="ProphBot.ask('What does delivery cost?')">Delivery prices</button>
<button onclick="ProphBot.call()">Talk to us now</button>

<script>
  ProphBot.close();          // close the chat
  ProphBot.toggle();         // open if closed, close if open
  ProphBot.isOpen();         // true or false
  window.addEventListener('prophbot:ready', () => { /* the widget has loaded */ });
  prophVerifyPhone('+919876543210');  // ask the visitor to confirm their number
</script>

3. REST API

For CRMs, back offices and apps. Base address https://prophecius.in/api/v1. Every call needs your account API key (Dashboard → Developers / API; plans with API access):

Authorization: Bearer pb_YOUR_ACCOUNT_KEY
JSON in, JSON out. Errors come back as { "error": "..." } with a clear message and the usual status codes.
Paging. Lists are newest first. Pass next_before from one page as before to get the next.
Limits. 120 requests a minute per account. Keep the key on your server, never in a web page.

Import everything into Postman or Insomnia, or generate a client in any language, from the OpenAPI file: https://prophecius.in/api/v1/openapi.json

Account

GET/api/v1/me· Your account and plan

Checks the key works, and returns the plan and its limits.

curl "https://prophecius.in/api/v1/me" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Bots

GET/api/v1/bots· List your bots

`public_key` is the key used by the website widget and the chat endpoint.

curl "https://prophecius.in/api/v1/bots" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
GET/api/v1/bots/{bot_id}· One bot
bot_id*integer · pathThe bot
curl "https://prophecius.in/api/v1/bots/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Leads

GET/api/v1/leads· List leads

People who want to buy or book: from chats, forms, calls and the API. Newest first.

statusstring · querynew, contacted, won or lost
bot_idinteger · queryOnly this bot
sincestring · queryISO date: only leads created on or after it
updated_sincestring · queryISO date: only leads changed on or after it. Handy for two-way CRM sync.
limitinteger · queryHow many to return, 1 to 200. Default 50.
beforeinteger · queryPaging: return items older than this id. Use `next_before` from the previous page.
curl "https://prophecius.in/api/v1/leads" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
GET/api/v1/leads/{lead_id}· One lead
lead_id*integer · pathThe lead
curl "https://prophecius.in/api/v1/leads/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
POST/api/v1/leads· Create a lead

For leads that start outside the bot (your CRM, an ad form). You get the usual alerts, and `lead.created` fires.

bot_id*integer · bodyWhich bot it belongs to
namestring · bodyTheir name
phonestring · bodyPhone or WhatsApp number
emailstring · bodyEmail address
companystring · bodyCompany
messagestring · bodyWhat they want
sourcestring · bodyWhere it came from, e.g. "crm" or "facebook_ads". Default "api".
curl -X POST "https://prophecius.in/api/v1/leads" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bot_id":12,"name":"Priya Sharma","phone":"+91 98765 43210","message":"Wants a birthday cake for Saturday","source":"crm"}'
PATCH/api/v1/leads/{lead_id}· Update a lead

Change its status or details, for example when the deal moves in your CRM. `lead.updated` fires.

lead_id*integer · pathThe lead
statusstring · bodynew, contacted, won or lost
notesstring · bodyYour notes
namestring · bodyName
phonestring · bodyPhone
emailstring · bodyEmail
companystring · bodyCompany
curl -X PATCH "https://prophecius.in/api/v1/leads/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"won","notes":"Paid in full, delivery Saturday 5 pm"}'

Customers

GET/api/v1/customers· List customers

Everyone who has talked to your bots, on any channel. Newest activity first.

searchstring · queryMatches name, phone or email
bot_idinteger · queryOnly this bot
channelstring · querywebsite, whatsapp, telegram or api
active_sincestring · queryISO date: seen on or after it
limitinteger · queryHow many to return, 1 to 200. Default 50.
beforeinteger · queryPaging: return items older than this id. Use `next_before` from the previous page.
curl "https://prophecius.in/api/v1/customers" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
GET/api/v1/customers/{customer_id}· One customer, with their conversations
customer_id*integer · pathThe customer
curl "https://prophecius.in/api/v1/customers/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
PATCH/api/v1/customers/{customer_id}· Update a customer

Keep names, numbers and tags in step with your CRM. `tags` replaces the whole list.

customer_id*integer · pathThe customer
namestring · bodyName
phonestring · bodyPhone
emailstring · bodyEmail
tagsstring[] · bodyTags, e.g. ["vip","wholesale"]
curl -X PATCH "https://prophecius.in/api/v1/customers/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Priya Sharma","tags":["vip","repeat-buyer"]}'

Conversations

GET/api/v1/conversations· List conversations

Status is open (the bot is answering), needs_you (it needs a person), human (a person is replying) or resolved.

statusstring · queryopen, needs_you, human or resolved
bot_idinteger · queryOnly this bot
channelstring · querywebsite, whatsapp, telegram or api
sincestring · queryISO date: last message on or after it
limitinteger · queryHow many to return, 1 to 200. Default 50.
beforeinteger · queryPaging: return items older than this id. Use `next_before` from the previous page.
curl "https://prophecius.in/api/v1/conversations" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
GET/api/v1/conversations/{conversation_id}· One conversation with its messages

Messages oldest first. `sender` is customer, bot, agent (a person) or system.

conversation_id*integer · pathThe conversation
curl "https://prophecius.in/api/v1/conversations/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
POST/api/v1/conversations/{conversation_id}/reply· Reply as a person

Sends your message to the customer on their channel and pauses the bot in this chat. The bot takes over again after 30 minutes of silence from you.

conversation_id*integer · pathThe conversation
message*string · bodyWhat to send
curl -X POST "https://prophecius.in/api/v1/conversations/123/reply" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hi Priya, your cake is confirmed for Saturday 5 pm."}'
POST/api/v1/conversations/{conversation_id}/close· Mark a conversation resolved
conversation_id*integer · pathThe conversation
curl -X POST "https://prophecius.in/api/v1/conversations/123/close" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Chat

POST/api/v1/chat· Ask the bot

Put your bot inside anything: an app, a CRM screen, a kiosk. Use the same `customer_ref` for the same person and the bot remembers the conversation. Shows in your dashboard under the "api" channel.

bot_id*integer · bodyWhich bot answers
customer_ref*string · bodyYour id for this person (a CRM contact id, a phone number). Up to 120 characters.
message*string · bodyWhat they said
namestring · bodyTheir name, if you know it
phonestring · bodyTheir phone, if you know it
emailstring · bodyTheir email, if you know it
curl -X POST "https://prophecius.in/api/v1/chat" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bot_id":12,"customer_ref":"crm-contact-8812","message":"Do you deliver to Kothrud?","name":"Priya"}'

Calls

GET/api/v1/calls· Voice call log
daysinteger · queryHow far back, 1 to 365. Default 30.
bot_idinteger · queryOnly this bot
limitinteger · query1 to 200. Default 50.
curl "https://prophecius.in/api/v1/calls" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Forms

GET/api/v1/forms· List forms
curl "https://prophecius.in/api/v1/forms" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
GET/api/v1/forms/{form_id}/submissions· Form submissions
form_id*integer · pathThe form
sincestring · queryISO date: submitted on or after it
limitinteger · queryHow many to return, 1 to 200. Default 50.
beforeinteger · queryPaging: return items older than this id. Use `next_before` from the previous page.
curl "https://prophecius.in/api/v1/forms/123/submissions" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Knowledge

GET/api/v1/bots/{bot_id}/knowledge· What a bot has been taught
bot_id*integer · pathThe bot
curl "https://prophecius.in/api/v1/bots/123/knowledge" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
POST/api/v1/bots/{bot_id}/knowledge· Teach a bot

Add a web page, some text, or a question and its answer. It is read in the background; `status` goes pending, processing, ready. Counts toward your plan's limit.

bot_id*integer · pathThe bot
type*string · bodyurl, text or faq
urlstring · bodyFor type url: the page address
titlestring · bodyFor text: a short name
textstring · bodyFor type text: the text itself (up to 200,000 characters)
questionstring · bodyFor type faq
answerstring · bodyFor type faq
curl -X POST "https://prophecius.in/api/v1/bots/123/knowledge" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"faq","question":"Do you deliver on Sundays?","answer":"Yes, 9 am to 6 pm, free above 1,000 rupees."}'
DELETE/api/v1/bots/{bot_id}/knowledge/{source_id}· Forget something
bot_id*integer · pathThe bot
source_id*integer · pathThe source
curl -X DELETE "https://prophecius.in/api/v1/bots/123/knowledge/123" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Follow-ups

GET/api/v1/follow-ups· Follow-up messages

Messages the bot wrote to leads that went quiet: drafts, approved, sent, skipped.

curl "https://prophecius.in/api/v1/follow-ups" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

Webhooks

GET/api/v1/webhook· Your webhook settings
curl "https://prophecius.in/api/v1/webhook" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"
PUT/api/v1/webhook· Set your webhook

Where to POST events, and which ones. Use ["*"] for everything. The response includes the signing secret; keep it safe.

url*string · bodyYour https address. Empty string turns webhooks off.
eventsstring[] · bodyEvents to send, or ["*"]. Default ["*"].
curl -X PUT "https://prophecius.in/api/v1/webhook" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://crm.example.com/hooks/prophecius","events":["lead.created","lead.updated","call.ended"]}'
POST/api/v1/webhook/test· Send a test event
eventstring · bodyWhich event to imitate. Default lead.created.
curl -X POST "https://prophecius.in/api/v1/webhook/test" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
POST/api/v1/webhook/rotate-secret· New signing secret

The old secret stops working at once.

curl -X POST "https://prophecius.in/api/v1/webhook/rotate-secret" \
  -H "Authorization: Bearer pb_YOUR_ACCOUNT_KEY"

4. Webhooks

Instead of asking the API every few minutes, let us tell you. Set a URL in Dashboard → Developers / API (or PUT /api/v1/webhook), pick the events, and we POST each one the moment it happens.

lead.createdA new lead: from the chat, a form, a call, or created through the API.
lead.updatedA lead changed status (new, contacted, won, lost) or its details changed.
lead.deletedLeads were moved to the trash, or deleted for good (permanent: true).
lead.restoredLeads were brought back from the trash.
conversation.deletedChats were deleted for good by the owner.
customer.deletedPeople were deleted for good by the owner, with their chats.
form.submittedSomeone filled in one of your bot's forms.
conversation.needs_humanA conversation or call needs a person: the bot could not help, or the customer asked for someone.
call.endedA voice call with your bot ended. Includes length, questions asked and how it ended.

Every delivery looks like this:

POST https://your-crm.example.com/hooks/prophecius
X-Prophecius-Event: lead.created
X-Prophecius-Timestamp: 1727170000
X-Prophecius-Signature: sha256=5f2b...

{
  "id": "evt_8c1d...",
  "event": "lead.created",
  "created_at": "2026-09-24T10:15:00.000Z",
  "test": false,
  "data": { "id": 481, "bot_id": 12, "name": "Priya Sharma", "phone": "+91 98765 43210", "message": "Birthday cake for Saturday", "source": "bot_form" }
}

Check it really came from us

Compute an HMAC-SHA256 of timestamp + "." + raw body with your signing secret and compare it with the header. Reject anything older than five minutes.

// Node.js (Express): use the raw body, not the parsed JSON
const crypto = require('crypto');
app.post('/hooks/prophecius', express.raw({ type: 'application/json' }), (req, res) => {
  const ts = req.get('X-Prophecius-Timestamp');
  const expected = 'sha256=' + crypto.createHmac('sha256', process.env.PROPHECIUS_SECRET).update(ts + '.' + req.body).digest('hex');
  const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.get('X-Prophecius-Signature') || ''));
  if (!ok || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(401);
  const event = JSON.parse(req.body);
  // ... save event.data to your CRM
  res.sendStatus(200);
});
<?php // PHP
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_PROPHECIUS_TIMESTAMP'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $body, getenv('PROPHECIUS_SECRET'));
if (!hash_equals($expected, $_SERVER['HTTP_X_PROPHECIUS_SIGNATURE'] ?? '') || abs(time() - (int)$ts) > 300) { http_response_code(401); exit; }
$event = json_decode($body, true);
// ... save $event['data']
http_response_code(200);
# Python (Flask)
import hmac, hashlib, time, os
@app.post('/hooks/prophecius')
def hook():
    ts = request.headers.get('X-Prophecius-Timestamp', '')
    expected = 'sha256=' + hmac.new(os.environ['PROPHECIUS_SECRET'].encode(), (ts + '.').encode() + request.get_data(), hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, request.headers.get('X-Prophecius-Signature', '')) or abs(time.time() - int(ts or 0)) > 300:
        return '', 401
    event = request.get_json()
    # ... save event['data']
    return '', 200

Answer with any 2xx within six seconds. If your server errors, we try once more two seconds later. Send a test from the dashboard, or POST /api/v1/webhook/test.

5. Connect a CRM without writing code

Zapier (HubSpot, Salesforce, Pipedrive, Zoho, 6,000+ apps)

  1. Create a Zap with trigger “Webhooks by Zapier → Catch Hook” and copy its URL.
  2. Paste that URL as your webhook in Dashboard → Developers / API, and send a test.
  3. Add an action: “HubSpot → Create Contact” (or any CRM), and map name, phone, email and message from the test.

Make.com or Pabbly Connect

  1. Add a “Custom webhook” module and copy its address.
  2. Paste it as your webhook and send a test so Make learns the fields.
  3. Add your CRM module and map the fields.

Google Sheets

  1. In a sheet, Extensions → Apps Script. Add a doPost(e) that appends JSON.parse(e.postData.contents).data to the sheet.
  2. Deploy → New deployment → Web app, access “Anyone”, and copy the URL.
  3. Paste it as your webhook. Every new lead becomes a row.

Your CRM pushing changes back

  1. Use PATCH /api/v1/leads/{id} when a deal moves, so the dashboard shows won or lost.
  2. Use POST /api/v1/leads for leads that start in your CRM, so the bot can follow them up.
  3. Use GET /api/v1/leads?updated_since=... for a scheduled two-way sync.