post
https://api.doit.com/analytics/v1/custom-metrics
Creates a custom metric owned by the caller. Requires the
analytics:calculatedMetrics entitlement and a metrics write
permission.
Create the allocations first (POST /analytics/v1/allocations), then
reference them from variables[].allocationId. The order of
variables sets their letters: the first is A, the second B, up
to E. Write formula with those letters.
With dryRun=true, the response is 200 with the metric that would
be created. Its id, etag, createTime and updateTime are
placeholders.
Errors (RFC 9457 Problem Details, code field):
400 validation_failed: the body breaks a rule.detailsholds
one entry per problem, withfieldset to a path such as
variables[1].allocationIdandissueset to one of:required: a required field is missing or blank.value_not_in_enum: a value outside its allowed set.out_of_range: a number outside its bounds, ordecimals.min
greater thandecimals.max.invalid_formula:formuladoes not parse;detailsays why.unknown_variable:formulauses a letter with no variable.allocation_not_found: no allocation with this id for the
customer.allocation_not_single: the id names a group allocation.allocation_not_available: a preset allocation the customer is
not entitled to.extended_metric_not_found: anextendedmetric key that
GET /analytics/v1/extended-metricsdoes not list with data
sourcebillingorbilling-datahub.
400 idempotency_key_required: noIdempotency-Keyheader.400 tenant_id_required: a caller with access to more than one
customer sent noX-Tenant-Id.403 analytics.feature_not_entitled: the customer does not have
the calculated metrics entitlement.403 forbidden: no metrics write permission, a read-only token,
or anX-Tenant-Idthat the credential cannot access.409 idempotency_request_in_progress: a request with the same
Idempotency-Keyis still running. Retry with backoff.422 idempotency_key_reused: theIdempotency-Keywas used with
a different body.503 service_unavailable: the customer's extended metrics could
not be checked, or anextendedkey is missing while part of the
data that decides the list could not be read. The key is not
rejected: retry afterRetry-Afterseconds.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…