Structured documentation for AI agents, LLM tools, and SDK integrations. All endpoints return JSON and support CORS.
http://localhost:5000. All responses use Content-Type: application/json.
Provides a chronological list of all user actions within the platform. Used for the Recent Activity dashboard widget. Each activity record captures who performed the action, what they did, which deal or account it relates to, and when it happened.
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | all | Maximum number of activity records to return |
| offset | integer | 0 | Number of records to skip (for pagination) |
| type | string | all | Filter by activity type. Values: deal, call, email, meeting, note |
| user | string | — | Filter by user name (partial, case-insensitive match) |
{
"total": 12, // Total matching records
"offset": 0,
"limit": 5,
"data": [
{
"id": "act-001", // Unique activity ID
"type": "deal", // Activity category: deal | call | email | meeting | note
"user": "Sarah Miller", // The person who performed the action (actor)
"userRole": "Account Executive", // Role of the actor
"action": "moved", // Verb describing the action
"target": "Enterprise Bundle", // The object acted upon (deal name, company, etc.)
"detail": "Moved to Proposal stage", // Human-readable description
"timestamp": "2026-02-10T14:45:00Z", // ISO 8601 timestamp
"relatedDealId": "deal-1", // Foreign key to Sales API
"relatedAccountId": "acc-001" // Foreign key to Accounts API
}
]
}
GET /api/v1/activity?limit=5 — Latest 5 activities
GET /api/v1/activity?type=call&user=Mike — All calls by Mike
Returns customer/prospect account records including contract details, health scores, usage metrics, and ownership. This is the central reference for all account-level data in the CRM.
| Parameter | Type | Default | Description |
|---|---|---|---|
| id | string | — | Return a single account by ID (e.g., acc-001) |
| tier | string | all | Filter by tier. Values: Enterprise, Mid-Market, SMB |
| industry | string | — | Filter by industry (partial, case-insensitive match) |
| owner | string | — | Filter by account owner name (partial, case-insensitive match) |
| renewalStatus | string | all | Filter by renewal status. Values: auto-renew, pending, at-risk, prospect |
| minHealth | integer | — | Only return accounts with health score >= this value (0-100) |
{
"total": 7,
"data": [
{
"id": "acc-001",
"name": "Meridian Technologies", // Company name
"industry": "Enterprise Software", // Industry vertical
"tier": "Enterprise", // Account tier: Enterprise | Mid-Market | SMB
"annualRevenue": 285000, // Annual contract value in USD
"contractStart": "2025-03-15", // Contract start date (null if prospect)
"contractEnd": "2026-03-14", // Contract end date
"renewalStatus": "auto-renew", // auto-renew | pending | at-risk | prospect
"healthScore": 92, // Account health 0-100 (null for prospects)
"primaryContact": "Janet Williams", // Main contact person name
"primaryContactEmail": "j.williams@meridiantech.com",
"primaryContactRole": "VP of Engineering",
"owner": "Sarah Miller", // Sales rep who owns this account
"activeUsers": 148, // Users who logged in recently
"licensedUsers": 200, // Total licensed seats
"lastLoginDate": "2026-02-10", // Most recent login from this account
"openDeals": 1, // Number of active deals
"totalDealsWon": 3, // Historical closed-won deals
"lifetimeValue": 712000 // Total revenue from this account (USD)
}
]
}
GET /api/v1/accounts?tier=Enterprise — All enterprise accounts
GET /api/v1/accounts?renewalStatus=at-risk — At-risk accounts
GET /api/v1/accounts?id=acc-002 — Single account lookup
Provides aggregated analytics and performance metrics across the entire sales organization. Includes summary KPIs, revenue trends, pipeline breakdown by stage, per-rep performance, and top industries. Used for dashboard widgets and reporting views.
| Parameter | Type | Default | Description |
|---|---|---|---|
| section | string | all | Return only a specific section. Values: summary, revenueByMonth, dealsByStage, performanceByRep, topIndustries |
{
"data": {
"summary": {
"totalRevenue": 1284500, // Total revenue YTD (USD)
"revenueChangePercent": 12.5, // % change vs. prior period
"dealsWon": 47, // Total closed-won deals
"dealsWonChange": 8, // Absolute change from last quarter
"pipelineValue": 3420000, // Total open pipeline (USD)
"pipelineChangePercent": -3.2, // % change (negative = shrinking)
"winRate": 34, // Win rate as percentage
"winRateChange": 2.1, // % point change from prior period
"avgDealSize": 27330, // Average deal size (USD)
"avgSalesCycle": 42, // Average days to close
"totalAccounts": 7,
"activeAccounts": 6
},
"revenueByMonth": [ // Monthly revenue breakdown
{ "month": "2025-09", "revenue": 142000, "deals": 5 }
],
"dealsByStage": [ // Pipeline distribution
{ "stage": "Prospecting", "count": 12, "value": 540000 }
],
"performanceByRep": [ // Per-rep performance metrics
{
"rep": "Sarah Miller",
"role": "Account Executive",
"dealsWon": 18,
"revenue": 524000,
"winRate": 42,
"avgCycleTime": 38 // Days to close
}
],
"topIndustries": [ // Revenue by industry
{ "industry": "Cloud Infrastructure", "revenue": 420000, "accounts": 1 }
]
}
}
GET /api/v1/analytics — Full analytics payload
GET /api/v1/analytics?section=summary — Only KPI summary
GET /api/v1/analytics?section=performanceByRep — Rep leaderboard data
Returns the complete pipeline of sales deals with full detail. Each deal includes the associated account, owner, products, stage, value, probability, and competitive intelligence. This is the primary data source for the deals table in the dashboard.
| Parameter | Type | Default | Description |
|---|---|---|---|
| id | string | — | Return a single deal by ID (e.g., deal-1) |
| stage | string | all | Filter by stage. Values: Prospecting, Discovery, Proposal, Negotiation |
| owner | string | — | Filter by deal owner name (partial, case-insensitive match) |
| minValue | integer | — | Only deals with value >= this amount (USD) |
| maxValue | integer | — | Only deals with value <= this amount (USD) |
| hasCompetitor | string | — | Filter by competitor presence. Values: true, false |
| sortBy | string | — | Sort field name (e.g., value, probability, expectedCloseDate) |
| sortOrder | string | desc | Sort direction: asc or desc |
{
"total": 7,
"data": [
{
"id": "deal-1",
"name": "Enterprise Bundle", // Deal name
"accountId": "acc-001", // Foreign key to Accounts API
"accountName": "Meridian Technologies", // Account name (denormalized)
"value": 145000, // Deal value in USD
"stage": "Proposal", // Current stage in pipeline
"probability": 65, // Win probability as percentage
"owner": "Sarah Miller", // Sales rep who owns this deal
"ownerRole": "Account Executive",
"createdDate": "2025-11-20", // When deal was created
"expectedCloseDate": "2026-03-15", // Target close date
"lastActivity": "2026-02-10", // Most recent activity date
"daysInStage": 14, // Days in current stage
"totalDaysOpen": 82, // Total days since creation
"contactName": "Janet Williams", // Primary contact for this deal
"contactRole": "VP of Engineering",
"products": ["Platform License", "Analytics Module"], // Products in this deal
"competitorPresent": false, // Is a competitor involved?
"notes": "Strong champion, budget approved Q1" // Internal notes
}
]
}
GET /api/v1/sales?stage=Negotiation — Deals in negotiation
GET /api/v1/sales?minValue=100000&sortBy=value&sortOrder=desc — High-value deals
GET /api/v1/sales?hasCompetitor=true — Competitive deals
GET /api/v1/sales?id=deal-3 — Single deal lookup
Returns the product catalog of available platform modules, including pricing, features, install counts, and availability status. Useful for understanding which modules are included in deals and for product-aware customizations.
| Parameter | Type | Default | Description |
|---|---|---|---|
| id | string | — | Return a single module by ID (e.g., mod-analytics) |
| category | string | all | Filter by category. Values: Core, Intelligence, Productivity, Integration, Services |
| status | string | all | Filter by availability. Values: generally-available, beta |
| isBase | string | — | Filter by base module flag. Values: true, false |
{
"total": 8,
"data": [
{
"id": "mod-analytics",
"name": "Analytics Module", // Module display name
"category": "Intelligence", // Core | Intelligence | Productivity | Integration | Services
"description": "Advanced analytics with...", // What this module does
"monthlyPrice": 800, // Monthly price in USD (null if one-time)
"annualPrice": 8640, // Annual price in USD (null if one-time)
"isBase": false, // true = required core module
"features": ["Custom Dashboards", "..."], // Feature list
"activeInstalls": 4, // Number of accounts using this
"maxUsers": "Unlimited", // User limit per install
"status": "generally-available" // generally-available | beta
}
]
}
GET /api/v1/modules?category=Intelligence — AI and analytics modules
GET /api/v1/modules?status=beta — Beta-only modules
GET /api/v1/modules?isBase=true — Core required modules
relatedDealId and to Accounts via relatedAccountId. Sales deals link to Accounts via accountId. Sales deals reference Modules by name in the products array.
Usivity Mock API Documentation v1.0 — Generated for AI-assisted SDK development