Skip to main content
GET
/
api
/
v0
/
analytics
const options = {
  method: 'GET',
  headers: {
    'x-api-key': '<your-api-key>',
  },
};

fetch(
  'https://api-v2.getomni.ai/api/v0/analytics?start=2026-03-14T00:00:00Z&end=2026-04-14T00:00:00Z',
  options,
)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));
{
  "start": "2026-03-14T00:00:00Z",
  "end": "2026-04-14T00:00:00Z",
  "totals": {
    "count": 950,
    "leadsCompleted": 320,
    "leadsOptedOut": 45,
    "totalMessages": 12400,
    "inboundMessages": 4800,
    "outboundMessages": 7600,
    "channels": {
      "sms": { "inbound": 3200, "outbound": 4800 },
      "email": { "inbound": 1400, "outbound": 2800 }
    },
    "completion": {
      "totalRequired": 7600,
      "totalCompleted": 2060,
      "bySource": {
        "agent": 520,
        "imported": 80,
        "manual": 140,
        "portal": 1320
      }
    },
    "interventions": {
      "documentOverrides": 0,
      "escalations": 12,
      "manualUpdates": 51,
      "messageEdits": 109,
      "messageRejects": 14
    }
  },
  "breakdown": [
    {
      "leadId": "4ef30123-90c2-4dc0-bd28-b43eee8664ea",
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@acme.com",
      "phoneNumber": "+15551234567",
      "createdAt": "2026-03-15T10:22:00Z",
      "completedAt": "2026-03-17T04:45:00Z",
      "optedOutAt": null,
      "totalMessages": 18,
      "inboundMessages": 7,
      "outboundMessages": 11,
      "lastInboundAt": "2026-03-17T04:30:00Z",
      "lastOutboundAt": "2026-03-17T04:40:00Z",
      "channels": {
        "sms": {
          "inbound": 6,
          "outbound": 9,
          "lastInboundAt": "2026-03-17T04:30:00Z",
          "lastOutboundAt": "2026-03-17T04:40:00Z"
        },
        "email": {
          "inbound": 1,
          "outbound": 2,
          "lastInboundAt": "2026-03-15T11:12:00Z",
          "lastOutboundAt": "2026-03-15T10:30:00Z"
        }
      },
      "completion": {
        "totalRequired": 8,
        "totalCompleted": 8,
        "bySource": {
          "agent": 2,
          "imported": 0,
          "manual": 1,
          "portal": 5
        }
      },
      "interventions": {
        "documentOverrides": 0,
        "escalations": 0,
        "manualUpdates": 1,
        "messageEdits": 1,
        "messageRejects": 0
      },
      "checklistItems": [
        {
          "code": "PERSONAL_DETAILS.FIRST_NAME",
          "required": true,
          "status": "COMPLETED",
          "value": "Jane",
          "updatedAt": "2026-03-15T10:22:00Z",
          "source": "portal"
        },
        {
          "code": "DOCUMENTS.INCOME_VERIFICATION",
          "required": true,
          "status": "COMPLETED",
          "value": "s3://...",
          "updatedAt": "2026-03-15T11:02:00Z",
          "source": "portal"
        }
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.getomni.ai/llms.txt

Use this file to discover all available pages before exploring further.

Returns aggregate totals and a per-lead breakdown for leads in your workspace. Results are scoped to the API key’s workspace and exclude deleted and test leads.

Query Parameters

start
string
ISO 8601 datetime (e.g. 2026-03-14T00:00:00Z). Filters leads by createdAt.
end
string
ISO 8601 datetime. Must be on or after start when both are provided.
format
string
default:"json"
Response format. Either json or csv. When csv, the response is a JSON object with a signed downloadUrl pointing to a CSV file hosted on S3.
token
string
Pagination token returned as nextToken on a prior request. Only used when format=json. Omit on the first request.
If both start and end are omitted, all leads in the workspace are returned. JSON responses are capped at 500 leads per page. Use nextToken to fetch the next page.

Response

start
string
Echo of the start of the date range
end
string
Echo of the end of the date range
nextToken
string
Pagination token for the next page. null when no more leads remain. Pass back as the token query param to fetch the next page.
totals
object
Workspace-wide aggregates over all leads matching the filter.
breakdown
array
Array of per-lead analytics objects.

Source values

SourceOrigin
agentAI agent via tool calls
importedPublic REST API calls
manualHuman team member direct edits
portalCustomer self-service via portal

CSV format

When format=csv, the response is a JSON object with a signed URL to download the CSV file from S3. The URL expires after 1 hour. Response fields:
downloadUrl
string
Signed S3 URL to download the CSV file. Expires in 1 hour.
expiresAt
string
ISO timestamp when the signed URL expires.
CSV file columns (in the downloaded file):
  1. Base fields: leadId, firstName, lastName, email, phoneNumber, createdAt, completedAt, optedOutAt, message counts, last-touch timestamps
  2. Per-channel: channels.<name>.inbound, channels.<name>.outbound, channels.<name>.lastInboundAt, channels.<name>.lastOutboundAt
  3. Completion: completion.totalRequired, completion.totalCompleted, completion.bySource.*
  4. Interventions: interventions.*
  5. Checklist items (index-based, sorted by group order then item order, padded to the maximum count across all leads): checklist.<i>.code, checklist.<i>.required, checklist.<i>.status, checklist.<i>.value, checklist.<i>.updatedAt, checklist.<i>.source
Totals are not included in the CSV. Use format=json for aggregates. Example CSV response:
200
{
  "downloadUrl": "https://s3.amazonaws.com/your-bucket/analytics-exports/...?X-Amz-Signature=...",
  "expiresAt": "2026-04-14T18:00:00.000Z"
}

Errors

StatusCause
400Missing or invalid query parameters (e.g., non-ISO date, start after end, unrecognized param)
401Missing or invalid API key
const options = {
  method: 'GET',
  headers: {
    'x-api-key': '<your-api-key>',
  },
};

fetch(
  'https://api-v2.getomni.ai/api/v0/analytics?start=2026-03-14T00:00:00Z&end=2026-04-14T00:00:00Z',
  options,
)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));
{
  "start": "2026-03-14T00:00:00Z",
  "end": "2026-04-14T00:00:00Z",
  "totals": {
    "count": 950,
    "leadsCompleted": 320,
    "leadsOptedOut": 45,
    "totalMessages": 12400,
    "inboundMessages": 4800,
    "outboundMessages": 7600,
    "channels": {
      "sms": { "inbound": 3200, "outbound": 4800 },
      "email": { "inbound": 1400, "outbound": 2800 }
    },
    "completion": {
      "totalRequired": 7600,
      "totalCompleted": 2060,
      "bySource": {
        "agent": 520,
        "imported": 80,
        "manual": 140,
        "portal": 1320
      }
    },
    "interventions": {
      "documentOverrides": 0,
      "escalations": 12,
      "manualUpdates": 51,
      "messageEdits": 109,
      "messageRejects": 14
    }
  },
  "breakdown": [
    {
      "leadId": "4ef30123-90c2-4dc0-bd28-b43eee8664ea",
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane@acme.com",
      "phoneNumber": "+15551234567",
      "createdAt": "2026-03-15T10:22:00Z",
      "completedAt": "2026-03-17T04:45:00Z",
      "optedOutAt": null,
      "totalMessages": 18,
      "inboundMessages": 7,
      "outboundMessages": 11,
      "lastInboundAt": "2026-03-17T04:30:00Z",
      "lastOutboundAt": "2026-03-17T04:40:00Z",
      "channels": {
        "sms": {
          "inbound": 6,
          "outbound": 9,
          "lastInboundAt": "2026-03-17T04:30:00Z",
          "lastOutboundAt": "2026-03-17T04:40:00Z"
        },
        "email": {
          "inbound": 1,
          "outbound": 2,
          "lastInboundAt": "2026-03-15T11:12:00Z",
          "lastOutboundAt": "2026-03-15T10:30:00Z"
        }
      },
      "completion": {
        "totalRequired": 8,
        "totalCompleted": 8,
        "bySource": {
          "agent": 2,
          "imported": 0,
          "manual": 1,
          "portal": 5
        }
      },
      "interventions": {
        "documentOverrides": 0,
        "escalations": 0,
        "manualUpdates": 1,
        "messageEdits": 1,
        "messageRejects": 0
      },
      "checklistItems": [
        {
          "code": "PERSONAL_DETAILS.FIRST_NAME",
          "required": true,
          "status": "COMPLETED",
          "value": "Jane",
          "updatedAt": "2026-03-15T10:22:00Z",
          "source": "portal"
        },
        {
          "code": "DOCUMENTS.INCOME_VERIFICATION",
          "required": true,
          "status": "COMPLETED",
          "value": "s3://...",
          "updatedAt": "2026-03-15T11:02:00Z",
          "source": "portal"
        }
      ]
    }
  ]
}