Production API β€” v1

ECODrIx API Documentation

The complete backend powering multi-tenant SaaS applications with CRM, automations, WhatsApp messaging, Google Meet scheduling, email marketing, lead scoring, AI-powered lead generation, and more β€” all via a single unified API.

πŸ“Š

CRM Engine

Leads, pipelines, scoring, activities, and deal tracking for any business.

⚑

Automations

Event-driven rules, delayed actions, multi-step workflows, and sequences.

πŸ’¬

WhatsApp

Template messaging, broadcasts, incoming webhooks, and two-way chat.

πŸ“§

Email Marketing

Template campaigns, open/click tracking, unsubscribe, and SES integration.

πŸ“Ή

Google Meet

Auto-create meetings, reminders at 1h/15min before, reschedule & cancel.

πŸ€–

LAIE AI Engine

Web scraping, lead enrichment, competitor analysis, and AI-driven outreach.

πŸ”

Multi-Tenant

Per-tenant DB isolation, API key auth, usage metering, and rate limiting.

πŸ“¦

Job Queue

Distributed task processing via erix-store with priority, retries, and DLQ.

Authentication

All API requests require two headers for tenant identification and authorization:

x-api-key: your_api_key_here
x-client-code: ERIX_CLNT_XXXXXX

The x-client-code header identifies your tenant. The x-api-key authenticates the request. Both are issued during onboarding.

