> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# analyticsReportRevisionRestore

> Restore a saved version of a report from its `revisions`. Saves the restored version as a new one, so nothing is lost. Null when the report does not exist. Throws REVISION_NOT_FOUND (404) when it has no version with that number.

**Required scopes:** [`analytics_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-analytics_write)

## Arguments

**reportId** `ID!` *required*

The id of the report.

**revisionNumber** `Int!` *required*

The `revisionNumber` to restore.

## Returns

**analyticsReportRevisionRestore**

An analytics report: a question answered as a table, with columns, filters and sorting. Read its rows with `analyticsReportRows`, or export them all with `analyticsReportExportStart`.

**fields**

**createdAt** *required*

When the report was created.

**definition**

What the report shows and how each column is calculated. Null while the report has no query.

**Requires:** [`analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-analytics_read)

**fields**

**columns** *required*

The report's columns, in display order.

**fields**

**calculation** `String`

How the column is calculated, such as `count of distinct returns`. Null for a column read as stored.

**caveat** `String`

Anything that changes how the column should be read.

**decimalPlaces** `Int`

How many decimal places the merchant shows. Null for the default.

**description** `String`

What the column means.

**filters** *required*

Filters that apply to this column only.

**key** `String!` *required*

The column's stable key.

**kind** *required*

What the column holds.

**label** `String!` *required*

The column's header.

**filters** *required*

Filters on every row of the report, including its date range.

**fields**

**description** `String`

What the filter keeps or drops.

**label** `String!` *required*

The filter's name.

**rowDescription** `String`

What one row represents, such as `One row per return`.

**rowLimit** `Int`

The most rows the report returns. Null for no limit.

**sorts** *required*

How rows are ordered, first key first.

**fields**

**columnKey** `String!` *required*

The key of the sorted column.

**columnLabel** `String!` *required*

The header of the sorted column.

**direction** *required*

The sort direction.

**summary** `String`

A short explanation of the report, written when it was made.

**failureCode**

Why the report FAILED. Null otherwise.

**failureReason** `String`

A merchant-facing explanation of the failure.

**id** `ID!` *required*

The id of this report.

**progressMessage** `String`

What Redo is doing while the report is PREPARING.

**question** `String`

The question or instruction behind the report's latest generation or edit.

**revisions**

Saved versions of the report, newest first.

**Requires:** [`analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-analytics_read)

**fields**

**Arguments**

**first** `Int`

How many versions to return, newest first (max 100).

**Fields**

**changes** `[String!]!` *required*

What changed from the version before it, such as `Column added: Refund amount`.

**createdAt** *required*

When this version was saved.

**revisionNumber** `Int!` *required*

The version's number; higher is newer.

**title** `String`

The report's title in this version.

**schedule**

The report's delivery schedule. Null when nothing is delivered by email or SFTP.

**Requires:** [`analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-analytics_read)

**fields**

**cadence**

The schedule as a daily, weekly or monthly cadence. Null when only `cronExpression` can express it.

**fields**

**dayOfMonth** `Int`

The day of a MONTHLY delivery, 1-31. A month without that day is skipped.

**dayOfWeek**

The day of a WEEKLY delivery.

**frequency** *required*

How often the report is delivered.

**hour** `Int!` *required*

The hour, 0-23.

**minute** `Int!` *required*

The minute, 0-59.

**cronExpression** `String!` *required*

The six-field cron expression (seconds first) the schedule runs on, in the report's timezone.

**emailDelivery** `Boolean!` *required*

Whether the report is emailed.

**emailRecipients** `[String!]!` *required*

The addresses the report is emailed to.

**nextRunAt** *required*

When the report is next delivered.

**sftpDelivery** `Boolean!` *required*

Whether the report is uploaded to the store's SFTP server.

**updatedAt** *required*

When the schedule last changed.

**status** *required*

Whether the report is ready to read.

**timezone** `String`

The IANA timezone dates are grouped and filtered in. Null uses the store's timezone.

**title** `String`

The report's title. Null while it is first being written.

**updatedAt** *required*

When the report last changed. Pass it as `expectedUpdatedAt` to `analyticsReportUpdate` to avoid overwriting someone else's edit.

## Example

```graphql theme={null}
mutation {
  analyticsReportRevisionRestore(reportId: "...", revisionNumber: 10) {
    createdAt
    failureCode
    failureReason
    id
    progressMessage
    question
    status
    timezone
    # ...
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.