Calculated Metrics

Delete a calculated metric

Deletes a calculated metric of the account.

THERE IS NO WAY BACK: /v1/calculated-metrics/create writes a NEW metric, with a new key, and every widget that drew the old one would have to be changed. That is why this endpoint ALWAYS asks for a confirmation and why its answer carries before with the whole definition.

IT REFUSES WHILE ANYTHING STILL DRAWS IT: 409 IN_USE, with details.used_by in the shape of the EntityUsage schema. It carries reports -- each with its report_key, its internal name, whether it is in the trash and how many widgets of it draw the metric -- and account_groups, how many Data Studio account groups do, AND NOTHING ELSE: the question asked of a calculated metric covers those two families, so the calculated_metrics, portal_views and alerts a filter's used_by carries are absent here rather than published empty. A report_key can be the key of a TEMPLATE, and it is null for an element whose report could not be resolved.

It does NOT empty the cached results of the account.

A metric the platform ships answers 409 NOT_ALLOWED with details.reason system_defined.

if_version is not accepted.

Refusals: 400 for the framework and the body, 403 WRITE_ACCESS_DISABLED, 404 NOT_FOUND, 409 IN_USE and 409 NOT_ALLOWED.

A definition written through this API is not visible to an application window that is already open: the page has to be reloaded before the same definition is edited there.

Every write endpoint reads dry_run and idempotency_key; see the Write guarantees section of the introduction.

post/calculated-metrics/delete

Request

  • Base URL: https://api.reportingninja.com/v1
  • URL: https://api.reportingninja.com/v1/calculated-metrics/delete
  • Auth: HTTP bearer

Request body

calculated_metric_keystring required

The metric to delete. From /v1/calculated-metrics/list.

dry_runboolean

Validate everything and write nothing.

idempotency_keystring

Replays the answer of an identical call for 24 hours.

confirmation_tokenstring

The token the first call answered with, to apply the operation.

Response

The call succeeded. This endpoint reports its errors with a real HTTP status, so a 200 always carries status=ok.

status'ok' required

Changes

No recorded changes to this operation across all 1 revision of this API.