Models

RevOps API Models:

  • UsageEvent - UsageEvent contains information on product usage
  • EventMetric - EventMetric defines an individual metric to be tracked
  • ApiResponse - Standard API response format

UsageEvent

UsageEvent contains information about product usage metrics that RevOps helps you track and connect back to your accounts and deals. The list of properties for UsageEvent are:

Name Type Description Required
id string RevOps assigned unique identifier No
uri string RevOps assigned URI for accessing the usage record through a GET request No
date_submitted ISO8601 Datetime in UTC Time that the event was submitted to RevOps. Automatically created if not provided No
event_metrics [EventMetric] A list of EventMetrics included for aggregation Yes
mode string (ENUM) One of the available counting modes: insert, upsert, replace Yes
transaction_id string User driven transaction identifier used to detect duplicate POST requests Yes

The RevOps API supports idempotency for safely repeating a request without impacting the underlying aggregation. Clients can safely retry requests for a given transaction_id when mode=insert. RevOps idempotentcy works by capturing the original request and replies the record if the transaction_id is replayed. For modes other than insert, the operation behavior works as described below:

UsageEvent modes define how usage events are counted and processed

Name Type Description
insert string INSERTs a new usage event containing a set of metrics, if a usage event already exists for the provided transaction_id, the request is ignored and the original usage record is returned. This allows clients to build idempotent systems.
upsert string INSERTs or updates a usage event, if one already exists for the provided transaction_id, then the event metrics of the existing transaction are replaced with the new event metrics.

An example of this is building an auto-correcting or manual operational tool to update metrics in batches or to fix a systemic issue.
replace string REPLACES an entire existing usage event identified by the provided transaction_id.

For example, an aggregation or rollup has been performed and you want to ensure information in billing is up-to-date.

EventMetric

EventMetric represents a single metric that is to be included as part of the UsageEvent tracking. The list of properties for EventMetric are:

Name Type Description Required
product string Product name associated with the metric Yes
metric_name string Internal metric name Yes
metric_value integer Numeric value of the metric Yes
metric_resolution string Time period associated with the metric Yes
account_id string AccountId associated with the metric. This is the default account used for tracking usage metrics Yes
subaccountid string Subaccount associated with the metric No

ApiResponse

The standard API response format is used to indicate when we were not able to process the request.

Name Type Description Required
code integer RevOps Error Code No
type string RevOps Error Code No
message string Human readable description of the error code No