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.
Request
- Base URL: https://api.reportingninja.com/v1
- URL: https://api.reportingninja.com/v1/calculated-metrics/delete
- Auth: HTTP bearer
Request body
Response
The call succeeded. This endpoint reports its errors with a real HTTP status, so a 200 always carries status=ok.
Changes
No recorded changes to this operation across all 1 revision of this API.