# Publish an old version again

Publishes an OLD version's words as a NEW version, live at once. Body: `version` (required, e.g. {"version": 3}). It is never a restore — version 3 stays byte-identical, the new version records that it came from 3, and a run halfway through version 5 keeps executing version 5. The versions to choose from are in `get_workflows_id_versions`.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/workflows/{id}/rollback`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "version": 1
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "version": {
      "createdAt": "string",
      "definition": "string",
      "id": 1,
      "publishedByUserId": 1,
      "rolledBackFrom": 1,
      "runAsAccountId": "",
      "version": 1,
      "workflowId": 1
    },
    "workflow": {
      "createdAt": "string",
      "createdByUserId": 1,
      "definition": "string",
      "description": "string",
      "id": 1,
      "key": "string",
      "name": "string",
      "publishedAt": "string",
      "runAsAccountId": "",
      "status": "string",
      "updatedAt": "string",
      "version": 1
    }
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
