set_report_sharing
Publish or unpublish a report and control who can reach its share link (/p/:id). visibility: 'public' (anyone with the link), 'registered' (any signed-in user), 'domain' (anyone signed in with a verified email on one of allowed_email_domains — required with 'domain', e.g. ['acme.com']), 'team' (the report's team; the report must already be filed under one), or 'private' (owner + invited people only). To change the domain list, send visibility='domain' again with the full new list. public_permission is what link/anonymous visitors may do: 'none', 'view', 'comment', or 'edit'. To publish a report so anyone can open and comment on it, set visibility='public' and public_permission='comment'. show_approved_only enables staged publishing: view-only audiences see the last revision a reviewer approved (see set_report_signoff) while reviewers keep seeing head. allowed_embed_origins opts the report into embedding on other sites: pass the bare origins allowed to iframe it (e.g. ['https://acme.com']), or [] / null to turn embedding off. The response then carries embed_snippet, the exact markup to paste into the host page; the embed only renders while the report is public, its link permission isn't 'none', and it has no share password. Requires manage permission on the report (owner or admin).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report_id | Yes | UUID of the report. | |
| visibility | No | Who can reach the report. | |
| public_permission | No | What link/anonymous visitors may do. | |
| show_approved_only | No | Staged publishing: when true, view-only audiences see the last approved revision instead of head. | |
| allowed_email_domains | No | Email domains allowed to view when visibility='domain' (e.g. ['acme.com']). Required with, and only accepted with, visibility='domain'; replaces the existing list. | |
| allowed_embed_origins | No | Origins allowed to iframe this report via /embed/:id. Bare origins only — scheme + host + optional port, no path (https://acme.com, https://blog.acme.com:8443). https is required except for http://localhost and http://127.0.0.1. [] or null turns embedding off. |