---
id: report-change-visibility
title: "Change published visibility"
description: "Publishes a new version using the current published content with the new visibility, and updates the draft to match. Returns `204` if the visibility is unchanged, and `400` if the report has no published version."
sidebar_label: "Change published visibility"
hide_title: true
hide_table_of_contents: true
api: eJztWW1v2zgS/isD3ofeAXLiuE7beHEf2jSLZtG9pknaLi4I4rE0sriRSJWkknoN//fDkLQtxW7zgtsvd5svsWWS83DmmVfNhcOpFaMLcUq1Ng5uyFiplRWXicjIpkbWTmolRuKkmZTSFmQBQdHtciU0VqopuIIgbYwh5aCOKzNItXL85Fa6wi/xG6WVE1lKN0sAVQZNnaEj63/PDOYOnIYKXVrswCm5xigL40F/OAaZ+0XrA0BaaFRaoJpSFk4bD/v91UoTLlWgBaVbuCL2HZEIXZNBvuJxJkYibBiFE3trQSIRNRqsyJFhdc2FZJ3U6AqRCIUViZGQmUiEoa+NNJSJkTMNJcKmBVUoRnPhZjWvss5INRWJyLWp0ImRaBqZicVdfZ8XBI2SXxsCmZFyMpdkQLcvxvjpG1Z1yQfn+f7By/4k7+0fDLLeEF9lvcmr/Ve953sv9ykdDof7LwZicRkgknVvdDZjXNFI/BHrupSpV8fu75ZhzNsXkM4LOvTa+bxSjj8oWd5PT36n1HU0cSFamrxMBGaZZBlYnhjWv5NkxSjH0lIi6tajeXtjC8HntmHu6pVUU7HMxpJhA5spKvmHv9Qmq78UGlJUYInaioUx7x7DNVFtQTqojbxBR0xN6SzoW0XmJxi3Dx+DLdCQX74i/G2hS4L2sq7RPMiF/0uEpbQx/qoXczEhNGReN64Qo4vLYDdba2WDYgb9Pv/b5Ay72AbTITWEjrLveSKDejQPQsj4HCRsIUAX22sFsqoah5OSwCqsbaEd8xmj0p/Z4P4JOLwmBbcFqbYX36JdX4wBd5kis/ud7BE+Jm07SqwNtvfqOU4ODoa9lwcD7A33Btg72Mux96K/vz/I8z3Elzk7cwB99VRUx2+7rt5BBBMqtZpacPopISAR8Zwr1VQTMi2EUjmaerfZhGQ5bCgnsVzhCPsTsA6N4zSAD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oy8bcIcsEs6toWDZfUMEDpNtCG5dA0VSo7kLgvV0pbzCD07WUpYLvl7PKs5CRQ1lawIlu3HcUGPsAL8ezuMKSXY4y8JpRDqXyVU5gXJtgSwfZ30bgY85+jMKSuSET7xn5iwoaRd9qStk3pLUhD//F17/4+qfz1YNzhc7CnDUt/AyWp2FiN9QEu3OZLXY7Q9pA4jChbUwpRqJwrraj3V2s5Y5qyrIu0TGQnVRXfhq6HLr5bjGQqz16W+mFDxKxOfbm8otEEj/8vMx/v3w5FwyeveF0PWk9WmqmO9NclRtS5XpzuMbNZ8yLYiT6O3s7/Q3L/IoKpwTZTGEl01gv2RHXdHlvren4HCaNLF3olbDTorNWEsB15xwG6mcf3/cmmF5TBrFH5rF8OKvAGwJcTu2Z6dzQUiad37qe920MJO2y6jc5pr6FOVZWTgsuprn40tZV6KNJHK6HoXP7oLbd74xUVgHqf/WtReSko29uty5RKl+gMeHn0Uku4gRSJGLkZ4zdEXyhreNF8/kELX0y5WLBj32LwfPmRNygkWw770uZtPw5W3WC31X4309jTP8HPPANxta7xIeo2Lq+KBMjIRJxTbPwpmVxuUhEQZjx/PJiHn84DDh6PDVobdzIUotkueN1mlLtfrj2shWJTl6fH75jp48vTyqfIoTBW05neBtQxh6KF/hnc1GimjY+0IpwKIcI7EaYOxHFX2urHubzsOJcX5NaLFZqcfydNbNY/Ac0Grt0
sidebar_class_name: "patch api-method"
info_path: docs/api/reports
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Change published visibility"}
>
</Heading>

