---
id: report-restore
title: "Restore a version into the draft"
description: "Copies a version's content into the draft. Does not change the published version."
sidebar_label: "Restore a version into the draft"
hide_title: true
hide_table_of_contents: true
api: eJztWNty20YS/ZWu2QfvVoHixZIlIbUPjqWUlUrWjiTHqahUYhNoEBMBM/DMQDLDwr9v9QxI8CZL1sb7lCdR5FxOnzl9nQuHUyviK3FOlTYO7shYqZUV15FIySZGVk5qJWLxRleSLOBiyQsLiVaOlAOpnAaXE6QGM7cHJ5osKO0gyVFNyf9U1ZNC2pzSxf49EQldkUE+/ywVsTAeQmzIOm1IRKJCgyU5MoxwLiTDqNDlIhIKSxKxkKmIhKFPtTSUitiZmiJhk5xKFPFcuFnFq6wzUk1FJDJtSnQiFnUtU9FsmniZE9RKfqoJZErKyUySAZ15AwI6Rk2fsawKPjjLDo4PB5Osd3A8Snv7eJT2JkcHR72Xw8MDSvb39w9ejUQT7YTe0nD2/7EAdz9AZ8rw6CVOjo/3e4fHI+ztD0fYOx5m2Hs1ODgYZdkQ8TATzXUkLCW1kW7mn2RCaMi8rl0u4qtr/tmQrbSyZBn9aDDgP9sYWwhwn2tLSx3dI2uqkpRuSkpEol3E52FVFTLxwun/YfnQ+Spl0nmLgqJ/DTeJaEGlnvxBiRObzL1WIMuydjgpCKzCyubaBebCy7+wAUsEDm+JoZNaEYYHv+SYAVeG5e1koEKmjz/nV+hR2v/lGaPW126ei+rsZN0t1hDBhAqtphacfpa7LFzjRtXlhMwKQqkcTcnshGTpU80cYbHEEfZHYB0aJ9UU0MFwDdKwWfjjNgvbV3RCkLYqcAa8lQ9lIpwsaZ2GLUV0TJxQVehZyaLPjAeezNhyW9TTr8TCW56FIV1i6K1hWLvr62jpfnoWorf6HnTmSAFhksOKm0MAaz1Hm8Fx6dGYppJXY/F+xfdCSN2G/ePFu//AhT+sc3ipkqJOfQDa8LImErW8+asu/3D2dVd/qsm0kWQR335pv3o0skGJFbsrnzGDsxN2zPaflDKpPGy7B6dM+tkJSM7yXtozXUOSa47RTi9i0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Dnvxbr3/r9Zvr1YNzuebBYqWt8+NEHlOJfkjZ/blMm/5i3tmfL+dxTb+bQAZVh/FjbQoRi9y5ysb9PlZyT9VFURXoGNleosu1+Zhv74LaVqdkS6L4INF2s/79/CIRtR9+WCSsHz9eCrZGqkxvj7e4/WuRi1gM9oZ7gy3uf0aFU4J0prCUSVux2JirqqzXcdl+D5NaFi50K7jWJLOZEWDXu0aAKuX+qTfB5JZSaLvUPWjBQY53BBgGZ0HL3FJSKp3f2k3ctqaTdlF3mwwT30ScKSunOZezXP5o60r08aKdp56HR+sG1BszxE1a5l0c+iaz7faZHX12/apAqXyRwhqat0q8aqdwIhKxn7Mth++RiNfHw0GP15HIWcrxlZjPJ2jpgymahr/2tTePYCNxh0YypV6zqbT8OV22SA9S8M/zNpj+C544Bt9pYPslKi60fWckYiEicUuzMK7nafhfi+qB0fYz4HWcN9dNJHLClMePV/P299dJQpVb2bmVvjgALMPO+3cXl9zvrvv9hp/743fCms/Dikt9S6ppligd/88Im+a/wKry+A==
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={"Restore a version into the draft"}
>
</Heading>

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



Copies a version's content into the draft. Does not change the 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"},{"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 whose content was copied into the draft.","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>


      