Reports

Rebind every widget of a report

Points every widget of a report at another connection and another account, one pair per integration. It is for the reports that bind a connection PER WIDGET -- the ones whose report_level_data_sources is false -- and it is the bulk form of /v1/widgets/set-connection: each widget is loaded as it is stored, backed up, written with the two columns of the connection replaced, and its cached results are dropped so it reads the new account at once.

A report that binds once for the whole report has no per widget connection to set and is refused with 400 APPEND_NOT_ALLOWED and reason report_level_data_sources; rebind it with the data_sources of /v1/reports/update. A report built on a template is refused with reason template_based, because its widgets belong to the template.

IT IS NOT ATOMIC. Each widget is written on its own: the answer lists the widgets that were bound and the widgets that were not, each of the second kind with the reason -- its integration is not in the body, it reads several connected accounts at once, it is a cross-platform widget that reads an accounts group (whose connections it keeps), or its write failed. A widget that reads no data at all -- a text block, an image, a page break, an AI summary -- is in neither list. Retrying the same body finishes the job, because writing the connection a widget already has writes the same two values.

Refusals: 400 for the framework and the body, 400 INVALID_VALUE when connections is empty, 400 CONNECTION_NOT_FOUND or ACCOUNT_NOT_FOUND when a pair is not one /v1/connections publishes, 400 APPEND_NOT_ALLOWED, 403 WRITE_ACCESS_DISABLED, 404 NOT_FOUND and 409 REPORT_IN_TRASH.

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

post/reports/set-connections

Request

  • Base URL: https://api.reportingninja.com/v1
  • URL: https://api.reportingninja.com/v1/reports/set-connections
  • Auth: HTTP bearer

Request body

report_keystring required

The report to rebind. Its report_level_data_sources has to be false.

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.

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.