Duplicate a report for another client
Copies a report and points it at another client's data, in one call: the copy is made, it is rebound, a schedule is created when the body carries one, and it is added to a portal view when the body names one.
THE SHAPE OF THE BODY FOLLOWS THE SOURCE. A report that binds its data sources once for the whole report is rebound with data_sources; one that binds a connection per widget with connections. Sending the other one is refused by name, because a rebinding that did nothing would hand the new client a report reading the previous client's accounts. /v1/reports/get publishes report_level_data_sources for every report.
ONLY THE FIRST STEP CAN REFUSE THE CALL. Once the copy exists nothing undoes it, so the answer reports the other three as they went: bound[] and failed[] per binding, schedule and portal_view each saying whether it was requested and whether it was done, with the error_code of what stopped it. A retry with the same idempotency_key answers this same result and never writes a second report.
It asks for a confirmation when the body carries schedule or portal_view_key: those are the two steps that reach people. The creation of a schedule counts against the daily budget of calls that send email, and so does adding the report to a portal view when that notifies its users.
A report with cross-platform widgets that read an accounts group is refused with 400 INVALID_VALUE on report_key, naming those widgets: a copy for another client would keep showing the data of that group. Point them at the report connections in the editor first, or copy the report with /v1/reports/copy.
Refusals: 400 for the framework and the body, 400 INVALID_VALUE or MISSING_REQUIRED_FIELD when the rebinding does not match the source or the report has widgets on an accounts group, 403 WRITE_ACCESS_DISABLED, 403 PLAN_LIMIT_REACHED, 404 NOT_FOUND, 409 REPORT_IN_TRASH and 429 EMAIL_QUOTA_REACHED.
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/reports/duplicate-for-client
- 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.