<MethodEndpoint
  method={"patch"}
  path={"/report/{id}/visibility"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Publishes a new version using the current published content with the new visibility, and updates the draft to match. Returns `204` if the visibility is unchanged, and `400` if the report has no published version.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"The unique identifier of the report.","example":"ff5970bf-592d-4a8d-b858-3175ec444562"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"title":"ChangeVisibilityBody","type":"object","required":["visibility"],"additionalProperties":false,"properties":{"visibility":{"title":"Visibility","type":"string","enum":["user","organization"],"description":"Who can see the report. `user` keeps it private to its owner; `organization` shares it with the whole organization.","example":"user"}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The new published version created with the new visibility.","content":{"application/json":{"schema":{"title":"ReportVersion","type":"object","description":"An immutable snapshot of a report's draft, taken when the report was published.","properties":{"id":{"type":"string","format":"uuid","description":"The unique identifier of this version.","example":"183ab994-792a-412a-91fa-60552ff1aa7f"},"report_id":{"type":"string","format":"uuid","description":"The ID of the report this version belongs to.","example":"ff5970bf-592d-4a8d-b858-3175ec444562"},"version_number":{"type":"integer","description":"The sequential version number, starting at 1.","example":1},"name":{"type":"string","description":"The report's display name at the time this version was published.","example":"Deployment frequency"},"slug":{"type":"string","description":"The report's slug at the time this version was published.","example":"deployment-frequency"},"description":{"type":"string","description":"The report's description at the time this version was published.","example":"How often each application deploys"},"schema":{"type":"object","additionalProperties":true,"description":"The JSON Schema snapshot included in this version."},"ui_schema":{"type":"object","additionalProperties":true,"description":"The UI Schema snapshot included in this version."},"queries":{"title":"Queries","type":"object","description":"A map of query IDs to query definitions. Each ID is a name you choose to identify the query within the report.","additionalProperties":{"title":"QueryDefinition","type":"object","required":["source"],"additionalProperties":false,"properties":{"source":{"type":"string","description":"The SQL `SELECT` statement the query runs. It can include `{name:Type}` placeholders that take their values from form fields, as declared in `params`.","example":"SELECT name FROM environments WHERE account = {account:String}"},"params":{"type":"object","description":"Binds the placeholders in `source` to form fields. Each key matches a placeholder name in the query.","additionalProperties":{"type":"object","required":["scope"],"additionalProperties":false,"properties":{"scope":{"type":"string","description":"A JSON Pointer to the form field that supplies the placeholder's value.","example":"#/properties/account"}}}},"target":{"type":"string","description":"A JSON Pointer to the schema property this query populates with its results.","example":"#/properties/environment"},"mapping":{"type":"string","enum":["enum"],"description":"How query results map onto the `target` field. Use `enum` to turn the results into the field's selectable options.","example":"enum"}}}},"visibility":{"title":"Visibility","type":"string","enum":["user","organization"],"description":"Who can see the report. `user` keeps it private to its owner; `organization` shares it with the whole organization.","example":"user"},"published_by":{"type":"string","description":"The ID of the user who published this version.","example":"1234"},"created_at":{"type":"string","format":"date-time","description":"The ISO 8601 timestamp of when this version was published.","example":"2026-07-20T12:00:00Z"},"updated_at":{"type":"string","format":"date-time","description":"The ISO 8601 timestamp of this version's last update.","example":"2026-07-20T12:00:00Z"}}}}}},"204":{"description":"The visibility was already set to the requested value; nothing changed."},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"title":"Error","type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code indicating the error.","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the failure.","example":"bad_request"},"error":{"type":"string","description":"A short, human-readable error type.","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Internal server error due to an unexpected issue.","content":{"application/json":{"schema":{"title":"Error","type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code indicating the error.","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the failure.","example":"bad_request"},"error":{"type":"string","description":"A short, human-readable error type.","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}}}}
>
  
</StatusCodes>


      