Base URL & routing. Every endpoint lives under a single canonical prefix β€” /v1/api β€” organised by domain: /v1/api/platform/* (billing, auth, admin), /v1/api/product/erix/* (CRM, automations, chat, commerce), /v1/api/product/laie/* (lead-gen engine), and /v1/api/infra/* (connect channels, storage, webhooks). The system health dashboard is the one exception, served at the root /health.

Rate limits: 100 req/min per tenant (burst: 200). Exceeding returns HTTP 429.

Quick Start

Install the official SDK to get started in seconds:

npm install @ecodrix/erix-api
import { ErixAPI } from '@ecodrix/erix-api';

const erix = new ErixAPI({
  baseUrl: 'https://api.ecodrix.com',
  apiKey: 'your_api_key',
  clientCode: 'ERIX_CLNT_XXXXXX',
});

// Create a lead
const lead = await erix.crm.leads.create({
  firstName: 'John',
  phone: '+919876543210',
  source: 'website',
});

// Fire an automation trigger
await erix.crm.automations.trigger({
  trigger: 'order_created',
  phone: '+919876543210',
  variables: { orderId: 'ORD-001', amount: '999' },
  createLeadIfMissing: true,
});

Leads

Full lifecycle management for contacts β€” create, update, move through pipelines, score, tag, archive, and convert.

POST /v1/api/product/erix/crm/leads
Create a new lead in the default pipeline. Triggers lead_created event for automation matching.
Param Type Required Description
firstName string βœ“ Contact's first name
phone string βœ“ E.164 phone number
email string Email address
source enum website, whatsapp, manual, product, service, doctor
pipelineId ObjectId Override default pipeline
POST /v1/api/product/erix/crm/leads/upsert
Smart ingestion β€” finds by phone, updates or creates. Handles pipeline routing, activity logging, and fires automations in one call. Ideal for forms and webhooks.
GET /v1/api/product/erix/crm/leads
Paginated, filterable list. Supports: status, pipelineId, stageId, source, tags, search, orderId, dateRange, sorting.
PATCH /v1/api/product/erix/crm/leads/:id/move
Move lead to a new pipeline stage. Fires stage_enter / stage_exit events for automation rules.
PATCH /v1/api/product/erix/crm/leads/:id/tags
Add or remove tags. Fires tag_added / tag_removed events.

Pipelines & Stages

Configure multiple sales funnels with custom stages. Each tenant can have unlimited pipelines (Sales, Support, Onboarding, etc.).

GET /v1/api/product/erix/crm/pipelines
List all pipelines with their stages, colors, and ordering.
POST /v1/api/product/erix/crm/pipelines
Create a new pipeline. A "New" stage is auto-created as the entry point.

Lead Scoring

Automatic engagement scoring based on activity density, response time, and deal progression. Configurable per tenant.

POST /v1/api/product/erix/crm/leads/:id/score
Force-recalculate a lead's score. Auto-fires score_refresh event if threshold crossed.
GET /v1/api/product/erix/crm/scoring
Get/set scoring weights β€” activity recency, response rate, deal value multipliers.

Activities & Notes

Log calls, emails, meetings, and internal notes against leads. Full activity timeline per contact.

POST /v1/api/product/erix/crm/leads/:id/activities
Add an activity (call, note, email, meeting) to a lead's timeline.
GET /v1/api/product/erix/crm/leads/:id/activities
Retrieve paginated activity timeline for a specific lead.

CRM Analytics

Conversion funnels, pipeline velocity, source attribution, and team performance metrics.

GET /v1/api/product/erix/crm/analytics
Dashboard stats β€” conversion rates, pipeline velocity, leads by source/stage, team metrics.

Automations β€” Rules & Triggers

The automation engine matches incoming events against configured rules and executes actions (WhatsApp, email, webhook, internal ops). Supports instant, delayed, and event-relative timing.

Supported Triggers

Action Types

Timing Modes

POST /v1/api/product/erix/events/trigger
Fire an event into the automation engine. Resolves leads, matches rules, and executes actions. Supports delayMinutes and runAt for scheduled execution.
Param Type Required Description
trigger string βœ“ Event name (e.g. "order_created")
phone string βœ“ Lead's phone number
variables object Key/value context for template resolution
createLeadIfMissing boolean Auto-create lead if not found
delayMinutes number Defer execution by N minutes
runAt ISO string Schedule for exact time
GET /v1/api/product/erix/crm/automations
List all configured automation rules.
POST /v1/api/product/erix/crm/automations
Create a new automation rule with trigger, conditions, and actions.

Workflows

Multi-step automation flows with branching logic, delays, and conditional actions.

GET /v1/api/product/erix/crm/workflows
List all workflows with step counts and status.
POST /v1/api/product/erix/crm/workflows
Create a multi-step workflow with triggers, delays, conditions, and actions.

Sequences

Time-based drip sequences for nurturing leads over days/weeks.

POST /v1/api/product/erix/crm/sequences
Create a drip sequence with steps, delays, and exit conditions.
POST /v1/api/product/erix/crm/sequences/:id/enroll
Enroll a lead into a sequence by phone number.

Custom Events

Define and manage custom event triggers that your application can fire to invoke automations.

GET /v1/api/product/erix/crm/custom-events
List all registered custom event definitions.
POST /v1/api/product/erix/crm/custom-events
Register a new custom event trigger with schema and description.

WhatsApp

Send template messages, manage broadcasts, receive inbound webhooks, and power two-way conversations via the WhatsApp Business API.

POST /v1/api/infra/connect/send/whatsapp
Send a WhatsApp template message to a phone number with variable substitution.
POST /v1/api/infra/connect/broadcast/whatsapp
Broadcast a template message to multiple recipients. Queued and rate-limited per Meta's API.
GET /v1/api/infra/connect/whatsapp/templates
List approved WhatsApp message templates from your WABA.
POST /v1/api/infra/connect/whatsapp/webhook
Incoming webhook receiver for WhatsApp message status updates and inbound messages.

Email & Marketing

Send transactional and marketing emails via Amazon SES with open/click tracking, unsubscribe management, and template support.

POST /v1/api/infra/connect/send/email
Send a single email (transactional or marketing) with template variable resolution.
POST /v1/api/infra/connect/broadcast/email
Broadcast an email campaign to a segment. Supports scheduling and deduplication.
GET /v1/api/infra/connect/email/templates
List email templates with subject, body preview, and usage stats.

Notifications

In-app and push notifications for team members β€” new leads, assignments, reminders, and system alerts.

GET /v1/api/product/erix/notifications
Fetch paginated notifications for the authenticated user.
PATCH /v1/api/product/erix/notifications/read
Mark notifications as read (bulk or individual).

Google Meet

Schedule, reschedule, and cancel Google Meet meetings. Automatic calendar event creation with meet links.

POST /v1/api/product/erix/meetings
Create a Google Meet meeting with attendees, time, and auto-generated meet link.
PATCH /v1/api/product/erix/meetings/:id/reschedule
Reschedule an existing meeting. Fires meeting.rescheduled event.
DELETE /v1/api/product/erix/meetings/:id
Cancel a meeting and notify attendees.

Smart Reminders

Automatic reminders at 1 hour and 15 minutes before meetings via WhatsApp or email. Configurable per automation rule.

GET /v1/api/product/erix/meetings/reminders
List pending reminders for upcoming meetings.

Media & Storage

Upload and manage files (images, documents, videos) with S3-backed storage and CDN delivery.

POST /v1/api/infra/media/upload
Upload a file (multipart/form-data). Returns CDN URL and metadata.
GET /v1/api/infra/media
List uploaded media with pagination, filtering by type and date.
DELETE /v1/api/infra/media/:id
Delete a media file from storage.

Checkout & Payments

Generate payment links, track transactions, and handle Razorpay/Stripe webhooks for payment confirmation.

POST /v1/api/product/erix/commerce/checkout
Create a checkout session / payment link for a lead.
GET /v1/api/product/erix/commerce/transactions
List payment transactions with status, amount, and lead association.

Job Queue

Distributed task processing with priority levels, retry policies, dead-letter queues, and real-time status tracking.

GET /v1/api/infra/queue/status
Queue health β€” pending, active, completed, failed counts per queue name.
GET /v1/api/infra/queue/dlq
List dead-letter queue entries for failed jobs with error details.

Health & Monitoring

System health checks, dependency status, and uptime monitoring.

GET /health
Full system health dashboard β€” DB, Redis, queues, external APIs, uptime.

LAIE β€” Lead Generation

AI-powered web scraping, lead enrichment, and competitor analysis for automated outbound prospecting.

POST /v1/api/product/laie/scrape
Submit a scraping job for lead discovery from web sources.
POST /v1/api/product/laie/enrich
Enrich existing leads with additional data from public sources.
GET /v1/api/product/laie/jobs
List LAIE processing jobs with status, results count, and errors.

LAIE β€” AI & Intelligence

AI-driven insights β€” competitor analysis, message generation, and intelligent lead prioritization.

POST /v1/api/product/laie/ai/analyze
Run AI analysis on a lead or competitor β€” generates insights and recommended actions.
POST /v1/api/product/laie/ai/generate-message
Generate a personalized outreach message for a lead using AI.

LAIE β€” Voice & Transcription

Voice call recording, transcription, and AI summarization for sales calls.

POST /v1/api/product/laie/voice/transcribe
Submit a voice recording for transcription and AI summary.
GET /v1/api/product/laie/voice/transcriptions
List completed transcriptions with summaries and action items.

API Explorer

Try any endpoint directly from the browser. Provide your API key and client code to make live requests.

// Response will appear here