Reports

Delete a report

Deletes a report. By default it goes to the trash: it leaves every listing and every plan count, its key stops resolving and its share link stops working, and /v1/reports/restore brings it back with its original type for 7 days. /v1/reports/trash lists what is in there. Sending permanent: true deletes the report for good instead, with its sections and its widgets, and that cannot be undone. The scheduled deliveries of the report are deleted either way and a restore does not recreate them. This endpoint ALWAYS asks for a confirmation, in both forms: the first call answers HTTP 200 with confirmation_required, a token and a preview counting what would go; the same body sent again with that token performs the deletion. A report that a portal view or a template_based report still depends on is refused with 409 REPORT_IN_USE and details naming them, so they can be detached first; an entry of that list that is itself in the trash says so with in_trash. A report already in the trash is refused with 409 REPORT_IN_TRASH unless the call carries permanent: true. A report whose scheduled delivery is being sent right now is refused with 409 SCHEDULE_QUEUED and is worth retrying in a few minutes. A retry with the same idempotency_key answers the original call even if the report changed state in between; read /v1/reports/get for its current state. Refusals: 400 for the framework and the body, 403 WRITE_ACCESS_DISABLED, 404 NOT_FOUND, 409 REPORT_IN_USE, REPORT_IN_TRASH or SCHEDULE_QUEUED plus the confirmation and idempotency conflicts. if_version is not accepted: there is no version left to guard.

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

post/reports/delete

Request

  • Base URL: https://api.reportingninja.com/v1
  • URL: https://api.reportingninja.com/v1/reports/delete
  • Auth: HTTP bearer

Request body

report_keystring required

The report to delete.

permanentboolean

Delete the report for good instead of putting it in the trash. Default false. A report that is already in the trash is only accepted with this set to true; without it the answer is 409 REPORT_IN_TRASH.

dry_runboolean

Validate and answer what WOULD happen, without writing anything. Default false.

idempotency_keystring

Makes a retry safe: the answer of the first call is replayed for 24 hours to any later call with the same key and the same body.

confirmation_tokenstring

The token the previous call answered. Sending the same body with it performs the write.

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.