Event Statistics

Event statistics report aggregate counts of events broken out by outcome (success, failure, or error). Event statistics can be grouped by arbitrary lead data and the resulting "row" represents events counted by the combination of the specified lead data fields. Statistics can also be bucketed into intervals (minutely, hourly, daily, weekly, monthly, yearly) and doing so adds the start and end properties to the results and the counts represent the events that occurred during the time frame defined by the start and end timestamps.

Retrieve statistics on events

The /events/stats resource is used to count events, broken out by outcome (success, failure, error) . The event count can be grouped by any field collected with the lead or appended to the lead during flow processing. The API also supports returning results in JSON or CSV using the appropriate MIME type in the Accept header.

Request
query Parameters
type
string

Convenience option that specifies a filter on event type (source, recipient, filter, feedback-received, or feedback-sent). Can be used multiple times to specify multiple types. (default: source)

BinaryRule (object) or UnaryRule (object) or (RuleSet (object or null)) (Rule)

Limit counted events using this rule. Can be used multiple times to specify multiple rules. Each rule must be sent as URL encoded JSON.

group_by
string

Group event counts by unique values of this property. Can be used multiple times to specify multiple properties. (default: none)

interval
string

Groups event counts into sub-timeframes spanning a specified length of time: minutely, hourly, daily, weekly, monthly, yearly (default: none)

timezone
integer

When an interval is specified, this time zone will be used to set the start and end of each interval. Any tz database time zone name (i.e. America/Chicago) or the number of seconds to offset time from UTC (i.e. -18000)

start
string <date-time> (Timestamp)

Count events that were created at or after this time (default: beginning of the day today)

end
string <date-time> (Timestamp)

Count events that were created at or before this time (default: end of the day today)

outcome
string

DEPRECATED: use column instead. The outcome to count (default: success, failure, error). Can be used multiple times to specify multiple types.

column
string

A column to aggregate. Can be used multiple times to specify multiple columns. source-success, source-failure, source-error

by_lead
boolean

Boolean indicating whether to count unique leads or unique events - false counts individual events (default: true)

Responses
200

OK

get/events/stats
Request samples
curl -i -X GET \
  'https://app.leadconduit.com/events/stats?type=string&id=string&lhv=lead.state&op=is%20equal%20to&rhv=TX&rule_set=%5Bobject%20Object%5D&group_by=string&interval=string&timezone=0&start=2019-08-24T14%3A15%3A22Z&end=2019-08-24T14%3A15%3A22Z&outcome=string&column=string&by_lead=true'
Response samples
application/json
[
  • {
    • "start": "2019-08-24T14:15:22Z"
    }
]