# Roll back workspace state to a previous version

Copies a historical state file to a new version and sets the workspace state pointer to it. Blocked when a pipeline execution is in flight.

Endpoint: POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/state-versions/{data_id}/rollback
Version: 1.0
Security: x-api-key

## Path parameters:

  - `org` (string, required)
    Org is the organisation identifier.
    Example: "h"

  - `project` (string, required)
    Project is the project identifier.
    Example: "rva"

  - `workspace` (string, required)
    Workspace identifier
    Example: "Beatae et saepe aut iusto similique."

  - `data_id` (string, required)
    The unique identifier of the state version to roll back to
    Example: "9be8b7b8-1630-428e-8b48-480b0b778373"

## Header parameters:

  - `Harness-Account` (string, required)
    Account is the internal customer account ID.
    Example: "s75"

## Request fields (application/json):

  - `rollback_reason` (string)
    Optional human-readable reason for the rollback
    Example: "Eligendi sapiente id exercitationem aut."

## Response 200 fields (application/json):

  - `activity_id` (string, required)
    The unique identifier of the audit activity record
    Example: "12672515-965f-44ae-be60-c9ef8536c527"

  - `new_data_id` (string, required)
    The unique identifier of the new state version created by the rollback
    Example: "f81a93cf-00df-4405-a6ab-c25cbbc697e1"

  - `new_file_version` (integer, required)
    The file version timestamp (microseconds) of the new state object
    Example: 354228472227014500

## Response 400 fields (application/vnd.goa.error):

  - `fault` (boolean, required)
    Is the error a server-side fault?
    Example: true

  - `id` (string, required)
    ID is a unique identifier for this particular occurrence of the problem.
    Example: "123abc"

  - `message` (string, required)
    Message is a human-readable explanation specific to this occurrence of the problem.
    Example: "parameter 'p' must be an integer"

  - `name` (string, required)
    Name is the name of this class of errors.
    Example: "bad_request"

  - `temporary` (boolean, required)
    Is the error temporary?
    Example: true

  - `timeout` (boolean, required)
    Is the error a timeout?
    Example: true


