Docs / API reference

API reference 16 endpoints Workspace records

Calls, contacts, follow-ups, knowledge and integrations

Query call records, export full CSV reports, manage contacts and follow-ups, import public web pages into Knowledge and save integration setup details.

Calls and CSV export

GET /api/calls Session required · 200 OK

Returns paginated calls ordered newest first. Query parameters: limit (1 to 1000, default 200) and offset (>= 0, default 0).

curl -s -b cookies.txt "https://dhvani.aware.co.in/api/calls?limit=50&offset=0"
{"calls": [...], "total": 12, "offset": 0, "limit": 50}
GET /api/calls/{call_id} Session required · 200 OK

Returns a single call record including transcript and extracted fields, or 404 if not found.

POST /api/calls/{call_id}/follow-up Session required · 201 Created

Creates a pending follow-up from an existing call, pre-filling contact details and scheduling it 4 hours from now.

GET /api/export/calls.csv Session required · 200 OK (text/csv)

Exports every stored call as dhvani-calls.csv with formula-safe escaping and columns: id, caller_name, phone, agent_name, status, outcome, language, duration_seconds, started_at, service, area, preferred_time, callback_needed, summary, cost.

curl -s -b cookies.txt -o calls.csv https://dhvani.aware.co.in/api/export/calls.csv

Contacts

POST /api/contacts Session required · 201 Created

Creates a contact (`name` 1-100 chars, `phone` 5-30 chars, optional `tag`, `language`, `consent`, `notes`). Consent accepts inbound, opt_in, opt_out, existing_customer or unknown (plus common aliases like yes or opt-in).

POST /api/contacts/import Session required · 201 Created

Bulk-imports up to 5,000 contacts (`{"contacts": [...]}`), returning {"imported": N}.

Follow-ups

POST /api/followups Session required · 201 Created

Creates a pending follow-up (`contact_name`, `phone`, `reason`, optional ISO `due_at` parsed as IST if no offset is provided, optional `call_id`).

PATCH /api/followups/{followup_id} Session required · 200 OK

Updates follow-up status to "pending" or "done" (`422` for other values; `404` if missing).

Knowledge and URL import

GET /api/knowledge Session required · 200 OK

Lists all knowledge notes newest-updated first, including plain-text card previews.

POST /api/knowledge Session required · 201 Created

Creates a knowledge note (`title` 1-160 chars, `content` 1-50,000 chars, `source` default "note", `language` default "English", optional `agent_id`).

PATCH /api/knowledge/{knowledge_id} Session required · 200 OK

Partially updates a note. Pass {"agent_id": null} to share a note across all agents.

DELETE /api/knowledge/{knowledge_id} Session required · 204 No Content

Deletes the knowledge note.

POST /api/knowledge/preview-url Session required · 200 OK

Fetches a public URL (and optionally up to 6 same-site linked pages when include_linked_pages: true) and returns clean editable prose without saving it. Blocked, private or login-walled URLs return 422.

curl -s -b cookies.txt -X POST https://dhvani.aware.co.in/api/knowledge/preview-url \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.in/services","include_linked_pages":true}'
{
  "url": "https://example.in/services",
  "title": "Services",
  "content": "...",
  "platform": "website",
  "pages": ["https://example.in/services", "https://example.in/pricing"]
}

Integrations

GET /api/integrations Session required · 200 OK

Lists configuration state for all seven supported providers.

PUT /api/integrations/{provider} Session required · 200 OK

Saves setup notes for plivo, vobiz, exotel, whatsapp, google_sheets, zoho, or webhook (`404` for unknown providers). status must be "not_connected" or "configured" (`422`). Merges config fields onto previously saved keys.