NextGen Digital Studio API
All endpoints return JSON with { ok: boolean }. Base URL: https://nextgendigitalstudio.com. All POST endpoints require a JSON body with Content-Type: application/json.
/api/contactSubmit Contact Form
Capture a lead from the website contact form.
{
"name": "Tanvir Ahmed",
"email": "tanvir@example.com",
"phone": "+8801712345678",
"company": "Dhaka Realty",
"service": "AI Chat Agent",
"message": "Interested in automation"
}{
"ok": true,
"id": "cmqy..."
}/api/book-callBook Strategy Call
Book a free strategy call. Also creates a lead with source='strategy_call'.
{
"name": "Nusrat Jahan",
"email": "nusrat@hospital.com",
"phone": "+8801812345678",
"service": "AI Voice Agent",
"date": "2025-02-15",
"message": "Want to automate appointments"
}{
"ok": true,
"id": "cmqy..."
}/api/newsletterNewsletter Subscribe
Subscribe an email to the newsletter. Upserts by email.
{ "email": "subscriber@example.com" }{
"ok": true,
"id": "cmqy..."
}/api/chat-agentAI Chat Agent
Send a message to the NextGen AI assistant (GPT-class). Returns a context-aware reply. Bilingual Bangla/English.
{
"message": "What services do you offer?",
"messages": [
{ "role": "user", "content": "Hi" },
{ "role": "assistant", "content": "Hello! How can I help?" }
]
}{
"ok": true,
"reply": "We offer AI Sales Automation..."
}/api/chat-saveSave Chat Conversation
Persist a chat conversation by sessionId. Auto-detects email/phone/name from user messages to create leads.
{
"sessionId": "chat_123_abc",
"messages": [
{ "role": "user", "content": "My email is rahman@test.com" }
]
}{
"ok": true,
"conversationId": "cmqy...",
"leadId": "cmqy...",
"detected": { "email": "rahman@test.com" }
}/api/auditAI Audit Tool
Submit the free AI audit quiz results. Saves a lead with source='ai_audit_tool'.
{
"name": "Rakib Hasan",
"email": "rakib@example.com",
"phone": "+8801912345678",
"industry": "Real Estate",
"score": 55,
"responses": ["response=8", "automation=15"]
}{ "ok": true, "id": "cmqy...", "score": 55 }/api/downloadFree Resource Download
Capture a lead when downloading a free resource. Source='free_tools_download'.
{
"name": "Farhana Karim",
"email": "farhana@example.com",
"resource": "CRM Automation Checklist"
}{ "ok": true, "id": "cmqy..." }/api/careersJob Application
Submit a job application. Saves a lead with source='careers_application'.
{
"name": "Sajid Rahman",
"email": "sajid@example.com",
"role": "AI Engineer",
"portfolio": "https://github.com/sajid",
"message": "5 years AI experience"
}{ "ok": true, "id": "cmqy..." }/api/leadsList Leads
Fetch leads with optional source/status filters. Returns leads + aggregate stats.
{
"ok": true,
"stats": { "total": 8, "conversations": 0, ... },
"leads": [ { "id": "cmqy...", "name": "...", ... } ]
}/api/leads/[id]Update Lead
Update a lead's status, notes, and/or assignedTo.
{
"status": "qualified",
"notes": "Called, interested",
"assignedTo": "Sales Executive"
}{ "ok": true, "lead": { "id": "cmqy...", ... } }/api/leads/[id]Delete Lead
Permanently delete a lead.
{ "ok": true }/api/leads/exportExport Leads (CSV)
Download all leads (filtered) as a CSV file. Supports source & status query params.
Content-Type: text/csv
Content-Disposition: attachment; filename="nextgen-leads-2025-01-15.csv"
Name,Email,Phone,Company,Service,Source,Status,...
Tanvir,tanvir@example.com,...Webhooks (Coming Soon)
Webhook support for real-time lead notifications is on our roadmap. Subscribe to new lead events and get instant POST callbacks to your URL.
NextGen Digital Studio · API Documentation · Built for developers