Usivity Mock API Reference

Structured documentation for AI agents, LLM tools, and SDK integrations. All endpoints return JSON and support CORS.

Base URL: All endpoints are relative to the application host. In development, this is typically http://localhost:5000. All responses use Content-Type: application/json.

1. Recent Activity API

GET/api/v1/activity

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.

Query Parameters

ParameterTypeDefaultDescription
limitintegerallMaximum number of activity records to return
offsetinteger0Number of records to skip (for pagination)
typestringallFilter by activity type. Values: deal, call, email, meeting, note
userstringFilter by user name (partial, case-insensitive match)

Response Structure

{
  "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
    }
  ]
}

Example Requests

GET /api/v1/activity?limit=5 — Latest 5 activities

GET /api/v1/activity?type=call&user=Mike — All calls by Mike


2. Accounts API

GET/api/v1/accounts

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.

Query Parameters

ParameterTypeDefaultDescription
idstringReturn a single account by ID (e.g., acc-001)
tierstringallFilter by tier. Values: Enterprise, Mid-Market, SMB
industrystringFilter by industry (partial, case-insensitive match)
ownerstringFilter by account owner name (partial, case-insensitive match)
renewalStatusstringallFilter by renewal status. Values: auto-renew, pending, at-risk, prospect
minHealthintegerOnly return accounts with health score >= this value (0-100)

Response Structure

{
  "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)
    }
  ]
}

Example Requests

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


3. Analytics API

GET/api/v1/analytics

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.

Query Parameters

ParameterTypeDefaultDescription
sectionstringallReturn only a specific section. Values: summary, revenueByMonth, dealsByStage, performanceByRep, topIndustries

Response Structure

{
  "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 }
    ]
  }
}

Example Requests

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


4. Sales / Deals API

GET/api/v1/sales

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.

Query Parameters

ParameterTypeDefaultDescription
idstringReturn a single deal by ID (e.g., deal-1)
stagestringallFilter by stage. Values: Prospecting, Discovery, Proposal, Negotiation
ownerstringFilter by deal owner name (partial, case-insensitive match)
minValueintegerOnly deals with value >= this amount (USD)
maxValueintegerOnly deals with value <= this amount (USD)
hasCompetitorstringFilter by competitor presence. Values: true, false
sortBystringSort field name (e.g., value, probability, expectedCloseDate)
sortOrderstringdescSort direction: asc or desc

Response Structure

{
  "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
    }
  ]
}

Example Requests

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


5. Modules API

GET/api/v1/modules

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.

Query Parameters

ParameterTypeDefaultDescription
idstringReturn a single module by ID (e.g., mod-analytics)
categorystringallFilter by category. Values: Core, Intelligence, Productivity, Integration, Services
statusstringallFilter by availability. Values: generally-available, beta
isBasestringFilter by base module flag. Values: true, false

Response Structure

{
  "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
    }
  ]
}

Example Requests

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


Cross-references: Activity records link to Sales via 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