---
id: report-rollback
title: "Roll back to a version"
description: "Makes an earlier version the published one. Does not modify the draft."
sidebar_label: "Roll back to a version"
hide_title: true
hide_table_of_contents: true
api: eJztWN9z2zYS/ld2cA+5m6EsWbGTmDf3kMbuxJ3mktpO0zmPx1qRSxE1CTAAaEfV8H+/WYASRUmOHV96T32yLAG73y6+/bkQDmdWxJfijCptHNySsVIrK64ikZJNjKyc1ErE4h3ekAVUQGgKSWZ5FFxOUNXTQtqcUtCK9uBYkwWlHZQ6ldncH0kNZm5PREJXZJCFnqYiFsbrjY0uiikmNyISFRosyZFhXAshWXmFLheRUFiSiIVMRSQMfa6loVTEztQUCZvkVKKIF8LNKz5lnZFqJiKRaVOiE7Goa5mKZtOwi5ygVvJzTSBTUk5mbJ3OPOoAj2HTFyyrggVn2eHRy9E0GxwejdPBAb5KB9NXh68Gz/dfHlJycHBw+GIsmmgn9NZpp/8fC3DtYVrNfVP2Xz3H6dHRweDl0RgHB/tjHBztZzh4MTo8HGfZPuLLTDRXkbCU1Ea6uX+SKaEh87p2uYgvr/hnQ7bSypJl9OPRiP9sY+wYgw4kM+SuA8jAEq0cKce3saoKmXieDH+3LGKx7iDpPP7A2l+DXBEtHaenv1PixKafXiuQZVk7nBYEVmFlc+2Cn8I7P7OBphE4vCEFdzmpNRrAHdo+4Mowm50Mhsv04cf7BvZJ+788WtSG1vVTUZ0e94OghwimVGg1s+D0k4JjGQjXqi6nZNYQSuVoRmYnJEufa/YRFisc4X4E1qFxUs0AHez3IO03y+jb9sK2io4I0lYFzoGvslB2hJMl9d2wxYjOE8dUFXpeknKQGQ88mbPltqhn34iFrzwJQ7rCMOhh6On6Nrd0Pz0J0Vt9BzpzxHUkyWEtzCGAtd5Hm6lwFdGYppJPY/FhLfZCAt2G/dP5+3/DuRfWBbxUSVGnlIJUG1HWRKKW199L+cfTb1P9uSbTZpJlfvul/erBzAYlVhyuLGMOp8ccmO0/KWVSedh2D07Y6afHnH0xUHuua0hyrS3xlTYHhZId7t9Jl0u1U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/PKQl1JiGEr2cCHTZrjcaQ4Xq+1bM1xbOAZah21jbQoRi9y5ysbDIVZyT9VFURXoGNpeosveOszPd4Fu60uxladYkGjHWf+A/pCI2g8/LivWT58uBJsjVaa391s8/7XQRSxGe/t7oy3nv0OFM4J0rrCUSduy2JjbqmzQObP9Hqa1LFwYV7A3JbOZEWA3vEaAKuUBasDuohTaMXUPWnCQ4y0Bhs1ZIDPPlJRK5692K7etZaRdNt4mw8RPEafKylnO/Sz3P9q6En3CaNenZ7oogHH41LMUs+mMRZd+vt/aun1RR1/csCpQKt+QMF0WLesu242biETsd2qrZXok4t7id8m9q0jkzNv4UiwWU7T00RRNw1/7Rpu3q5G4RSPZfZ6fqbT8OV3NQ/ca/vezNnP+Ax654d5pYfslKu6q/RgkYiEicUPzsInnRff3RXXP1voJ8DqnN1dNJHLClHeNl4v299dJQpVbu7lVqzjYVznmw/vzCx5u+zG+EdNe/E5Yi0U4caFvSDXNCqXj/xlh0/wXJwfgug==
sidebar_class_name: "post 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={"Roll back to a version"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/report/{id}/versions/{versionId}/rollback"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Makes an earlier version the published one. Does not modify the draft.

<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"},{"in":"path","name":"versionId","required":true,"schema":{"type":"string","format":"uuid"},"description":"The unique identifier of a published version.","example":"183ab994-792a-412a-91fa-60552ff1aa7f"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={undefined}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The version that is now published.","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"}}}}}},"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>


      