| Schema — OPTIONAL |
|---|
id stringPubNub-generated unique ID for the metric. Required in later requests to update, delete, or retrieve the metric. | name stringMetric name (1-50 characters). | measureId stringField ID to aggregate (required for AVG, MAX, MIN, SUM functions). References a NUMERIC field from the business object. | businessObjectId stringID of the source business object. | evaluationWindow number — OPTIONALTime period in seconds for metric evaluation. Allowed values: 60 (1 min), 300 (5 min), 600 (10 min), 900 (15 min), 1800 (30 min), 3600 (1 hour), 86400 (1 day). | function stringAggregation function: AVG, COUNT, COUNT_DISTINCT, MAX, MIN, or SUM. | dimensionIds string[] — OPTIONALField IDs to group by (TEXT fields only). References dimensions from the business object. | dimensions object[] — OPTIONALInformation about the IDs included in the dimensionIds - the fields you grouped by. id stringPubNub-generated unique ID for the field. Required when creating metrics and decisions. Used as measureId, dimensionIds, or inputFields[].sourceId. | name stringField name (1-50 characters). | jsonPath string — OPTIONALJSON path expression for extracting data (max 200 chars). Required when source is JSONPATH and isActive is true. | jsonFieldType stringPossible values: [TEXT, TEXT_LONG, NUMERIC, TIMESTAMP, DURATION_SECONDS] Field data type: TEXT, TEXT_LONG (character limit is 1000, limited to 5 per Business Object), NUMERIC, or TIMESTAMP. Required when source is JSONPATH. | isKeyset booleanBoolean flag indicating if this field is part of the keyset. Informational only. | source stringPossible values: [JSONPATH, DERIVED] Field source type: JSONPATH or DERIVED. | derivation object — OPTIONALDerivation configuration. Required when source is DERIVED. operation stringPossible values: [TIME_DIFF] Derivation operation type. Currently only TIME_DIFF is supported. | params objectParameters for the derivation calculation. startSource stringPossible values: [DATA_FIELD, PUBLISH_TIMETOKEN] Start source for time difference calculation: DATA_FIELD or PUBLISH_TIMETOKEN. DATA_FIELD accepts only TIMESTAMP data type. | startFieldIndex number — OPTIONALIndex or position of the start timestamp data field in your array. Not required if startSource is PUBLISH_TIMETOKEN. | endSource stringPossible values: [DATA_FIELD, PUBLISH_TIMETOKEN] End source for time difference calculation: DATA_FIELD or PUBLISH_TIMETOKEN. | endFieldIndex number — OPTIONALIndex or position of the end timestamp data field in your array. Not required if endSource is PUBLISH_TIMETOKEN. |
|
|
| filters object[] — OPTIONALFiltering criteria for the metric. id stringPubNub-generated ID for the metric filter. Required when updating a metric (PUT). | sourceType stringPossible values: [MEASURE, DIMENSION] Filter source type. Value must always be DIMENSION. | sourceId stringID of the field or data field to filter on. | operation stringPossible values: [NUMERIC_GREATER_THAN, NUMERIC_GREATER_THAN_EQUALS, NUMERIC_LESS_THAN, NUMERIC_LESS_THAN_EQUALS, NUMERIC_INCLUSIVE_BETWEEN, NUMERIC_EXCLUSIVE_NOT_BETWEEN, BOOLEAN_IS_TRUE, BOOLEAN_IS_FALSE, STRING_CONTAINS, STRING_NOT_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH, STRING_EQUALS, STRING_IS_EMPTY, STRING_IS_NOT_EMPTY, STRING_NOT_EQUALS] Filter operation: STRING_EQUALS, STRING_NOT_EQUAL, STRING_CONTAINS, STRING_NOT_CONTAINS, STRING_IS_EMPTY, STRING_IS_NOT_EMPTY, STRING_STARTS_WITH, STRING_ENDS_WITH. | arguments string[]Filter arguments (1 string). Matching is case-sensitive. |
| businessObject (circular) — OPTIONALOptional nested object with details of the source Business Object. |
|